Instruments

class saxo_openapi.endpoints.referencedata.instruments.Instruments(params)

Get a list of summary information for all instruments and options on the Saxo Trading platform restricted by the access rights of the user.

ENDPOINT = 'openapi/ref/v1/instruments/'
EXPECTED_STATUS = 200
METHOD = 'GET'
__init__(params)

Instantiate an Instruments request.

Parameters:params (dict (required)) – dict reppresenting the querystring parameters
>>> import json
>>> import saxo_openapi
>>> import saxo_openapi.endpoints.referencedata as rd
>>> client = saxo_openapi.API(access_token=...)
>>> params =
        {
          "AccountKey": "Cf4xZWiYL6W1nMKpygBLLA==",
          "Uics": "12,22,23"
        }
>>> r = rd.instruments.Instruments(params=params)
>>> client.request(r)
>>> print(json.dumps(r.response, indent=4))

Output:

{
  "Data": [
    {
      "AssetType": "FxSpot",
      "CurrencyCode": "AUD",
      "Description": "Euro/Australian Dollar",
      "ExchangeId": "SBFX",
      "GroupId": 28784,
      "Identifier": 12,
      "SummaryType": "Instrument",
      "Symbol": "EURAUD",
      "TradableAs": [
        "FxSpot",
        "FxForwards",
        "FxVanillaOption",
        "FxKnockInOption",
        "FxKnockOutOption"
      ]
    },
    {
      "AssetType": "FxSpot",
      "CurrencyCode": "AUD",
      "Description": "British Pound/Australian Dollar",
      "ExchangeId": "SBFX",
      "GroupId": 28867,
      "Identifier": 22,
      "SummaryType": "Instrument",
      "Symbol": "GBPAUD",
      "TradableAs": [
        "FxSpot",
        "FxForwards",
        "FxVanillaOption",
        "FxKnockInOption",
        "FxKnockOutOption"
      ]
    },
    {
      "AssetType": "FxSpot",
      "CurrencyCode": "CAD",
      "Description": "British Pound/Canadian Dollar",
      "ExchangeId": "SBFX",
      "GroupId": 28871,
      "Identifier": 23,
      "SummaryType": "Instrument",
      "Symbol": "GBPCAD",
      "TradableAs": [
        "FxSpot",
        "FxForwards",
        "FxVanillaOption",
        "FxKnockInOption",
        "FxKnockOutOption"
      ]
    }
  ]
}
expected_status
response

response - get the response of the request.

status_code