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
  • Logical expressions
  • Inequality
  • Negation (NOT)
  • Intersection (AND)
  • Addition (OR)
  • Available Filters
  1. How to use the API
  2. Get lists of entities

Filter entity lists

PreviousPagingNextSearch entities

Last updated 1 year ago

Filters narrow the list down to just entities that meet a particular condition--specifically, a particular value for a particular attribute.

A list of filters are set using the filter parameter, formatted like this: filter=attribute:value,attribute2:value2. Examples:

  • Get the works whose is book:

  • Get the authors whose name is Einstein:

Filters are case-insensitive.

Logical expressions

Inequality

For numerical filters, use the less-than (<) and greater-than (>) symbols to filter by inequalities. Example:

  • Get sources that host more than 1000 works:

Some attributes have special filters that act as syntactic sugar around commonly-expressed inequalities: for example, the from_publication_date filter on works. See the endpoint-specific documentation below for more information. Example:

  • Get all works published between 2022-01-01 and 2022-01-26 (inclusive):

Negation (NOT)

You can negate any filter, numerical or otherwise, by prepending the exclamation mark symbol (!) to the filter value. Example:

  • Get all institutions except for ones located in the US:

Intersection (AND)

By default, the returned result set includes only records that satisfy all the supplied filters. In other words, filters are combined as an AND query. Example:

To create an AND query within a single attribute, you can either repeat a filter, or use the plus symbol (+):

  • Get all the works that have an author from France and an author from the UK:

Note that the plus symbol (+) syntax will not work for search filters, boolean filters, or numeric filters.

Addition (OR)

Use the pipe symbol (|) to input lists of values such that any of the values can be satisfied--in other words, when you separate filter values with a pipe, they'll be combined as an OR query. Example:

This is particularly useful when you want to retrieve a many records by ID all at once. Instead of making a whole bunch of singleton calls in a loop, you can make one call, like this:

You can use OR for values within a given filter, but not between different filters. So this, for example, doesn't work and will return an error:

Available Filters

The filters for each entity can be found here:

Get all works that have been cited more than once and are free to read:

Using repeating filters:

Using the plus symbol (+):

Get all the works that have an author from France or an author from the UK:

Get the works with DOI 10.1371/journal.pone.0266781 or with DOI 10.1371/journal.pone.0267149 (note the pipe separator between the two DOIs):

You can combine up to 100 values for a given filter in this way. You will also need to use the parameter per-page=100 to get all of the results per query. See our for a tutorial.

Get either French works or ones published in the journal with ISSN 0957-1558:

https://api.openalex.org/works?filter=cited_by_count:>1,is_oa:true
https://api.openalex.org/works?filter=institutions.country_code:fr,institutions.country_code:gb
https://api.openalex.org/works?filter=institutions.country_code:fr+gb
https://api.openalex.org/works?filter=institutions.country_code:fr|gb
https://api.openalex.org/works?filter=doi:https://doi.org/10.1371/journal.pone.0266781|https://doi.org/10.1371/journal.pone.0267149
blog post
https://api.openalex.org/works?filter=institutions.country_code:fr|primary_location.source.issn:0957-1558
Works
Authors
Sources
Institutions
Concepts
Publishers
Funders
https://api.openalex.org/works?filter=type:book
https://api.openalex.org/authors?filter=display_name.search:einstein
https://api.openalex.org/sources?filter=works_count:>1000
https://api.openalex.org/works?filter=from_publication_date:2022-01-01,to_publication_date:2022-01-26
https://api.openalex.org/institutions?filter=country_code:!us
type