Example code from Reuters is not working
So helpdesk has asked me to ask the community?? here ? why the quick tutorial code isnt working, i am using vs code python with jupyter notebook.
The code is just a copy from the quick start guide on the refinitiv website
import eikon as ek
import pandas as pd
ek.set_app_key('my-api tokin')
ek.get_news_headlines('EU AND POL',1)
it works fine until the last line, but simply doesnt return any code, instead after like 10 min waiting or similar it returns this:
2024-01-18 20:47:48,591 P[10672] [MainThread 28692] Error code 404 | Client Error: <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Error</title></head><body><pre>Cannot POST /api/v1/data</pre></body></html>2024-01-18 20:47:48,593 P[10672] [MainThread 28692] HTTP request failed: EikonError-Client Error: <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Error</title></head><body><pre>Cannot POST /api/v1/data</pre></body></html>
Best Answer
-
Thank you for reaching out to us.
The error indicates that your account doesn't support the API feature.
Cannot POST /api/v1/data
As I know, it depends on the Eikon variant that you are using. For example, the Eikon Core variant doesn't include Eikon Data API.
You can check it by folllowing the steps mentioned in the Eikon Data API and Refinitiv Data Library - Troubleshooting article.
Otherwise, you can contact your LSEG account team or Sales team to verify your account.
0
Answers
-
I am using the API feature daily with C#....
And they have verified it should work and themselves referenced to this code being the one that i should use
0 -
Which API are you using with C#?
0 -
i have not spent to much time looking into all different APIs i just use what has been given and works ( not good but at least sometimes )
EikonDesktopDataAPI
0 -
EikonDesktopDataAPI is a different API and it doesn't connect to the API proxy to get the data. However, Eikon Data API (Python) requires the AP proxy to get the data.
It could mean that your account doesn't support the API Proxy feature.
To verify if the API proxy is running, please check the Eikon Data API and Refinitiv Data Library - Troubleshooting article.
0 -
any reason why there are so many different APIs instead of one universal like BBGAPI?0
-
I think EikonDesktopDataAPI uses the old COM technology which is suitable for C# . However, it is not covenient for other programming langugaes, such as Python, and TypeScript.
The Eikon Data API supports several programming languages via the Refinitiv Data Libraies.
0 -
I have done all the tests necessary and the only difference i can see is that when running http://localhost:9000/ping?all
it doesnt have the sxsApps path stated {"path":"api"} is missing....
It seems when i google it that it could be something with the subscription being "Eikon Exchange Pricing" which doesnt include API?
On the other hand there is no problem generating an API key and also Python and the example code runs absolutely fine login me in using the key, there is no error or warning or anything only thing is that it doesnt return data....
Also, i use the old COM API daily and it works so some sort of access i should have.
0 -
The response should look like this:
If it doesn't have the "path":"/api" property, it could means that your Eikon variant doesn't support this feature. Therefore, you can't use the Eikon Data API to get the data.
0 -
I also added
ek.set_log_level(1) which was not in the quick start code and i get the following returned then, it seems the access is missing then ?
2024-01-22 13:23:09,245 P[19380] [MainThread 16008] Send GET request to http://127.0.0.1:9060/api/status to detect API Proxy...2024-01-22 13:23:09,246 P[19380] [MainThread 16008] Request to http://127.0.0.1:9060/api/status headers = {'x-tr-applicationid': 'myId'} params = None2024-01-22 13:23:11,297 P[19380] [MainThread 16008] HTTP request failed: ConnectError('All connection attempts failed')2024-01-22 13:23:11,298 P[19380] [MainThread 16008] Error on checking proxy url http://127.0.0.1:9060/api/status : ConnectError('All connection attempts failed')2024-01-22 13:23:11,300 P[19380] [MainThread 16008] Retrieved port 9060 value from .portIntUse isn't valid.2024-01-22 13:23:11,302 P[19380] [MainThread 16008] Warning: file .portInUse was not found. Try to fallback to default port number.2024-01-22 13:23:11,304 P[19380] [MainThread 16008] Try defaulting to port 9000...2024-01-22 13:23:11,306 P[19380] [MainThread 16008] Send GET request to http://127.0.0.1:9000/api/status to detect API Proxy...2024-01-22 13:23:11,308 P[19380] [MainThread 16008] Request to http://127.0.0.1:9000/api/status headers = {'x-tr-applicationid': 'ef2da95d05c64fec94c7c172bdb2de0aaabbe824'} params = None2024-01-22 13:23:11,314 P[19380] [MainThread 16008] Send request with headers [(b'Host', b'127.0.0.1:9000'), (b'Accept-Encoding', b'gzip, deflate'), (b'Connection', b'keep-alive'), (b'User-Agent', b'python-httpx/0.26.0'), (b'Accept', b'application/json'), (b'x-tr-applicationid', MYID')] and cookies None2024-01-22 13:23:11,315 P[19380] [MainThread 16008] HTTP request response 404: <!DOCTYPE html>
0 -
Yes, it seems that the API access is missing. It should not return 404 with the HTML document.
404: <!DOCTYPE html>
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 中文论坛