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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
46 1 4 4

EikonError: Error code 413 Client Error: Request Entity Too Large - get symbology

I looked up a similar question to mine on the developer community, and the best solution proposed was dividing the list of symbols into 100. Is there a more efficient way to get rid of this error?

I am trying to use "get_symbology" to get RIC codes based on a list of 9200 ISINs.

My code and the full error below:

RICs, err= ek.get_symbology(list(ISIN_List), from_symbol_type="ISIN", to_symbol_type= "RIC")

RICs

EikonError: Error code 413 | Client Error: <!DOCTYPE html><html><head><title></title><link rel="stylesheet" href="/stylesheets/style.css"></head><body><h1>request entity too large</h1><h2>413</h2><pre>Error
    at readStream (/Applications/Eikon API Proxy.app/Contents/Resources/app.asar/node_modules/raw-body/index.js:196:17)
    at getRawBody (/Applications/Eikon API Proxy.app/Contents/Resources/app.asar/node_modules/raw-body/index.js:106:12)
    at read (/Applications/Eikon API Proxy.app/Contents/Resources/app.asar/node_modules/body-parser/lib/read.js:76:3)
    at jsonParser (/Applications/Eikon API Proxy.app/Contents/Resources/app.asar/node_modules/body-parser/lib/types/json.js:127:5)
    at Layer.handle [as handle_request] (/Applications/Eikon API Proxy.app/Contents/Resources/app.asar/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Applications/Eikon API Proxy.app/Contents/Resources/app.asar/node_modules/express/lib/router/index.js:317:13)
    at /Applications/Eikon API Proxy.app/Contents/Resources/app.asar/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/Applications/Eikon API Proxy.app/Contents/Resources/app.asar/node_modules/express/lib/router/index.js:335:12)
    at next (/Applications/Eikon API Proxy.app/Contents/Resources/app.asar/node_modules/express/lib/router/index.js:275:10)
    at logger (/Applications/Eikon API Proxy.app/Contents/Resources/app.asar/node_modules/morgan/index.js:144:5)</pre></body></html>
eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

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

Upvotes
Accepted
6.7k 8 6 7

Hi @Erik77 - thanks for your question. Yes an instrument list of 9200 ISINs will be too large for the API to handle at once. Please be aware of the data limits of the APIs by looking at the document here. You can try chunking the list into smaller pieces (lets say 100 ISINs) and presenting each chunk to the API. You need to pip install pydash first. You can chunk your list using:

from pydash.arrays import chunk
chunklist = chunk(ISIN_list, 100)
chunklist

and then present each chunk of 100 ISINs to the API.

I hope this can help



icon clock
10 |1500

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

Thanks @jason.ramchandi . The code you shared seems to work. But I am still not getting the desired results. See below:

Input:

RICs, err= ek.get_symbology(chunklist[1], from_symbol_type="ISIN", to_symbol_type= "RIC")

print(RICs)

Output:

'RIC'


Any suggestions as to why it returns the string 'RIC', as opposed to a DF with the RIC's for the 100 ISIN's on the list?

Upvotes
46 1 4 4

Thanks @jason.ramchandi . The code you shared seems to work. But I am still not getting the desired results. See below:

Input:

RICs, err= ek.get_symbology(chunklist[1], from_symbol_type="ISIN", to_symbol_type= "RIC")

print(RICs)

Output:

'RIC'


Any suggestions as to why it returns the string 'RIC', as opposed to a DF with the RIC's for the 100 ISIN's on the list?

icon clock
10 |1500

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

Upvote
6.7k 8 6 7

@Erik77 you need to drop the err on your api call (that is only used in get_data api call) - see code below:

RICs = ek.get_symbology(['GB00BH4HKS39','US88160R1014'], from_symbol_type="ISIN", to_symbol_type= "RIC")
RICs

I hope this can help.


1598445830279.png (13.7 KiB)
icon clock
10 |1500

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

Thank you @jason.ramchandi

Click below to post an Idea Post Idea