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
-
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 -
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
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 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
- 249 ETA
- 554 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.9K Refinitiv Data Platform
- 643 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- 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
- 192 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛