question

Upvotes
Accepted
5 0 1 7

HistoricalChainResolution connection error

Hi - I am trying to implement @zoya faberov 's answer from here: https://community.developers.refinitiv.com/questions/74504/futures-expiry-date-in-trth-python.html

As such I'm trying to run:

requestUrlChain = "https://hosted.datascopeapi.reuters.com/RestApi/v1/Search/HistoricalChainResolution"


requestHeaders={
    "Prefer":"respond-async",
    "Content-Type":"application/json",
    "Authorization": "token " + token
}

requestBody={
   "Request": {
          "ChainRics": ["0#FCE:"],
      "Range": {
          "Start": "2020-06-12T00:00:00.000Z",
          "End": "2021-06-12T00:00:00.000Z"
      }
  }
}

r2 = requests.post(requestUrlChain, json=requestBody,headers=requestHeaders)


However I get the following error:

ConnectionError: HTTPSConnectionPool(host='hosted.datascopeapi.reuters.com', port=443): Max retries exceeded with url: /RestApi/v1/Authentication/RequestToken (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000001E23E18C400>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))


I am able to successfully run an ExtractionRequest with this request header, so I'm not sure why this request is failing.

pythonpython apisearchchain-ric
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
Upvote
Accepted
80.1k 257 52 75

@pdebaz

The RTH URL has been changed to "https://selectapi.datascope.refinitiv.com".

Therefore, the code should look like this.

requestUrlChain = "https://selectapi.datascope.refinitiv.com/RestApi/v1/Search/HistoricalChainResolution"

requestHeaders={
    "Prefer":"respond-async",
    "Content-Type":"application/json",
    "Authorization": "token " + token
}
 
requestBody={
   "Request": {
          "ChainRics": ["0#FCE:"],
      "Range": {
          "Start": "2020-06-12T00:00:00.000Z",
          "End": "2021-06-12T00:00:00.000Z"
      }
  }
}
 
r2 = requests.post(requestUrlChain, json=requestBody,headers=requestHeaders)

1656295714500.png

I hope this will help you.


1656295714500.png (76.2 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.

This worked. Thank you very much.

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.