Get Instruments in Graphql
This query returns a list of instruments with basic fields and instrument type.
GraphQL Query
query GetInstrumentList {
instrument(
pagination: {
limit: 20
offset: 0
}
) {
id
user_code
name
maturity_date
instrument_type {
id
user_code
name
}
}
}
Python Example
import requests
url = "https://<domain_name>/<realm_code>/<space_code>/graphql/"
headers = {
"Authorization": "Bearer <access_token>",
"Content-Type": "application/json"
}
payload = {
"query": """
query GetInstrumentList {
instrument(
pagination: {
limit: 20
offset: 0
}
) {
id
user_code
name
maturity_date
instrument_type {
id
user_code
name
}
}
}
"""
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Notes
- Field names must match the schema (
maturity_date,instrument_type, etc.) - Add filters the same way as in
currency_historywhen needed (Previous documentation page)
