News API filters exclusions

viquar.shaikh
viquar.shaikh Newcomer
edited February 13 in Eikon Data APIs

I'm trying to filter out news through the EIKON api and have built the following query. I would expect this to exclude news items sourced from LSE but I find news items from this in my resultset.

( ( Topic:FUND AND Language:LEN ) NOT ( Source:DJN OR Source:NBSX OR Source:HIIS OR Source:HOSE OR Source:PHSE OR Source:BSE OR Source:FT OR Source:NZXR OR Source:LSE OR Source:SET OR Source:ASX OR Source:CMNW OR Source:JSE OR Source:IDX OR Source:SGX ) NOT ( \"TOP NEWS\" OR \"Net Asset\" OR  \"BRIEF-\" OR \"NAV\"  ) )

Some of the news headlines returns from this above query are as below and they are from LSE

text

storyId

REG - KraneS CSI China Eur - KraneSharesCSIChinaInternet UCITS ETF EUR 10.02.25

urn:newsml:newsroom.refinitiv.com:20250211:nRSK6804Wa:0

REG - KraneS CSI China Int - KraneShares CSI China Internet UCITS ETF 10.02.25

urn:newsml:newsroom.refinitiv.com:20250211:nRSK6803Wa:0

REG - KraneS CSI China GBP - KraneSharesCSIChinaInternet UCITS ETF GBP 10.02.25

urn:newsml:newsroom.refinitiv.com:20250211:nRSK6806Wa:0

REG - KraneS China Clean $ - KraneShrsMSCI China Clean Tech UCITS ETF 10.02.25

urn:newsml:newsroom.refinitiv.com:20250211:nRSK6812Wa:0

REG - KraneS Elec Veh Fut$ - KraneShrsMSCI Electric Vehicle UCITS ETF 10.02.25

urn:newsml:newsroom.refinitiv.com:20250211:nRSK6808Wa:0

REG - KraneS ICBCCS S&P $ - KraneShares ICBCCS S&P China500 UCITS ETF 10.02.25

urn:newsml:newsroom.refinitiv.com:20250211:nRSK6809Wa:0

REG - KraneS ICBCCS SSE S$ - KraneShrsICBCCSSSEStrMrket50Idx UCITS ETF 10.02.25

urn:newsml:newsroom.refinitiv.com:20250211:nRSK6811Wa:0

REG - International PPL - Transaction in Own Shares

urn:newsml:newsroom.refinitiv.com:20250211:nRSK5938Wa:0

Besides being able to filter out LSE (would be great if you can please assist on it), I’m also trying to understand if we can exclude news headlines entirely that are all-caps (e.g. below)

text

storyId

EX-TRUMP ADVISER STEVE BANNON IS SENTENCED TO THREE YEARS CONDITIONAL DISCHARGE, WITH NO JAIL TIME, AFTER PLEADING GUILTY IN BORDER WALL FUNDING CASE

urn:newsml:newswire.refinitiv.com:20250211:nL1N3P20RE:1

ISS CITES "INCREASED ATTENTION ON DIVERSITY, EQUITY, AND INCLUSION (DEI) PRACTICES"

urn:newsml:newswire.refinitiv.com:20250211:nL1N3P20QW:2

PROXY ADVISER ISS SAYS IT WILL NO LONGER CONSIDER GENDER, RACE OR ETHNICITY IN US BOARD RECOMMENDATIONS

urn:newsml:newswire.refinitiv.com:20250211:nL1N3P20QW:1

Answers

  • @viquar.shaikh Thanks for your question. So the following query does not seem to be returning as News Source of LSE:

    ek.get_news_headlines(query = 'Topic:FUND AND Language:LEN NOT ( Source:DJN OR Source:NBSX OR Source:HIIS OR Source:HOSE OR Source:PHSE OR Source:BSE OR Source:FT OR Source:NZXR OR Source:LSE OR Source:SET OR Source:ASX OR Source:CMNW OR Source:JSE OR Source:IDX OR Source:SGX ) NOT ( ( "" AND "TOP NEWS" ) OR ( "" AND "Net Asset" ) OR ( "" AND "BRIEF-" ) OR ( "" AND "NAV" )', count=100)
    image.png

    You can check to see if its working using the NEWS2.0 app - see below:

    image.png

    Regarding the filtering of news on all uppercase - this is not possible using the news query language and is best done in Python after the response has been received.

    I hope this can help.

  • Thank you for taking a look at it, Jason.

    I tried again, this time making it a little more simple compared to before. The query is

    Topic:FUND AND Language:LEN NOT ( Source:DJN OR Source:NBSX OR Source:HIIS OR Source:HOSE OR Source:PHSE OR Source:BSE OR Source:FT OR Source:NZXR OR Source:LSE OR Source:SET OR Source:ASX OR Source:CMNW OR Source:JSE OR Source:IDX OR Source:SGX OR Source:EDG OR Source:CNSWCH)

    The output still has LSE items

    versionCreated

    text

    storyId

    sourceCode

    44:37.2

    2025-02-12 10:44:38.152000+00:00

    REG - HANetf II ICAV HANetf PTTRBACC $ HANetf PTTRBACC £ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8744Wa:0

    NS:LSE

    35:31.9

    2025-02-12 10:35:32.570000+00:00

    REG - PIMCO US Shrt Mat AC - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8728Wa:0

    NS:LSE

    35:30.8

    2025-02-12 10:35:31.396000+00:00

    REG - PIMCO HY Corp EUR AC - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8727Wa:0

    NS:LSE

    35:30.5

    2025-02-12 10:35:31.121000+00:00

    REG - PIMCO HY Hdg £ IN - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8726Wa:0

    NS:LSE

    35:28.7

    2025-02-12 10:35:29.511000+00:00

    REG - PIMCO HY Cp Bd AC - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8725Wa:0

    NS:LSE

    35:28.4

    2025-02-12 10:35:29.236000+00:00

    REG - PIMCO LD US CORP $IN - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8724Wa:0

    NS:LSE

    35:26.0

    2025-02-12 10:35:26.540000+00:00

    REG - PIMCO EM Bond Inc IN - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8723Wa:0

    NS:LSE

    35:25.0

    2025-02-12 10:35:26.105000+00:00

    REG - PIMCO High Yld $ IN - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8721Wa:0

    NS:LSE

    35:25.1

    2025-02-12 10:35:25.931000+00:00

    REG - PIMCO High Yld E IN - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8722Wa:0

    NS:LSE

    33:30.5

    2025-02-12 10:33:31.268000+00:00

    REG - PIMCO EM ADV Local $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8720Wa:0

    NS:LSE

    33:29.4

    2025-02-12 10:33:30.077000+00:00

    REG - PIMCO GBP Sht £ IN - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8719Wa:0

    NS:LSE

    33:28.4

    2025-02-12 10:33:29.001000+00:00

    REG - PIMCO USD Short IN - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8718Wa:0

    NS:LSE

    22:26.4

    2025-02-12 10:22:26.915000+00:00

    REG - FRK Dev World ETF $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8712Wa:0

    NS:LSE

    22:25.3

    2025-02-12 10:22:25.930000+00:00

    REG - FRK MSCI CH Paris $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8711Wa:0

    NS:LSE

    22:24.1

    2025-02-12 10:22:24.684000+00:00

    REG - FRK Future Food ETF$ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8710Wa:0

    NS:LSE

    22:23.1

    2025-02-12 10:22:24.017000+00:00

    REG - FRK Glb Qual Div $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8709Wa:0

    NS:LSE

    22:21.9

    2025-02-12 10:22:22.545000+00:00

    REG - FRK Sus Eur Gr Bnd E - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8708Wa:0

    NS:LSE

    22:20.9

    2025-02-12 10:22:21.766000+00:00

    REG - FRK Sust Euro Grn C - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8707Wa:0

    NS:LSE

    22:19.8

    2025-02-12 10:22:20.440000+00:00

    REG - FRK Sust Euro Grn S - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8706Wa:0

    NS:LSE

    22:18.7

    2025-02-12 10:22:19.573000+00:00

    REG - FRK Euro IG CORP ETF - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8705Wa:0

    NS:LSE

    22:17.7

    2025-02-12 10:22:18.300000+00:00

    REG - FRK Future Health $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8704Wa:0

    NS:LSE

    22:16.6

    2025-02-12 10:22:17.370000+00:00

    REG - FRK MSCI EM Paris $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8703Wa:0

    NS:LSE

    22:15.6

    2025-02-12 10:22:16.107000+00:00

    REG - FRK AI Meta ETF $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8702Wa:0

    NS:LSE

    22:14.4

    2025-02-12 10:22:15.088000+00:00

    REG - FRK CEM Dbt ETF $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8701Wa:0

    NS:LSE

    22:13.5

    2025-02-12 10:22:14.066000+00:00

    REG - FRK FTSE TW ETF $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8700Wa:0

    NS:LSE

    22:12.5

    2025-02-12 10:22:13.169000+00:00

    REG - FRK STX PA ETF E - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8699Wa:0

    NS:LSE

    22:11.2

    2025-02-12 10:22:12.024000+00:00

    REG - FRK SP 500PA ETF $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8698Wa:0

    NS:LSE

    22:10.0

    2025-02-12 10:22:10.681000+00:00

    REG - FRK FTSE India $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8697Wa:0

    NS:LSE

    22:09.1

    2025-02-12 10:22:09.645000+00:00

    REG - FRK China ETF $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8696Wa:0

    NS:LSE

    22:07.9

    2025-02-12 10:22:08.476000+00:00

    REG - FRK Korea ETF $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8695Wa:0

    NS:LSE

    22:06.5

    2025-02-12 10:22:07.692000+00:00

    REG - FRK USIGCrp ETF $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8692Wa:0

    NS:LSE

    22:06.3

    2025-02-12 10:22:07.371000+00:00

    REG - FRK EurShrt ETF E - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8691Wa:0

    NS:LSE

    22:06.8

    2025-02-12 10:22:07.307000+00:00

    REG - FRK Brazil ETF $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8694Wa:0

    NS:LSE

    22:06.7

    2025-02-12 10:22:07.143000+00:00

    REG - FRK Asia XChXJp$ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8693Wa:0

    NS:LSE

    22:06.2

    2025-02-12 10:22:06.938000+00:00

    REG - FRK Emr Mkt ETF $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8690Wa:0

    NS:LSE

    22:05.9

    2025-02-12 10:22:06.770000+00:00

    REG - FRK Eur Qual. Div E - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8689Wa:0

    NS:LSE

    22:05.6

    2025-02-12 10:22:06.721000+00:00

    REG - FRK US EQ ETF $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8688Wa:0

    NS:LSE

    22:01.1

    2025-02-12 10:22:01.658000+00:00

    REG - FRK Glob Eq Sri $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8687Wa:0

    NS:LSE

    21:58.1

    2025-02-12 10:21:58.628000+00:00

    REG - FRK Saudi Arabia $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8686Wa:0

    NS:LSE

    21:44.9

    2025-02-12 10:21:45.505000+00:00

    REG - FRK FTSE EMXC ETF $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8685Wa:0

    NS:LSE

    21:43.9

    2025-02-12 10:21:44.621000+00:00

    REG - FRK FT EM Mkts $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8684Wa:0

    NS:LSE

    21:42.7

    2025-02-12 10:21:43.366000+00:00

    REG - FRK US Div TILT $ - Net Asset Value(s)

    urn:newsml:newsroom.refinitiv.com:20250212:nRSL8683Wa:0

    NS:LSE

    I also tried to run the same query on News Monitor and I find the LSE items in there too.

    image.png

    I can't put a finger on what's driving this strange behaviour

  • Thank you for looking into the query, Jason. I appreciate you taking the time.

    Unfortunately, I still have LSE results coming through despite the filter, both on the News App and through the API code.

    My query is (I simplified it a little more but still have LSE sources being returned)

    Topic:FUND AND Language:LEN NOT ( Source:DJN OR Source:NBSX OR Source:HIIS OR Source:HOSE OR Source:PHSE OR Source:BSE OR Source:FT OR Source:LSEG OR Source:LSE OR Source:SET OR Source:ASX OR Source:CMNW OR Source:JSE OR Source:IDX OR Source:SGX OR Source:EDG OR Source:NZXR OR Source:CNSWCH)

    Capture.PNG
  • Jirapongse
    Jirapongse ✭✭✭✭✭

    I used the same with the News Monitor app. The ouput is:

    image.png

    Please contact the helpdesk team via MyAccount to verify the query and the News Monitor app.