Hi team, for the get_news_story function is there a way to get the “global press” and “web news” al

Hi team, for the get_news_story function is there a way to get the “global press” and “web news” alongside the “news wires”? This is to get those news headlines from official news sources such as GLFILE and the stock exchange announcements. Thanks

Best Answer

  • raksina.samasiri
    Answer ✓

    Hi @vanessa.ilustrisimo ,

    According to the answer of is thread,

    To get headlines from sources other than NewsWire, the application needs to create a custom request and then send it through the send_json_request method.

    The name to be used in the repository parameter could be found on the Eikon News app (click the dropdown of the source in Source Selection) for example, Global Press Sources [NewsRoom] is shown. (sorry, I cannot insert the screenshot into this comment somehow)

    For example, if you'd like to get the news headline from “global press” and “web news” alongside the “news wires”, you may use the code below

    headlines = ek.send_json_request("News_Headlines",
    {
    'number': '15',
    'query': 'R:TSCO.L',
    'repository':'NewsWire,NewsRoom,WebNews'
    })
    df = ek.news_request.get_data_frame(headlines)
    df


    The example output

    |versionCreated|text|storyId|sourceCode

    2021-09-20 10:30:45.156|2021-09-20 10:30:46.988000+00:00|Malvern hop grower's new beer to hit Tesco she...|urn:newsml:newsroom:20210920:nNRAgnxosg:0|NS:MALGAZ

    2021-09-20 08:42:23.000|2021-09-20 08:42:23+00:00|UPDATE 1-UK meat industry warns some firms hav...|urn:newsml:reuters.com:20210920:nL8N2QM1IJ:6|NS:RTRS

    2021-09-20 08:25:27.000|2021-09-20 08:27:51+00:00|UK meat industry warns some firms have just fi...|urn:newsml:reuters.com:20210920:nL8N2QM1HQ:4|NS:RTRS

    2021-09-20 08:25:27.000|2021-09-20 08:25:27+00:00|UK MEAT INDUSTRY WARNS SOME FIRMS HAVE JUST FI...|urn:newsml:reuters.com:20210920:nL8N2QM1HQ:1|NS:RTRS

    2021-09-20 08:07:01.723|2021-09-20 08:07:01.723000+00:00|TESCO PLC - DIRECTOR DECLARATION|urn:newsml:reuters.com:20210920:nASN001O3M:1|NS:RTRS

    2021-09-20 08:07:01.649|2021-09-20 08:07:01.649000+00:00|REG - Tesco PLC - Director Declaration|urn:newsml:reuters.com:20210920:nRST2837Ma:1|NS:LSE

    2021-09-20 07:33:34.000|2021-09-20 07:33:34+00:00|MORNING BID-Attenzione ai prezzi del gas che c...|urn:newsml:reuters.com:20210920:nL8N2QM18G:1|NS:RTRS

    2021-09-20 07:01:30.000|2021-09-20 07:01:30+00:00|MORNING BID-Watch those spiralling gas prices|urn:newsml:reuters.com:20210920:nL8N2QL0J6:2|NS:RTRS

    2021-09-20 06:15:04.515|2021-09-20 06:15:04.989000+00:00|QUICK BITES|urn:newsml:newsroom:20210920:nNRAgnvum0:0|NS:HULDAI

    2021-09-20 04:15:42.000|2021-09-20 04:15:42+00:00|MEDIA-UK businesses ask PM for more leadership...|urn:newsml:reuters.com:20210920:nL4N2QM0HW:1|NS:RTRS

    2021-09-19 17:50:46.633|2021-09-19 17:50:47.145000+00:00|Tesco is selling tubs of Lindt chocolate - and...|urn:link:webnews:20210919:nNRAgnj7es:0|NS:PORTOD

    2021-09-19 17:50:46.346|2021-09-19 17:50:46.940000+00:00|Tesco North Harbour in Portsmouth will no long...|urn:link:webnews:20210919:nNRAgnj6g9:0|NS:PORTOD

    2021-09-19 17:47:16.637|2021-09-19 17:47:17.386000+00:00|Tesco is selling tubs of Lindt chocolate - and...|urn:newsml:newsroom:20210919:nNRAgnj8db:0|NS:LONNEW

    2021-09-19 17:47:16.714|2021-09-19 17:47:17.215000+00:00|Tesco North Harbour in Portsmouth will no long...|urn:newsml:newsroom:20210919:nNRAgnj8dg:0|NS:LONNEW

    2021-09-19 16:37:54.529|2021-09-19 16:37:55.055000+00:00|Store giant's fundraising initiative|urn:newsml:newsroom:20210919:nNRAgniw9v:0|NS:KEINEW


    hope this could help

Answers

  • @vanessa.ilustrisimo Im sorry - im not sure i understand - the get_news_story API just returns a single news story for a storyID or PNAC. The get_news_headlines API has a query parameter that allows you to select all sorts of topics or instruments or individual sources. You can build this query in the NEWS monitor app. I have written an article which shows this. However, I don't believe you can select groups of sources such as 'Web News' or 'Global Press' (as you can in the filter panel on the NEWS monitor app). I hope this can clarify.

  • Thank you for your response @jason.ramchandani to clarify this question, when using get_news_headlines API the client is only able to get news headlines from New Wire sources. News sources from Global Press and Web News are not included. api-news.png Eikon News Monitor retrieves news headlines from news wires, global press, and web news. Is Python News API access is limited to News Wires only? If so do we have plans in the future to include Global Press and Web News? Thank you.

  • @raksina.samasiri thanks for picking this up - I didn't know this was possible - I believe there should be a parameter for this in the get_news_headlines API call rather than ask the customer to create a custom query. I will take this up with product team.
  • Thank you too, Jason. Be able to put the parameter in the get_news_headlines would be great.