For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
3 0 0 1

DataScope Select Search API failing when maxpagesize variable is set

Hi,

I've noticed when using the following payload and headers:

payload = json.dumps({
  "SearchRequest": {
    "ExchangeCodes": [
      "CMX"
    ],
    "IdentifierType": "RICRoot",
    "Identifier": "GC",
    "AssetStatus": "Active",
    "FuturesAndOptionsType": "FuturesOnOptions"
  }
})
headers = {
  'Prefer': 'respond-async;odata.maxpagesize=100000',
  'Content-Type': 'application/json'
}

url = "https://selectapi.datascope.refinitiv.com/RestApi/v1/Search/FuturesAndOptionsSearch"

requests.request("POST", url, headers=headers, data = payload, auth=HTTPBasicAuth(username, password))


The request times out with the following error:

 raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='selectapi.datascope.refinitiv.com', port=443): Max retries exceeded with url: /RestApi/v1/Search/FuturesAndOptionsSearch (Caused by ProxyError('Cannot connect to proxy.', RemoteDisconnected('Remote end closed connection without response')))

The request works after removing 'odata.maxpagesize=100000' from the 'Prefer' header, but this truncates the results for RIC roots with many underlying RICs.

Also, when changing the "FuturesAndOptionsType" to "Futures" for the same RIC root the request is completed successfully, even with 'odata.maxpagesize=100000' included in the header.

How do we get the full results for the payload above?

#technologydss-rest-apidatascope-selectsearch
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.

Hi @hamda.muse ,

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?
If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,
AHS

1 Answer

· Write an Answer
Upvotes
Accepted
22.1k 59 14 21

Hello @hamda.muse,

You are specifying a very large page size due to which the request is timing out before it gets fulfilled. I would recommend that you specify a smaller page size and use the @odata.nextlink property in response message to iterate and get the remainder data.

For more information on how to use this server driven paging feature, please read this online help for DSS.

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.