Get Instrument By ID
client.V1.Instruments.GetInstrumentByID(ctx, instrumentID, query) (*V1InstrumentGetInstrumentByIDResponse, error)
GET/v1/instruments/{instrument_id}
Get Instrument By ID
package main
import (
"context"
"fmt"
"github.com/clear-street/clear-street-go"
"github.com/clear-street/clear-street-go/option"
)
func main() {
client := clearstreet.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.V1.Instruments.GetInstrumentByID(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
clearstreet.V1InstrumentGetInstrumentByIDParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
{
"data": {
"country_of_issue": "US",
"currency": "USD",
"easy_to_borrow": true,
"id": "0f5a1a4e-5b3e-4d8f-9b7a-2b1d0e3f4a5b",
"instrument_type": "COMMON_STOCK",
"is_liquidation_only": false,
"is_marginable": true,
"is_restricted": false,
"is_short_prohibited": false,
"is_threshold_security": false,
"is_tradable": true,
"long_margin_rate": "0.25",
"name": "Apple Inc.",
"short_margin_rate": "0.25",
"symbol": "AAPL",
"venue": "XNMS"
},
"error": null,
"metadata": {
"request_id": "5b6c7d8e-9f0a-1b2c-3d4e-5f6a7b8c9d0e"
}
}{
"error": {
"code": 404,
"message": "Instrument not found: AAP"
},
"metadata": {
"request_id": "fa8cc9b2-fbf0-4f5b-8ce3-b3205b9f85f2"
}
}Returns Examples
{
"data": {
"country_of_issue": "US",
"currency": "USD",
"easy_to_borrow": true,
"id": "0f5a1a4e-5b3e-4d8f-9b7a-2b1d0e3f4a5b",
"instrument_type": "COMMON_STOCK",
"is_liquidation_only": false,
"is_marginable": true,
"is_restricted": false,
"is_short_prohibited": false,
"is_threshold_security": false,
"is_tradable": true,
"long_margin_rate": "0.25",
"name": "Apple Inc.",
"short_margin_rate": "0.25",
"symbol": "AAPL",
"venue": "XNMS"
},
"error": null,
"metadata": {
"request_id": "5b6c7d8e-9f0a-1b2c-3d4e-5f6a7b8c9d0e"
}
}{
"error": {
"code": 404,
"message": "Instrument not found: AAP"
},
"metadata": {
"request_id": "fa8cc9b2-fbf0-4f5b-8ce3-b3205b9f85f2"
}
}