TRTH API: Searching futures RICs

I'm trying to search some future RICs by using TRTH API "/Search/FuturesAndOptionsSearch". You can see the example json here.json.jpgThe initial request returned only 250 rows of result, so I tried to use the "@odata.nextlink". For the whole process of the example request, I requested for the url without skiptoken first, then requested urls which skiptoken='MjUw', 'NTAw', 'NzUw' and 'MTAwMA'. The total count of result RICs will always be 1089, which is same as what I can get on the website. But some RICs of the result are duplicates, and these RICs are totally random. I tried the whole process several times and the results of same requests were different. It looks like the responses do not have a certain sequence for the RICs. what can I do for this situation? By the way, I'm using python for programming.

Best Answer

  • Gurpreet
    Answer ✓

    Hi @cjm,

    Seems like you are having issues with paging the data properly. I just passed in this additional header parameter with the POST request, and received all 1089 RIC's in a single response:

    "Prefer": "odata.maxpagesize=2000; respond-async"

    and don't get any duplicate RIC's.