papers-openalex
Async Rust client for the OpenAlex REST API.
OpenAlex is a free, open catalog of scholarly research: 240M+ works, 110M+ authors, and metadata across sources, institutions, topics, publishers, and funders.
The papers crate wraps papers-openalex with slimmed list responses, filter aliases, and a simpler function-based API.
Quick start
use ;
async
Authentication
Set the OPENALEX_KEY environment variable, or pass the key explicitly. Optional for most endpoints; recommended for higher rate limits.
use OpenAlexClient;
let client = new; // reads OPENALEX_KEY from env
let client = with_api_key; // explicit key
The /find/works semantic search endpoint requires an API key (1,000 credits per request).
Examples
Filtering and sorting
let params = builder
.search
.filter
.sort
.per_page
.build;
let response = client.list_works.await?;
Single entity by ID
Accepts OpenAlex IDs, DOIs, ORCIDs, ROR IDs, ISSNs, PMIDs, and other formats depending on entity type.
let work = client.get_work.await?;
let work = client.get_work.await?;
// Select specific fields
let params = builder.select.build;
let work = client.get_work.await?;
Cursor pagination
Offset pagination caps at 10,000 results. Use cursor pagination for deeper access:
let mut cursor = Some;
while let Some = cursor
Autocomplete
Returns up to 10 results sorted by citation count (~200ms):
let response = client.autocomplete_authors.await?;
Group-by aggregation
let params = builder
.filter
.group_by
.build;
let response = client.list_works.await?;
for group in &response.group_by
Semantic search
Requires an API key.
let client = with_api_key;
let params = builder
.query
.count
.build;
let response = client.find_works.await?;
API coverage
| Entity | Struct | List | Get | Autocomplete |
|---|---|---|---|---|
| Works | Work |
list_works |
get_work |
autocomplete_works |
| Authors | Author |
list_authors |
get_author |
autocomplete_authors |
| Sources | Source |
list_sources |
get_source |
autocomplete_sources |
| Institutions | Institution |
list_institutions |
get_institution |
autocomplete_institutions |
| Topics | Topic |
list_topics |
get_topic |
-- |
| Publishers | Publisher |
list_publishers |
get_publisher |
autocomplete_publishers |
| Funders | Funder |
list_funders |
get_funder |
autocomplete_funders |
-
Works — scholarly outputs: journal articles, preprints, books, datasets, and other research products. 240M+ records. Each work carries authorship, venue, open-access status, citation count, topics, abstract (reconstructed from OpenAlex's inverted index), and links to referenced and related works. Identifiable by OpenAlex ID, DOI, PMID, or PMCID.
-
Authors — disambiguated researcher profiles. 110M+ records. Each author aggregates works across name variants and institutions, with an h-index, ORCID link, affiliation history, and top research topics. Identifiable by OpenAlex ID or ORCID.
-
Sources — publishing venues: journals, conference proceedings, repositories, ebook platforms, and book series. Includes ISSN, open-access status, DOAJ membership, APC pricing, and host organization. Identifiable by OpenAlex ID or any ISSN.
-
Institutions — research organizations: universities, hospitals, companies, government agencies, and other bodies. Linked to ROR identifiers. Includes geographic location, institution type, parent/child relationships, and research output metrics. Identifiable by OpenAlex ID or ROR.
-
Topics — a 4-level content hierarchy (domain → field → subfield → topic) covering ~4,500 topics. Each topic has an AI-generated description, keywords, and counts of works assigned to it. Works are assigned up to 3 topics with relevance scores. Identifiable by OpenAlex ID only.
-
Publishers — publishing organizations (e.g. Elsevier, Springer Nature, Wiley). Structured as a hierarchy: top-level publishers with subsidiary imprints at lower levels. Includes country of origin and citation metrics across all sources they publish. Identifiable by OpenAlex ID only.
-
Funders — grant-making organizations (e.g. NIH, NSF, ERC, Wellcome Trust). Linked to the Crossref funder registry. Includes grant counts, funded works count, country, and a Wikidata description. Identifiable by OpenAlex ID only.
Plus find_works / find_works_post for AI semantic search (requires API key, costs 1,000 credits per call).
Parameters
| Struct | Used by | Fields |
|---|---|---|
ListParams |
7 list endpoints | filter, search, sort, per_page, page, cursor, sample, seed, select, group_by |
GetParams |
7 get endpoints | select |
FindWorksParams |
Semantic search | query (required), count, filter |
Responses
| Struct | Returned by | Contents |
|---|---|---|
ListResponse<T> |
List endpoints | meta, results: Vec<T>, group_by |
AutocompleteResponse |
Autocomplete endpoints | meta, results (up to 10 matches) |
FindWorksResponse |
Semantic search | results (ranked by score 0.0--1.0) |
Testing