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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 1

EikonError: Error code 413 | Client Error: Payload Too Large get symbology

Hi I am converting around 13000 cusip, isin, and sedol to ric using eikon API and I am feeding into get_symbology a list of identifiers. I got the error 413: client error: payload too large even I try to shrink the list to as small as 5 entries. Does any one know what is the restriction eikon has on the size of list input? Thanks!

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonerrorerror-413
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
1 0 0 1

I split my list into 100 blocks. Even 1000 does not work for me.

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
4.6k 26 7 22

@yiliu.lu symbology api can be safely used on large datasets (think index constituents code conversion for a large index), so it is difficult to say what causes this behavior without looking at your code.

I may only assume that something went wrong after you attempted to execute the initial 13000 symbols as one request, however, it is something that I failed to replicate.

If this problem persists, please let us know.

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
1 0 0 1

Thanks! @Zhenya Kovalyov I am merging factset(that uses cusip) with eikon to fill in some missing entries. running the following line of code:

cric=ek.get_symbology(cusip,from_symbol_type='CUSIP',to_symbol_type='RIC')['RIC']

Where cusip is a list of 13000 cusips that I need to convert to ric.

The complete error message I got is:

Error code 413 | Client Error: Payload Too Large - <!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>
---------------------------------------------------------------------------
EikonError                                Traceback (most recent call last)
<ipython-input-501-c351c41ab672> in <module>
----> 1 cric=ek.get_symbology(cusip,from_symbol_type='CUSIP',to_symbol_type='RIC')['RIC']
~/anaconda3/envs/my_conda/lib/python3.7/site-packages/eikon/symbology.py in get_symbology(symbol, from_symbol_type, to_symbol_type, raw_output, debug, bestMatch)
    107 
    108     payload ={'symbols': symbol,'from': from_symbol_type,'to': to_symbol_type,'bestMatchOnly': bestMatch}
--> 109     result = eikon.json_requests.send_json_request(Symbology_UDF_endpoint, payload, debug=debug)
    110 
    111     if raw_output:
~/anaconda3/envs/my_conda/lib/python3.7/site-packages/eikon/json_requests.py in send_json_request(entity, payload, debug)
     98                 return result
     99             else:
--> 100                 raise_for_status(response)
    101 
    102         except requests.exceptions.ConnectionError as connectionError:
~/anaconda3/envs/my_conda/lib/python3.7/site-packages/eikon/json_requests.py in raise_for_status(response)
    189 
    190     if error_msg:
--> 191         logger.error('Error code {} | {}'.format(response.status_code, error_msg))
    192         raise EikonError(response.status_code, error_msg)
EikonError: Error code 413 | Client Error: Payload Too Large - <!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>

I think it might be a restriction on the server side. Any thoughts? Thanks a lot!

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
39.2k 75 11 27

@yiliu.lu
I suggest you split your list into several smaller ones. Rather than using a single list of 13K Cusips try doing your Cusip to RIC conversion in a loop with 13 lists of 1K Cusips each.

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.

Click below to post an Idea Post Idea