10 levels market depth via python API in datascope

onionw
onionw Newcomer
edited March 18 in TRTH

Hello,

I would like to query market data of RIC = LCOc1 and 10 levels market depth via python API.

this is Json file I used, but no instrument error shown below. please advise?

secondly what to add in Json for 10 levels market depth?

Extraction Services Version 18.3.1.48082 (0d5e6bbb8e4a), Built Jan 10 2025 19:16:51User ID: 9038901Extraction ID: 2000000882037631Correlation ID: CiD/9038901/AAAAAA.09515249d80aee81/RASchedule: 0x09515249d81aee81 (ID = 0x0000000000000000)Input List (1 items): (ID = 0x09515249d81aee81) Created: 17-03-2025 12:36:11 Last Modified: 17-03-2025 12:36:11Report Template: _OnD_0x09515249d81aee81 (ID = 0x09515249d82aee81) Created: 17-03-2025 12:36:09 Last Modified: 17-03-2025 12:36:09Schedule dispatched via message queue (0x09515249d81aee81)Schedule Time: 17-03-2025 12:36:10Processing started at 17-03-2025 12:36:10Processing completed successfully at 17-03-2025 12:36:11Extraction finished at 17-03-2025 12:36:11 UTC, with servers: xc18qrtpQ10Instrument <RIC,LCOc1> expanded to 0 RICS.Report suppressed because there are no instruments

image.png image.png

Answers

  • Hello @onionw

    It might be because you didn't specify the view. Try this following query to get market depth for LCOc1:

    {
      "ExtractionRequest": {
        "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.TickHistoryMarketDepthExtractionRequest",
        "ContentFieldNames": [
          "Ask Price",
          "Bid Price",
          "Number of Buyers",
          "Number of Sellers"
        ],
        "IdentifierList": {
          "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
          "InstrumentIdentifiers": [{
              "Identifier": "LCOc1",
              "IdentifierType": "Ric"
            }
          ],
          "ValidationOptions": None,
          "UseUserPreferencesForValidationOptions": False
        },
        "Condition": {
          "View": "NormalizedLL2",
          "NumberOfLevels": 10,
          "MessageTimeStampIn": "GmtUtc",
          "ReportDateRangeType": "Range",
          "QueryStartDate": "2025-03-03T15:00:00.000Z",
          "QueryEndDate": "2025-03-03T15:01:00.000Z",
          "DisplaySourceRIC": False
        }
      }
    }
    

    Result:

    #RIC,Domain,Date-Time,GMT Offset,Type,L1-BidPrice,L1-BuyNo,L1-AskPrice,L1-SellNo,L2-BidPrice,L2-BuyNo,L2-AskPrice,L2-SellNo,L3-BidPrice,L3-BuyNo,L3-AskPrice,L3-SellNo,L4-BidPrice,L4-BuyNo,L4-AskPrice,L4-SellNo,L5-BidPrice,L5-BuyNo,L5-AskPrice,L5-SellNo,L6-BidPrice,L6-BuyNo,L6-AskPrice,L6-SellNo,L7-BidPrice,L7-BuyNo,L7-AskPrice,L7-SellNo,L8-BidPrice,L8-BuyNo,L8-AskPrice,L8-SellNo,L9-BidPrice,L9-BuyNo,L9-AskPrice,L9-SellNo,L10-BidPrice,L10-BuyNo,L10-AskPrice,L10-SellNo
    LCOc1,Market Price,2025-03-03T20:00:00.009285927Z,+0,Normalized LL2,71.41,17,71.43,9,71.4,20,71.44,19,71.39,18,71.45,9,71.38,16,71.46,14,71.37,17,71.47,12,71.36,14,71.48,13,71.35,12,71.49,9,71.34,11,71.5,9,71.33,13,71.51,11,71.32,11,71.52,12
    LCOc1,Market Price,2025-03-03T20:00:00.064120724Z,+0,Normalized LL2,71.41,17,71.43,9,71.4,20,71.44,19,71.39,18,71.45,9,71.38,16,71.46,14,71.37,18,71.47,12,71.36,14,71.48,13,71.35,12,71.49,9,71.34,11,71.5,11,71.33,13,71.51,11,71.32,11,71.52,12
    LCOc1,Market Price,2025-03-03T20:00:00.089162764Z,+0,Normalized LL2,71.41,17,71.43,10,71.4,20,71.44,19,71.39,18,71.45,9,71.38,16,71.46,14,71.37,18,71.47,12,71.36,14,71.48,13,71.35,12,71.49,9,71.34,11,71.5,11,71.33,13,71.51,11,71.32,11,71.52,12
    LCOc1,Market Price,2025-03-03T20:00:00.099030024Z,+0,Normalized LL2,71.41,17,71.42,1,71.4,20,71.43,10,71.39,18,71.44,19,71.38,16,71.45,9,71.37,18,71.46,14,71.36,14,71.47,12,71.35,12,71.48,13,71.34,11,71.49,9,71.33,13,71.5,11,71.32,11,71.51,11
    LCOc1,Market Price,2025-03-03T20:00:00.114284336Z,+0,Normalized LL2,71.41,16,71.42,1,71.4,21,71.43,10,71.39,18,71.44,18,71.38,16,71.45,9,71.37,18,71.46,14,71.36,14,71.47,12,71.35,12,71.48,13,71.34,10,71.49,9,71.33,13,71.5,11,71.32,11,71.51,11
    LCOc1,Market Price,2025-03-03T20:00:00.124292726Z,+0,Normalized LL2,71.41,14,71.42,1,71.4,22,71.43,10,71.39,18,71.44,18,71.38,16,71.45,9,71.37,18,71.46,14,71.36,14,71.47,12,71.35,12,71.48,13,71.34,10,71.49,9,71.33,13,71.5,11,71.32,11,71.51,11
    …
    

    The view can be one of the following -

    image.png
  • onionw
    onionw Newcomer
    edited March 17

    thanks it works for me.

    another question: I need re-sampled data e.g. 1 sec or 1 min. what field shall I use in Json file?

    i changed orderType to below:

    "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.TickHistoryIntradaySummariesExtractionRequest",

    could you pls give me an example? also, do you have a DOC showing all options so that I could go through them myself

    image.png
  • You can see the REST API help on the DSS website which should list all the parameters etc. There are also the Postman samples available in the DSS and Tickhistory downloads tab which can be of help as well.

    For content query and questions around data, it is best to raise a help ticket at LSEG MyAccount.