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 kiriger · Jul 10, 2019 at 12:15 PM · eikon data apieikon python apisearchfuzzy matching

[Python API] How to fuzzy search for companies by name ?

Hi, thanks for taking a look. See subj.

Ideally, search would retrieve top N entries.

Even better, it would let me constrain the search scope to companies that are registered in a given country (precise match by code), operate in a given industry sector (either precise match by a symbology or a fuzzy one given keywords or a precise match against a list of options ("contains")) and / or have turnover (or other financials) in a given range -- and still return top N of those satisfying the constraints.

How can that be achieved using the Python API ?

Thanks in advance!

People who like this

0 Show 0
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.

2 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Alex Putkov. · Jul 10, 2019 at 04:56 PM

Fuzzy search is not available in Eikon. You can however combine exact string match name search with other criteria in Eikon Screener. Here's an example returning public companies containing the word "resources" in the company name, headquartered in the US and falling under Financials sector according to Thomson Reuters Business Classification scheme (TRBC).

name = '"resources"'
exp = ('SCREEN(U(IN(Equity(active,public,primary))),' + 
       ' Contains(TR.CommonName,%s),' %name +
       'IN(TR.HQCountryCode,"US"),' +
       'IN(TR.TRBCEconSectorCode,"55"))')
fields = ['TR.CompanyName']
ek.get_data(exp, fields)
To construct Screener expression follow the wizard behind Screener button under Thomson Reuters tab in Excel ribbon. You may also want to watch a series of short video tutorials titled "Working with the Screener" available from the main Eikon menu - Help - Tutorials and Training. Type in "Screener" in the search bar a click on "Working with the Screener" in the results.
Comment
kiriger

People who like this

1 Show 2 · 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.

avatar image
kiriger · Jul 11, 2019 at 08:56 AM 0
Share

Thanks, Alex. Are there boolean operators that can be used in conjunction with Contains?

Imagine there is a complex names with multiple words which may be in different forms including abbreviations. One way to search for such an entry would be to split it into words or ngrams, potentially, at character level, and use AND and OR to build up query expression.

For example:

OR(
  AND(
Contains(..., "that-co"),
Contains(..., "inc")
),
AND(
Contains(..., "that"),
Contains(..., "company"),
Contains("incorporated")
)
)
avatar image
REFINITIV
Alex Putkov. ♦♦ kiriger · Jul 11, 2019 at 10:42 AM 0
Share

Follow the Screener wizard launched through Screener button in Excel ribbon to learn what is and isn't possible through the Screener. Once you set up your criteria in the Screener wizard click Insert Screen button to paste the formula into Excel worksheet. The screener expression in the first argument of the resulting =TR worksheet function can be copied & pasted into Python script with minor modifications related to syntactical differences in string manipulations between Excel formulas and Python.
It is possible to use logical expressions with multiple keywords and Contains statement and TR.CommonName field:

exp = ('SCREEN(U(IN(Equity(active,public,primary))),' + 
       ' (Contains(TR.CommonName,"resources") OR' +
       ' Contains(TR.CommonName,"energy") AND' +
       ' Contains(TR.CommonName,"Corp")),'
       ' IN(TR.HQCountryCode,"US"))')
fields = ['TR.CompanyName']
ek.get_data(exp, fields)
avatar image
Answer by kiriger · Jul 10, 2019 at 12:16 PM

This question is similar, but the answers do not cover fuzzy matching and constraints:

https://community.developers.refinitiv.com/questions/37096/screening-using-name-contains.html?redirectedFrom=37019

Comment

People who like this

0 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

Get a list of all futures with first trading date trading on an country exchange code in eikon api python

Why is get_timeseries using Eikon API not pulling the full price history?

How to get only recent few days data?

When will bond search with Python be available in Eikon DAPI?

Number or RICs returned from screener seems too high

  • 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