Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

Throttling API requests using refinitiv.data

Hi All,

I am trying to extract prices using the following screept.


import refinitiv.data as rd

rd.get_history(

list_RIC,

fields=['BID','HIGH_1', 'LOW_1','MID_PRICE','ASK','ASK_HIGH_1', 'ASK_LOW_1'],

start = '2022-12-31',

end = '2023-06-30',

interval="daily"

)


The language used is Python.

the library is refinitiv-data 1.4.0


I have a list of about four thousand RICs.


However, when I run it I get blocked, surely I exceed the limits allowed by the API, but I can't figure out what they are.


1695894947844.png

Do you have an idea to handle this and avoid getting stuck every time?


Thanks


python#technologyapirefinitiv-data-platformpython apirefinitiv-data-platform-librariesrefinitiv-data-libraries
1695894947844.png (8.7 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.

Upvotes
Accepted
81.4k 267 53 76

@Francesco.De.Venuto

Typically, the error 429 indicates that the application exceeds the request limit of the endpoint. For example, the interday-summaries endpoint limits 50 outstanding requests at a time and 50 requests allowed in one second.

You may split four thousand RICs to multiple requests.

Otherwise. you can enable logging in the API to verify what the problem is. Add the following configuration to the RD configuration file (refinitiv-data.config.json).

{   
  "logs": {
    "level": "debug",
    "transports": {
      "console": {
        "enabled": false
      },
      "file": {
        "enabled": true,
        "name": "refinitiv-data-lib.log"
      }
    }
...
}

The refinitiv-data-lib.log file will created in the current directory.

Please refer to the example on GitHub how to load the configuration file. For example:

import os os.environ["RD_LIB_CONFIG_PATH"] = "../../Configuration"

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.

Upvotes
6.2k 21 3 6

Hi @Francesco.De.Venuto ,

I'm afraid that this errror is instrument specific. What I mean is that it may come up depending on the RICs in the `universe`. The best way to see this is by using different instrument types, e.g.:


rd.get_history(
    universe=["USDSR3L10Y=", "LSEG.L"],
    fields=['BID','HIGH_1', 'LOW_1','MID_PRICE','ASK','ASK_HIGH_1', 'ASK_LOW_1', 'TR.ClosePrice'],
    start = '2022-12-31',
    end = '2023-06-30',
    interval="daily"
    )


1695901167026.png


In this example, "LSEG.L" returns 'TR.ClosePrice' data, but "USDSR3L10Y=" does not.


The best way to check if there is data for the fields you are after, for the instrument you are after is via the Data Item Browser. Have you tried using it?



1695901167026.png (76.4 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.

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.