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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 0 2

Daily Exchange rate through EIKON Python API

I am trying to fetch the daily Exchange rate from EIKON API solution. Please see the below code.

start_date          = '2019-01-01'
end_date            = '2019-03-01' 
field               = ['BID','ASK']
ric                 = ['ZAR=','GBPZAR=']
params              = parameters={'SDate': start_date, 'EDate': end_date,'Frq': 'D'}
 
data,err            = ek.get_data(ric,field,params)

The Output is only showing results of the current date.

Can someone help?

  Instrument      BID      ASK
0       ZAR=  14.4942  14.4992
1    GBPZAR=  19.8543  19.8783


eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikon
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
Accepted
1.4k 6 2 2

Hi @alankar.gupta ,


By using the CodeCreator or Data Item Browser app, you may look for all fields you're looking for, e.g.:


TR.BIDPRICE.date
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
1.4k 6 2 2

Hi @alankar.gupta ,


Have you tried the CODECREATOR app on Eikon/Workspace?

Using it, I was able to look for different Bid and Ask fields to test, and I found some that seem to work as expected:


start_date ='2019-01-01'
end_date = '2019-03-01'
field = ['TR.BIDPRICE','TR.ASKPRICE']
ric = ['ZAR=','GBPZAR=']
params = {'SDate': start_date, 'EDate': end_date, 'Frq': 'D'}


df2, err = ek.get_data(instruments=ric,
                       fields=field,
                       parameters=params)
df2


Do let me know if this works as you wish.

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
3 0 0 2

Hi @jonathan.legrand How do I print the date beside the records?

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