ld.news.get_headlines

Teddy
Teddy Newcomer
edited September 16 in Eikon Data APIs

I was using python library to fetch news by ld.news.get_headlines(query='"Elon Musk" AND Language:LEN AND Source:"X"', count=10). However it returned LDError: Error code 400 | Query cannot return any result.

Since I was trying to retrieve social media posts (explicitly X posts), is there a function to do it?

Answers

  • Hello @Teddy

    I can replicate the same issue on my end with both Desktop and Platform session.

    ld_error.png

    I see that the Workspace's New Monitor App can filter the X news source as follows:

    news_monitor.png

    I will contact the Data Library team to confirm if this news data source X is available to query via the API.

  • I also want to know the reason behind for news data source X - will appreciate for your further reply, thanks

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @YHUA

    The issue likely originates from the News endpoint.

    Please contact the News Service – Delivery Platform support team directly via LSEG Support to confirm and investigate the problem.

  • Can I please suggest to add repository=Social to query

    all repos

    /headlines?query="Elon Musk" AND Source:X&limit=100&repository=NewsWire,NewsRoom,WebNews,Social

    only social

    /headlines?query="Elon Musk" AND Source:X&limit=100&repository=Social

    It appears this is what is being submitted:

    /headlines?query=Paris and repositories:Social&limit=10

    But, it should be:

    /headlines?query=Paris&limit=10&repository=Social

    /headlines?query=Source:X&limit=10&repository=Social

    meanwhile we will be making Social repo available by default if its not provided

  • Hello @Teddy

    The library team is acknowledged of this issue. They are investigating the issue.

  • In News Cloud Services (NCS), we identified issue whereby the repository parameter (Social) is not supported by DATA LIB library.

    NCS is planning to release a fix which will be available to all users on Oct 22.

    The following query syntax will work upon the fix being applied on Oct 22:

    "querystring": {

                "query": "\"Elon Musk\" AND Source:X",

                "sort": "newToOld",
    "limit": 100,

            },