[Eikon Python API] How do I specify a source when fetching data with the get_data function?
In Excel I am able to run the following formula: =RtGet("ATS", "INTERNAL_RIC", "BID")
To get access to a quote from an internal instrument.
How could I replicate this in python using the get_data function?
I have tried:
import eikon as ek
ek.set_app_key("xxx")
df, err = ek.get_data(
instruments=["INTERNAL_RIC"],
fields=["BID"],
parameters={"source":"ATS"}
)
without success.
How could I access the same (internal) data as in excel with the Python API?
Thanks and regards
Best Answer
-
Hi @nathan.simonis2 ,
I can retrieve the data properly, could you please let me know if the issue still persists?
If it is, please follow bullet 2.2 ) Refinitiv Data Library (RD Library) in Eikon Data API and Refinitiv Data Library - Troubleshooting and post the detail you got here for further investigation (RD Python Library version, enable the logging)
0
Answers
-
Hi @nathan.simonis2 ,
I would advise using the RD Library with Codebook and the DIB. The RD library is basically the Eikon Data API version 2.0. Codebook is a Python Environment with example code for you to refer to and automatic credential management solutions that ensure that any issues you encounter are not caused by permission issues. Lastly, DIB allows for an intuitive search of the fields you are after.
I looked on DIB for the field I think you're after:
I then copied the field name at the bottom right into codebook:Is this the data you were after?
Once you find the code you're after testing in Codebook, I suggest copying and pasting it in your own environment of choice with your own credentials. More about credential management in RD's Library in Python can be found here:
https://github.com/Refinitiv-API-Samples/Example.DataLibrary.Python/tree/main/Configuration0 -
Hello Jonathan,
Unfortunately, this is not the data I am after.As mentioned in the question, I would like to retrieve some data from an internal RIC which is not available on the IDN feed.
In Excel I can do this with : =RtGet(MY_SOURCE, MY_RIC, "BID"). It just so happens that in the example above, MY_SOURCE='ATS'.
I would like to know if there is a way that I can specify that I want the source to be different than the default IDN so I can fetch the same data with the Python API.Thank you,
Regards
Nathan
0 -
You may be able to use the Pricing interfaces to access your locally configured service. For example:
import refinitiv.data as rd
from refinitiv.data.content import pricing# Open a desktop session
rd.open_session()# Try to request data from your ATS.
stream = pricing.Definition(
universe = ["AAPL.O"], # "INTERNAL_RIC"
fields = ["BID", "ASK"],
service="IDN_RDF" # Try specifying "ATS"
).get_stream();
stream.open()# Retrieve data from the managed cache
stream.get_snapshot()1 -
Hi @nick.zincone,
Thanks for the reply.
I have tried the above but am getting stuck when trying to open the stream.
stream.open()
This runs indefinitely without returning an error message.
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛