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 2 4

Getting data from api

I'm trying to get data from the Eikon api. My code is as following:


import eikon as ek

ek.set_app_key('xxxxxxxx')

fields = ['TR.HeadquartersCountry','CF_LAST','TR.CompanyMarketCap(Scale=6 Curn=EUR)','TR.PricePctChgYTD','TR.PriceToBVPerShare','TR.PE','TR.FwdPE','TR.PriceToCFPSTrailing12m','TR.FwdPriceToCFPerShare','TR.EVToSales','TR.RelValEVSalesNTM','TR.EVToEBITDA','TR.FwdEVToEBITDA','TR.EVToEBIT','TR.FwdEVToEBIT','TR.PEG','TR.ROEPercentTrailing12M','TR.ROEMEAN','TR.ROAMEAN','TR.NetDebtToEBITDA','TR.OperatingMarginPercent','CURRENCY','TR.WACCCostofEquity','TR.WACC','TR.EBITMarginPercent','TR.EBITDAMarginPercent','TR.NetDebt','TR.Cash']

tickers = ['MARL.IC','G1AG.DE','JBT','MIDD.O']

And to get data I do

data = ek.get_data(tickers,fields,None,False,True,False)


I'm not sure if I'm able to connect to eikon, so I don't know if I've established connection. The Eikon application is up an running, so that is not the issue. Maybe my issue is with ek.set_app_key('xxxxxxxx'), where I get no logging after that part of the code.


eikoneikon-data-apirefinitiv-dataplatform-eikonworkspaceworkspace-data-apiconnection-error
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.

@olafur

Hi,

Please let us know if you have any updates on this question.

If it is still an issue, please post again to offer further insight into your question.

Regards,

AHS

@olafur

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Upvotes
Accepted
10.2k 18 6 9

@olafur so please try adding:

ek.set_log_level(1)

after your import and se what the output is.

We also have a useful troubleshooting guide for you to follow. I hope this can help.

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
22k 58 14 21

Hi @olafur,

If the API wasn't connecting to Eikon, it would throw an exception. What is the output of dataframe?

print(data)

To enable logging and see the information on console, you can set:

import logging.config
ek.set_log_level(logging.DEBUG)
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
1 0 2 4

Hi, after some digging I'm getting the following error


"EikonError(404, 'Client Error: <!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /api/v1/data</pre>\n</body>\n</html>\n')"


when I use the ek.get_data(tickers,fields,None,False,True,False) function. Any ideas?

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
39.4k 77 11 27

@olafur

Were you able to resolve the issue? Or is it still outstanding? If you're still experiencing the problem, could you share the full logging output after setting the log level to the max using ek.set_log_level(1) call?

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.