Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 1

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>

eikoneikon-data-apiworkspace#productnews
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @johan01 ,

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?
If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,
AHS

@johan01

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

Upvotes
Accepted
79.2k 251 52 74

@johan01

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.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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

@johan01

Which API are you using with C#?

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



Show more comments
Upvotes
1 0 0 1

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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@johan01

The response should look like this:

1705986524551.png

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.

1705986524551.png (25.6 KiB)
Upvotes
1 0 0 1

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>

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@johan01

Yes, it seems that the API access is missing. It should not return 404 with the HTML document.

 404: <!DOCTYPE html>


Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.