Is it possible to get macroeconomic indicators with an API?

I'm trying to automate some of our queries, which are mostly on indicators like GDP growth. I can get this data in Excel, as well as the stand-alone Eikon App, but because I am most familiar with Python, I would like to download it with Python. I found these as instruments in Data Item Browser, but did not finde any Data Items under them. Is there a way to request this data with the Python API? If not, which API can I use? TIA
Best Answer
-
You can use the same field names you use in =RtGet or =TR function in Excel. E.g. if you're using =TR("USGDPF=ECI","GN_TXT16_4") to retrieve the latest actual reported US GDP growth into Excel, you can use ek.get_data(['USGDPF=ECI'],['GN_TXT16_4']) in Python to retrieve the same data as a pandas dataframe.
0
Answers
-
Thanks. This works great for the GDP stuf, but do you also know how I can get the instruments that start with an "a"? (e.g. 'aCNFRTRRAW'). I have not been able to get them, and the error is: "TSIUnknownInstrument". Thanks in advance, TDS
0 -
Economic indicator RICs starting with a small 'a' are historical only RICs. There's no quote for these RICs on the real-time datastream, you can only retrieve timeseries for these instruments using get_timeseries method, which given the error message you received I figure is what you're already trying to do. There are two issues here. One is a bug in Eikon Python library, which results in incorrect handling of mixed case RICs (such as the ones starting with small 'a') when those RICs are provided to get_timeseries method as strings. This bug is the reason for the error message you received. The bug will be fixed in the production release of Eikon Python library. In the meantime the workaround is to always use list in the first argument of get_timeseries method. The second issue is that the default value for interval parameter of get_timeseries method is 'daily'. Most economic indicators are not updated on a daily basis and for most economic indicator RICs starting with small 'a' daily interval does not exist in the timeseries database. You need to make sure you use appropriate interval value for the RIC in get_timeseries method. Here's an example:
ek.get_timeseries(['aCNFRTRRAW'], interval='monthly')0
Categories
- All Categories
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 33 Data Model Discovery
- 682 Datastream
- 1.4K DSS
- 613 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.8K Refinitiv Data Platform
- 625 Refinitiv Data Platform Libraries
- 5 LSEG Due Diligence
- 1 LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 83 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛