question

Upvotes
Accepted
1 0 0 1

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.

#productricssearchfutures
json.jpg (31.1 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
23.7k 61 15 21

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.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.