Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /
avatar image
Question by yuyang.1958 · Nov 12, 2018 at 08:51 PM · news

How to search headlines with multiple keywords? Why is such an input wrong?

ujezklier96rbqc1nl1g6.png (5.3 KiB)

People who like this

0 Show 1
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Christiaan Meihsl ♦♦ · Nov 13, 2018 at 03:24 AM 0
Share

This query is a duplicate of the one in this comment.

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Alex Putkov. · Nov 13, 2018 at 11:31 AM

@yuyang
You typically don't need to use quotes around keywords. Try

ek.get_news_headlines("Product:IFRFM AND Topic:ISU AND Topic:EUB AND (PRICED OR DEAL)")
The above expression is syntactically correct, but returns an empty dataframe because the news search expression is too narrow and no headlines match it. Try instead for example:
ek.get_news_headlines("Topic:ISU AND Topic:EUB AND (PRICED OR DEAL)")
The reason your original news search expression results in an error is that Python library passes the news search expression string to a JSON object, which is then submitted in HTTP request to the Web service that delivers news headlines. This means that in order to escape a character you first need to escape it for Python and then for JSON. One way to do this is to use triple backslash:
"Topic:ISU AND Topic:EUB AND (\\\"PRICED\\\" OR \\\"DEAL\\\")"
Another is to use Python raw string:
r"Topic:ISU AND Topic:EUB AND (\"PRICED\" OR \"DEAL\")"

But as I said at the beginning the easiest is to not include keywords in quotes at all.

Comment
jirapongse.phuriphanvichai

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
10 People are following this question.

Related Questions

Looking to get subjects and sentiment for a news article using Eikon python api

Is there any way to get the news headlines except for Python API?

Does News Monitor include all news?

Eikon python API: Formulating search queries to order news by popularity or filter by the media company

Central Bank Events with Eikon Data API

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges