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

Is this query optimal?

I was referred here to customer support.

This requests hangs, sometimes works, and unexplicable throws "backend error. 400 Bad Request" unreproducible errors. Is there something sub-optimal about my request, or another way of doing this that plays nicer with the API?

 data_holding, err = ek.get_data( 
'US4781601046'
,
                                fields=["TR.InvestorFullName",
                                        "TR.InvParentType",
                                        "TR.InvestorRegion",
                                        "TR.InvestorType",
                                        "TR.SharesHeld.Date",
                                        "TR.SharesHeld",
                                        "TR.SharesHeldValue",
                                        "TR.SharesHeldValChg"
                                        ],
                                parameters={'SDate': '1980-01-01'.format(start_date),
                                            'EDate': '2020-12-31'.format(end_date),
                                            'Frq': 'D'})
eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-api
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
Upvotes
Accepted
39.4k 77 11 27

@thok

I suggest you use CodeCreator app to help you construct data retrieval calls. Using CodeCreator app you can explore the metadata including field names for data items you're interested in and parameters applicable to these fields. The fields you retrieve are not provided as daily timeseries. According to the metadata, these fields can only be retrieved "as of" a specific date. In other words only the SDate parameter for these fields is valid. The Frq parameter in your request is ignored, whereas what you get when you include both SDate and EDate is anybody's guess. It's not documented. What is clear however is that the request you're submitting is for a large amount of data, which is very taxing on the backend. I'm not at all surprised that it takes a long time to get a response or that you receive "Backend error. 400 Bad Request" as a response, which indicates a timeout from the backend. If anything, I'm surprised to hear this request sometimes works for you.

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.