> ## Documentation Index
> Fetch the complete documentation index at: https://developers.openalex.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Recipes

> Common API patterns and use cases

Quick solutions for common OpenAlex tasks.

## Find works by an author <Tooltip headline="Under 1¢" tip="List+Filter calls at $0.10 per 1,000"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

```bash theme={"dark"}
# Get all works by a specific author
https://api.openalex.org/works?filter=author.id:A5023888391&sort=-publication_date

# Get highly cited works by an author
https://api.openalex.org/works?filter=author.id:A5023888391,cited_by_count:>10&sort=-cited_by_count
```

To audit a profile end-to-end — find works that should be attached but aren't, plus works that are wrongly attached and should be removed — see the [Audit an Author Profile's Works recipe](/guides/recipe-audit-author-profile-works).

## Find works from an institution <Tooltip headline="Under 1¢" tip="List+Filter calls at $0.10 per 1,000"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

```bash theme={"dark"}
# Works from Harvard
https://api.openalex.org/works?filter=institutions.id:I136199984&sort=-publication_date

# Open access works from MIT since 2020
https://api.openalex.org/works?filter=institutions.id:I63966007,open_access.is_oa:true,publication_year:>2019
```

## Find works on a topic <Tooltip headline="Under 1¢" tip="List+Filter at $0.10/1,000 · Search at $1/1,000"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

```bash theme={"dark"}
# Works about machine learning
https://api.openalex.org/works?filter=topics.id:T10000&sort=-cited_by_count

# Keyword search for "CRISPR"
https://api.openalex.org/works?search=CRISPR&sort=-relevance_score
```

## Find citations to a work <Tooltip headline="Under 1¢" tip="List+Filter calls at $0.10 per 1,000"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

```bash theme={"dark"}
# Works that cite a specific paper
https://api.openalex.org/works?filter=cites:W2741809807&sort=-publication_date
```

## Find co-authors <Tooltip headline="Under 1¢" tip="List+Filter calls at $0.10 per 1,000"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

```bash theme={"dark"}
# Other authors who published with a specific author
https://api.openalex.org/authors?filter=x_concepts.id:C41008148&sort=-works_count
```

## Find internationally co-authored works <Tooltip headline="Under 1¢" tip="List+Filter calls at $0.10 per 1,000"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

Use `countries_distinct_count` to find works with authors from multiple countries — the standard scientometric definition of international collaboration.

```bash theme={"dark"}
# Indian articles co-authored with at least one non-Indian institution
https://api.openalex.org/works?filter=institutions.country_code:IN,countries_distinct_count:>1,type:article
```

## Get publication trends <Tooltip headline="Under 1¢" tip="List+Filter calls at $0.10 per 1,000"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

```bash theme={"dark"}
# Count works per year (2020-2024)
https://api.openalex.org/works?filter=publication_year:2020-2024&group_by=publication_year

# Count open access works per year
https://api.openalex.org/works?filter=publication_year:2020-2024,open_access.is_oa:true&group_by=publication_year
```

## Find open access works <Tooltip headline="Under 1¢" tip="List+Filter calls at $0.10 per 1,000"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

```bash theme={"dark"}
# All OA works from 2024
https://api.openalex.org/works?filter=publication_year:2024,open_access.is_oa:true

# Gold OA works (published in OA journals)
https://api.openalex.org/works?filter=open_access.oa_status:gold

# Works with CC-BY license
https://api.openalex.org/works?filter=best_oa_location.license:cc-by
```

## Find works with full text <Tooltip headline="Under 1¢" tip="List+Filter calls at $0.10 per 1,000"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

```bash theme={"dark"}
# Works with downloadable PDFs
https://api.openalex.org/works?filter=has_content.pdf:true

# Works with abstracts
https://api.openalex.org/works?filter=has_abstract:true
```

## Get institution rankings <Tooltip headline="Under 1¢" tip="List+Filter calls at $0.10 per 1,000"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

```bash theme={"dark"}
# Top US universities by citation count
https://api.openalex.org/institutions?filter=country_code:US,type:education&sort=-cited_by_count&per_page=20
```

## Get journal metrics <Tooltip headline="Under 1¢" tip="List+Filter calls at $0.10 per 1,000"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

```bash theme={"dark"}
# Top journals by work count
https://api.openalex.org/sources?filter=type:journal&sort=-works_count&per_page=20

# Open access journals
https://api.openalex.org/sources?filter=type:journal,is_oa:true&sort=-works_count
```

## Batch fetch multiple IDs <Tooltip headline="Under 1¢" tip="List+Filter calls at $0.10 per 1,000"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

Use the OR operator (`|`) to fetch up to 100 IDs at once:

```bash theme={"dark"}
# Get multiple works by DOI
https://api.openalex.org/works?filter=doi:https://doi.org/10.1234/a|https://doi.org/10.1234/b|https://doi.org/10.1234/c&per_page=100

# Get multiple authors by ORCID
https://api.openalex.org/authors?filter=orcid:0000-0001-2345-6789|0000-0002-3456-7890&per_page=100
```

## Random sample <Tooltip headline="Under 1¢" tip="List+Filter calls at $0.10 per 1,000"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

```bash theme={"dark"}
# 100 random works from 2024
https://api.openalex.org/works?filter=publication_year:2024&sample=100&per_page=100&seed=42
```

## Combine filters <Tooltip headline="Under 1¢" tip="Search call at $1 per 1,000"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

```bash theme={"dark"}
# Highly cited OA articles about cancer from 2023
https://api.openalex.org/works?search=cancer&filter=publication_year:2023,type:article,open_access.is_oa:true,cited_by_count:>50&sort=-cited_by_count
```

## Python example <Tooltip headline="~$2.12 for this query" tip="211K results ÷ 100 per page = ~2,116 Search-tier calls at $1/1,000"><Icon icon="dollar-sign" size={16} color="#DAA520" /></Tooltip>

```python theme={"dark"}
import requests

def get_works(filter_str, per_page=100):
    """Fetch works with pagination."""
    url = "https://api.openalex.org/works"
    params = {
        "filter": filter_str,
        "per_page": per_page,
        "cursor": "*",
        "api_key": "YOUR_KEY"
    }

    all_works = []
    while True:
        response = requests.get(url, params=params).json()
        all_works.extend(response["results"])

        cursor = response["meta"].get("next_cursor")
        if not cursor:
            break
        params["cursor"] = cursor

    return all_works

# Get all 2024 works about AI
works = get_works("publication_year:2024,fulltext.search:artificial intelligence")
```

## Find funded works <Tooltip headline="Under 1¢" tip="1 Search + 3 List+Filter calls"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

Discover research funded by a specific organization or grant.

```bash theme={"dark"}
# Step 1: Find a funder by name
https://api.openalex.org/funders?search=national+institutes+of+health

# Step 2: Filter works funded by that funder (NIH = F4320306076)
https://api.openalex.org/works?filter=awards.funder_id:F4320306076&sort=-publication_date

# Step 3: Narrow to works acknowledging a specific grant number
https://api.openalex.org/works?filter=awards.funder_id:F4320306076,awards.funder_award_id:R01-GM123456

# Step 4: Combine with other filters — e.g., funded OA works from 2024
https://api.openalex.org/works?filter=awards.funder_id:F4320306076,publication_year:2024,open_access.is_oa:true&sort=-cited_by_count
```

## Explore publisher hierarchy <Tooltip headline="Under 1¢" tip="1 Search + 1 Get (free) + 2 List+Filter calls"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

Navigate the parent-subsidiary structure of publishers.

```bash theme={"dark"}
# Step 1: Search for a publisher by name
https://api.openalex.org/publishers?search=elsevier

# Step 2: Get the publisher and check hierarchy_level and lineage
# (hierarchy_level 0 = top-level parent, 1+ = subsidiary)
https://api.openalex.org/publishers/P4310319965

# Step 3: List all subsidiaries of a parent publisher
https://api.openalex.org/publishers?filter=parent_publisher:P4310319965&sort=-works_count

# Step 4: Get only top-level publishers, sorted by output
https://api.openalex.org/publishers?filter=hierarchy_level:0&sort=-works_count&per_page=20
```

## Explore citation links <Tooltip headline="Under 1¢" tip="1 Get (free) + 3 List+Filter calls"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

Trace the citation network around a single work using its `referenced_works`, `cited_by_api_url`, and `related_works` fields.

```bash theme={"dark"}
# Step 1: Get a work and inspect its citation fields
https://api.openalex.org/works/W2741809807
# Response includes:
#   "referenced_works": ["https://openalex.org/W...", ...]   ← outgoing citations
#   "cited_by_api_url": "https://api.openalex.org/works?filter=cites:W2741809807"
#   "related_works": ["https://openalex.org/W...", ...]      ← semantically similar

# Step 2: Follow outgoing citations (referenced_works)
# Batch-fetch the works this paper cites using the OR operator
https://api.openalex.org/works?filter=openalex:W2100837269|W2134720587&per_page=100

# Step 3: Follow incoming citations (cited_by_api_url)
# Use the cites filter to find all works that cite this one
https://api.openalex.org/works?filter=cites:W2741809807&sort=-publication_date

# Step 4: Explore related works
# Fetch semantically similar works returned in the related_works field
https://api.openalex.org/works?filter=openalex:W2052533833|W1982351946&per_page=100
```

## Build a text corpus <Tooltip headline="$0.01 per file" tip="1 Search call + content downloads at $0.01/file"><Icon icon="coins" size={16} color="#DAA520" /></Tooltip>

Assemble a collection of full-text PDFs for analysis or AI synthesis.

<Warning>
  Content downloads require an API key and cost **\$0.01 per file**. See [authentication](/guides/authentication) for details.
</Warning>

```bash theme={"dark"}
# Step 1: Find works with downloadable PDFs using the has_content filter
https://api.openalex.org/works?search=CRISPR&filter=has_content.pdf:true,publication_year:2023-2024

# Step 2: Download a single PDF
curl -L "https://content.openalex.org/works/W3038568908.pdf?api_key=YOUR_KEY" -o W3038568908.pdf

# Step 3: For bulk downloads, use the CLI tool
pip install openalex-official

openalex download \
  --api-key YOUR_KEY \
  --output ./results \
  --filter "fulltext.search:CRISPR,has_content.pdf:true,publication_year:2023-2024"
```

Download programmatically in Python:

```python theme={"dark"}
import requests

# List of work IDs from Step 1
work_ids = ["W4388482763", "W4386073691", ...]

for work_id in work_ids:
    r = requests.get(
        f"https://content.openalex.org/works/{work_id}.pdf",
        params={"api_key": "YOUR_KEY"},
        allow_redirects=True
    )

    with open(f"{work_id}.pdf", "wb") as f:
        f.write(r.content)
```

<Info>
  **Downloading more than a few thousand files?** Use the [CLI tool](/download/full-text-pdfs#option-2-command-line-tool-up-to-a-few-million-files) for parallel downloads and automatic retries.
</Info>
