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 1 2

Eikon API Python, why I'm limited to 10 headline news in one request?

When I'm sending a request to extract headlines on Eikon API, I'm limited to 10 lines per request?? Before August, I have no such issue... Thanks for your help.

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apinews
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 @a.dufour

Thank you for your participation in the forum.

Do the replies below answer your question?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide other community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks, AHS

Upvotes
Accepted
4.3k 2 4 5

10 is the default requested headline number.

You can modify it with the parameter count :

get_news_headlines(query='Topic:TOPALL and Language:LEN', count=20)
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 0 1 2

Many thanks for your answer Pierre. It works! But do you know if I have to always put that limit "count". My resquest is on a specific RIC or basket of RIC on a range of time so I don't know the length of my final dataframe. Of course I can enter the parameter "count" equal to 1 000 or higher for example. But it's not the best way of coding....

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
4.3k 2 4 5

You're limited to a maximum of 100 news headlines (any request for more than 100 headlines will fail in error).

If you set date_from and date_to to retrieve a limited range of news (less than 100) with count=100, your result will contain all available items.

In following example, the result contains 3 headlines despite the count limit set to 100:

>>> ek.get_news_headlines(query='RENA.PA', date_from='2017-09-16', date_to='2017-09-18', count=100)
                             versionCreated  \
2017-09-17 20:43:24 2017-09-17 20:43:24.000
2017-09-16 06:32:26 2017-09-16 06:32:26.000
2017-09-16 06:06:43 2017-09-16 06:06:47.004
                                                                  text  \
2017-09-17 20:43:24  Motor racing-Aston Martin wants to be more inv...
2017-09-16 06:32:26  DJ Car Chief Bets Big on Growth -- WSJ<7201.T>...
2017-09-16 06:06:43  McLaren finally cut ties with Honda<7267.T><RE...
                                                          storyId sourceCode
2017-09-17 20:43:24  urn:newsml:reuters.com:20170917:nL4N1LY0D1:2    NS:RTRS
2017-09-16 06:32:26  urn:newsml:reuters.com:20170916:nDJUP00035:1     NS:DJN
2017-09-16 06:06:43  urn:newsml:reuters.com:20170916:nNRA4hpjek:1  NS:TELGPH
>>>
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
16 0 0 0

@pierre.faurel if my headlines request has more than 100 results, is there a way to access all of them?

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.

Only by splitting the request into multiple requests and narrowing the time range of each request to ensure there's less than 100 headlines returned for each time window.

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.