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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

olafur avatar image
1 0 0 2

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-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonconnection-error
10 |1500

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

jason.ramchandani01 avatar image
7.4k 10 6 8

@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.

10 |1500

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

Gurpreet avatar image
14.7k 39 12 18

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)
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 avatar image
1 0 0 2

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?

10 |1500

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

Alex Putkov.1 avatar image
39.3k 76 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?

10 |1500

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