Old OpenAlex API documentation
  • Overview
  • Quickstart tutorial
  • API Entities
    • Entities overview
    • 📄Works
      • Work object
        • Authorship object
        • Location object
      • Get a single work
      • Get lists of works
      • Filter works
      • Search works
      • Group works
      • Get N-grams
    • 👩Authors
      • Author object
      • Get a single author
      • Get lists of authors
      • Filter authors
      • Search authors
      • Group authors
      • Limitations
      • Author disambiguation
    • 📚Sources
      • Source object
      • Get a single source
      • Get lists of sources
      • Filter sources
      • Search sources
      • Group sources
    • 🏫Institutions
      • Institution object
      • Get a single institution
      • Get lists of institutions
      • Filter institutions
      • Search institutions
      • Group institutions
    • 💡Topics
      • Topic object
      • Get a single topic
      • Get lists of topics
      • Filter topics
      • Search topics
      • Group topics
    • 🗝️Keywords
    • 🏢Publishers
      • Publisher object
      • Get a single publisher
      • Get lists of publishers
      • Filter publishers
      • Search publishers
      • Group publishers
    • 💰Funders
      • Funder object
      • Get a single funder
      • Get lists of funders
      • Filter funders
      • Search funders
      • Group funders
    • 🌎Geo
      • Continents
      • Regions
    • 💡Concepts
      • Concept object
      • Get a single concept
      • Get lists of concepts
      • Filter concepts
      • Search concepts
      • Group concepts
    • Aboutness endpoint (/text)
  • How to use the API
    • API Overview
    • Get single entities
      • Random result
      • Select fields
    • Get lists of entities
      • Paging
      • Filter entity lists
      • Search entities
      • Sort entity lists
      • Select fields
      • Sample entity lists
      • Autocomplete entities
    • Get groups of entities
    • Rate limits and authentication
  • Download all data
    • OpenAlex snapshot
    • Snapshot data format
    • Download to your machine
    • Upload to your database
      • Load to a data warehouse
      • Load to a relational database
        • Postgres schema diagram
  • Additional Help
    • Tutorials
    • Report bugs
    • FAQ
Powered by GitBook
On this page
  • The search parameter
  • Search without stemming
  • Boolean searches
  • Relevance score
  • The search filter
  1. How to use the API
  2. Get lists of entities

Search entities

PreviousFilter entity listsNextSort entity lists

Last updated 10 months ago

The search parameter

The search query parameter finds results that match a given text search. Example:

  • Get works with search term "dna" in the title, abstract, or fulltext:

When you , the API looks for matches in titles, abstracts, and . When you , we look in each concept's display_name and description fields. When you , we look at the display_name, alternate_titles, and abbreviated_title fields. When you , we look at the display_name and display_name_alternatives fields. When you , we look at the display_name, display_name_alternatives, and display_name_acronyms fields.

For most text search we remove and use (specifically, the ) to improve results. So words like "the" and "an" are transparently removed, and a search for "possums" will also return records using the word "possum." With the exception of raw affiliation strings, we do not search within words but rather try to match whole words. So a search with "lun" will not match the word "lunar".

Search without stemming

To disable stemming and the removal of stop words for searches on titles and abstracts, you can add .no_stem to the search filter. So, for example, if you want to search for "surgery" and not get "surgeries" too:

Boolean searches

Including any of the words AND, OR, or NOT in any of your searches will enable boolean search. Those words must be UPPERCASE. You can use this in all searches, including using the search parameter, and using .

This allows you to craft complex queries using those boolean operators along with parentheses and quotation marks. Surrounding a phrase with quotation marks will search for an exact match of that phrase, after stemming and stop-word removal (be sure to use double quotation marks — "). Using parentheses will specify order of operations for the boolean operators. Words that are not separated by one of the boolean operators will be interpreted as AND.

Behind the scenes, the boolean search is using Elasticsearch's on the searchable fields (such as title, abstract, and fulltext for works; see each individual entity page for specifics about that entity). Wildcard and fuzzy searches using *, ? or ~ are not allowed; these characters will be removed from any searches. These searches, even when using quotation marks, will go through the same cleaning as desscribed above, including stemming and removal of stop words.

Relevance score

When you use search, each returned entity in the results lists gets an extra property called relevance_score, and the list is by default sorted in descending order of relevance_score. The relevance_score is based on text similarity to your search term. It also includes a weighting term for citation counts: more highly-cited entities score higher, all else being equal.

If you search for a multiple-word phrase, the algorithm will treat each word separately, and rank results higher when the words appear close together. If you want to return only results where the exact phrase is used, just enclose your phrase within quotes. Example:

The search filter

Search for works that mention "elmo" and "sesame street," but not the words "cookie" or "monster":

Get works with the exact phrase "fierce creatures" in the title or abstract (returns just a few results):

Get works with the words "fierce" and "creatures" in the title or abstract, with works that have the two words close together ranked higher by relevance_score (returns way more results):

You can also use search as a , allowing you to fine-tune the fields you're searching over. To do this, you append .search to the end of the property you are filtering for:

Get authors who have "Einstein" as part of their name:

Get works with "cubist" in the title:

Additionally, the filter default.search is available on all entities; this works the same as the .

You might be tempted to use the search filter to power an autocomplete or typeahead. Instead, we recommend you use the , which is much faster. 👎

👍

https://api.openalex.org/works?search=(elmo AND "sesame street") NOT (cookie OR monster)
https://api.openalex.org/works?search="fierce%20creatures"
https://api.openalex.org/works?search=fierce%20creatures
filter
https://api.openalex.org/authors?filter=display_name.search:einstein
https://api.openalex.org/works?filter=title.search:cubist
autocomplete endpoint
https://api.openalex.org/institutions?filter=display_name.search:florida
https://api.openalex.org/autocomplete/institutions?q=Florida
search parameter
https://api.openalex.org/works?search=dna
search works
search concepts
search sources
search authors
search institutions
stop words
stemming
Kstem token filter
https://api.openalex.org/works?filter=display_name.search.no_stem:surgery
https://api.openalex.org/works?filter=title.search.no_stem:surgery
https://api.openalex.org/works?filter=abstract.search.no_stem:surgery
https://api.openalex.org/works?filter=title_and_abstract.search.no_stem:surgery
query string query
search filters
fulltext