question

Upvotes
Accepted
1 3 3 5

new retrieval api with python ???

Hello - can someone tell me which api to use for news retrieval and give me a template script to do so from a python ide?

python#technology#productnewsnews-text-analytics
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.

Upvote
Accepted
14.9k 32 5 10

Hi @mbh181 ,

The news can be retrieved by the Python library with the below

Or if you have access to the Refinitiv Workspace/ Eikon Desktop application, you can access the CodeBook application which contains an example folder with the example code to retrieve the news via these APIs

1674018532551.png

For example, News retrieval via Eikon Data API example is in folder __Examples__/01. Data Retrieval and Discovery/01.04. Eikon Data API/

1674018554519.png

Hope this helps and please let me know in case you have any further questions.


1674018532551.png (8.0 KiB)
1674018554519.png (14.2 KiB)
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.

Upvotes
1 3 3 5

thanks for this. this worked but now after a few days i am getting an error


'AttributeError: partially initialized module 'eikon' has no attribute 'set_app_key' (most likely due to a circular import)'


I have checked the app key, renewed it in case and tried an upgrade of the eikon library on my machine - without any luck any thoughts?

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.

Upvotes
26.3k 61 17 14

Hello @mbh181

Did you use the Eikon Data API library?

import eikon as ek

ek.set_app_key('8e9bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1b035d')

Or the https://pypi.org/project/refinitiv-data/ library?

import refinitiv.data.eikon as ek
ek.set_app_key('XXXXXX')

I recommend you uninstall the library and then re-install the latest version library.

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.

Upvotes
1 3 3 5

hello @wasin.w i have installed the latest version of the Eikon Data API via pip. i am currently running 1.1.16 and still getting this error. i have reinstalled the latest version. same error msg.

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.

Upvotes
26.3k 61 17 14

Hello @mbh181

I am sorry to hear that you are facing the issue.

Can you please set up a new fresh Python environment, then install only Eikon Data API and try in Python command line mode? You can see how to set up a Python environment from this Quick Start page.

In the meantime, you can use the Eikon/Workspace "CodeBook" app which is the cloud-hosted Jupyter Notebook development environment for Python scripting from the application. The CodeBook is natively available in Refinitiv Workspace and Eikon as an app, providing access to Refinitiv APIs and other popular Python libraries that are already pre-installed on the cloud.

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.

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.