# OpenAlex Scholarly Works Scraper (`datamule/openalex-scholarly-works-scraper`) Actor

Scrape scholarly works (papers, preprints, books), authors, institutions & journals from the free public OpenAlex API. Search + filter by author, institution, concept, year, type & open-access; sort; auto-paginate. Clean columns + raw. Pay per record.

- **URL**: https://apify.com/datamule/openalex-scholarly-works-scraper.md
- **Developed by:** [Datamule](https://apify.com/datamule) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 1,000 records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## OpenAlex Scholarly Works Scraper

Turn the free, fully-open **[OpenAlex](https://openalex.org)** catalogue into clean, paginated
dataset rows. OpenAlex is the open index of the world's scholarly research (~250M+ works,
authors, institutions and journals) that filled the gap left by Microsoft Academic Graph's
shutdown. This actor queries its **official public REST API** (`https://api.openalex.org`,
no account, no API key) and returns one tidy record per result plus the complete raw object.

Great for **literature reviews, bibliometrics, research-trend analysis, competitive
intelligence, and building scholarly datasets**.

### What it scrapes

- **Works** — papers, preprints, books, book chapters, datasets, dissertations, reviews…
  Each record has: OpenAlex id, DOI, title, publication year & date, type, language, author
  names + ids, affiliated institutions + countries, host venue (journal/repository), citation
  count, open-access status + URL, concepts/topics, referenced-works count, a reconstructed
  plain-text abstract, and a link to the OpenAlex page — plus the lossless `raw` work object.
- **Authors / Institutions / Sources** — set **What to scrape** to one of these to resolve an
  entity (name, ids, ORCID/ROR/ISSN, works & citation counts, h-index) — handy for finding the
  id to plug back into a Works query.

### How to query

- **Search term** — free text across titles/abstracts/full text (Works) or names (others).
- **Structured Works filters** — author id, institution id, concept id, source id, work type,
  year range or exact year, open-access-only. All combined server-side (AND).
- **Advanced raw filter** — any [OpenAlex filter](https://docs.openalex.org/api-entities/works/filter-works)
  expression, e.g. `cited_by_count:>100,has_doi:true`, AND-ed onto the above.
- **Sort** — e.g. `cited_by_count:desc`, `publication_date:desc`.
- **Max results** — the actor auto-paginates via OpenAlex's cursor (200/request), so this can
  be large.

#### Example input

```json
{
  "entityType": "works",
  "search": "machine learning",
  "fromYear": 2022,
  "openAccessOnly": true,
  "sort": "cited_by_count:desc",
  "maxResults": 500
}
````

Find a specific author's papers:

```json
{ "entityType": "works", "authorId": "A5105141183", "sort": "publication_date:desc" }
```

Look up an institution id:

```json
{ "entityType": "institutions", "search": "Harvard University" }
```

### Output

One dataset item per result. A no-match query returns 0 items (not an error). Every optional
column is nullable, so records from different entity types share one schema; use the `raw`
field for anything the normalized columns don't expose.

### Pricing

**Pay per result** — you're charged one event per record returned. A query that matches
nothing costs nothing.

### Notes

- Uses OpenAlex's **polite pool** via a contact email in the request; set **Contact email** to
  your address for the best service. No key required either way.
- Data © the OpenAlex project, released under **CC0**. Please cite OpenAlex where appropriate.
- Not affiliated with or endorsed by OpenAlex.

# Actor input Schema

## `entityType` (type: `string`):

Which OpenAlex entity to query. Works = scholarly outputs (papers, preprints, books, datasets…) with full author/venue/citation metadata (the primary use case). Authors / Institutions / Sources return those entities (name, ids, works & citation counts) — useful for resolving an author/institution/journal id to feed back into a works query.

## `search` (type: `string`):

Free-text search. For Works this matches the title, abstract and full text; for Authors/Institutions/Sources it matches their names. e.g. "machine learning", "CRISPR gene editing", "Harvard University". Leave empty to browse by filter/sort only.

## `workType` (type: `string`):

Restrict Works to a single OpenAlex type, e.g. article, preprint, book, book-chapter, dataset, dissertation, review, report. Leave empty for all types. Ignored for non-Works entities.

## `fromYear` (type: `integer`):

Only Works published on/after this year (inclusive). Combine with "To year" for a range. Ignored if "Exact publication year" is set, or for non-Works entities.

## `toYear` (type: `integer`):

Only Works published on/before this year (inclusive). Ignored if "Exact publication year" is set, or for non-Works entities.

## `publicationYear` (type: `integer`):

Only Works published in exactly this year. Overrides the From/To year range when set. Ignored for non-Works entities.

## `openAccessOnly` (type: `boolean`):

When on, return only open-access Works (is\_oa:true). Ignored for non-Works entities.

## `authorId` (type: `string`):

Restrict Works to those by a given author. Accepts an OpenAlex author id (e.g. A5105141183 or the full https://openalex.org/A5105141183 URL). Tip: run this actor with "Authors" first to find the id. Ignored for non-Works entities.

## `institutionId` (type: `string`):

Restrict Works to those affiliated with a given institution (e.g. I136199984 for Harvard). Ignored for non-Works entities.

## `conceptId` (type: `string`):

Restrict Works tagged with a given concept/topic (e.g. C519991488). Ignored for non-Works entities.

## `sourceId` (type: `string`):

Restrict Works published in a given source — a journal or repository (e.g. S4306400194 for arXiv). Ignored for non-Works entities.

## `filter` (type: `string`):

Optional raw OpenAlex filter string, AND-ed onto the structured filters above. Use OpenAlex's own filter grammar for anything not exposed as a field, e.g. "cited\_by\_count:>100,has\_doi:true" or "authorships.countries:US". See https://docs.openalex.org/api-entities/works/filter-works. For non-Works entities this is the only structured filter input.

## `sort` (type: `string`):

How to order results, as "field:direction", e.g. "cited\_by\_count:desc" (most-cited first), "publication\_date:desc" (newest first), "works\_count:desc" (for authors/institutions). Leave empty for the default relevance order (or a plain listing when there's no search term).

## `maxResults` (type: `integer`):

Maximum number of records to return. The actor paginates automatically via OpenAlex's cursor (200 per request), so this can be large. Each returned record is one billable item.

## `mailto` (type: `string`):

Optional email address added to requests per OpenAlex's polite-pool convention for faster, more reliable service. No account or key is required. If omitted a neutral default is used.

## Actor input object example

```json
{
  "entityType": "works",
  "search": "machine learning",
  "openAccessOnly": false,
  "sort": "cited_by_count:desc",
  "maxResults": 200
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "search": "machine learning",
    "sort": "cited_by_count:desc",
    "maxResults": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("datamule/openalex-scholarly-works-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "search": "machine learning",
    "sort": "cited_by_count:desc",
    "maxResults": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("datamule/openalex-scholarly-works-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "search": "machine learning",
  "sort": "cited_by_count:desc",
  "maxResults": 200
}' |
apify call datamule/openalex-scholarly-works-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=datamule/openalex-scholarly-works-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "OpenAlex Scholarly Works Scraper",
        "description": "Scrape scholarly works (papers, preprints, books), authors, institutions & journals from the free public OpenAlex API. Search + filter by author, institution, concept, year, type & open-access; sort; auto-paginate. Clean columns + raw. Pay per record.",
        "version": "0.1",
        "x-build-id": "KrJjSZwHFU4lCl7rf"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datamule~openalex-scholarly-works-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datamule-openalex-scholarly-works-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/datamule~openalex-scholarly-works-scraper/runs": {
            "post": {
                "operationId": "runs-sync-datamule-openalex-scholarly-works-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/datamule~openalex-scholarly-works-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-datamule-openalex-scholarly-works-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "entityType": {
                        "title": "What to scrape",
                        "enum": [
                            "works",
                            "authors",
                            "institutions",
                            "sources"
                        ],
                        "type": "string",
                        "description": "Which OpenAlex entity to query. Works = scholarly outputs (papers, preprints, books, datasets…) with full author/venue/citation metadata (the primary use case). Authors / Institutions / Sources return those entities (name, ids, works & citation counts) — useful for resolving an author/institution/journal id to feed back into a works query.",
                        "default": "works"
                    },
                    "search": {
                        "title": "Search term",
                        "type": "string",
                        "description": "Free-text search. For Works this matches the title, abstract and full text; for Authors/Institutions/Sources it matches their names. e.g. \"machine learning\", \"CRISPR gene editing\", \"Harvard University\". Leave empty to browse by filter/sort only."
                    },
                    "workType": {
                        "title": "Work type (Works only)",
                        "type": "string",
                        "description": "Restrict Works to a single OpenAlex type, e.g. article, preprint, book, book-chapter, dataset, dissertation, review, report. Leave empty for all types. Ignored for non-Works entities."
                    },
                    "fromYear": {
                        "title": "From year (Works only)",
                        "minimum": 1000,
                        "type": "integer",
                        "description": "Only Works published on/after this year (inclusive). Combine with \"To year\" for a range. Ignored if \"Exact publication year\" is set, or for non-Works entities."
                    },
                    "toYear": {
                        "title": "To year (Works only)",
                        "minimum": 1000,
                        "type": "integer",
                        "description": "Only Works published on/before this year (inclusive). Ignored if \"Exact publication year\" is set, or for non-Works entities."
                    },
                    "publicationYear": {
                        "title": "Exact publication year (Works only)",
                        "minimum": 1000,
                        "type": "integer",
                        "description": "Only Works published in exactly this year. Overrides the From/To year range when set. Ignored for non-Works entities."
                    },
                    "openAccessOnly": {
                        "title": "Open-access only (Works only)",
                        "type": "boolean",
                        "description": "When on, return only open-access Works (is_oa:true). Ignored for non-Works entities.",
                        "default": false
                    },
                    "authorId": {
                        "title": "Author OpenAlex ID (Works only)",
                        "type": "string",
                        "description": "Restrict Works to those by a given author. Accepts an OpenAlex author id (e.g. A5105141183 or the full https://openalex.org/A5105141183 URL). Tip: run this actor with \"Authors\" first to find the id. Ignored for non-Works entities."
                    },
                    "institutionId": {
                        "title": "Institution OpenAlex ID (Works only)",
                        "type": "string",
                        "description": "Restrict Works to those affiliated with a given institution (e.g. I136199984 for Harvard). Ignored for non-Works entities."
                    },
                    "conceptId": {
                        "title": "Concept OpenAlex ID (Works only)",
                        "type": "string",
                        "description": "Restrict Works tagged with a given concept/topic (e.g. C519991488). Ignored for non-Works entities."
                    },
                    "sourceId": {
                        "title": "Source OpenAlex ID (Works only)",
                        "type": "string",
                        "description": "Restrict Works published in a given source — a journal or repository (e.g. S4306400194 for arXiv). Ignored for non-Works entities."
                    },
                    "filter": {
                        "title": "Advanced raw filter",
                        "type": "string",
                        "description": "Optional raw OpenAlex filter string, AND-ed onto the structured filters above. Use OpenAlex's own filter grammar for anything not exposed as a field, e.g. \"cited_by_count:>100,has_doi:true\" or \"authorships.countries:US\". See https://docs.openalex.org/api-entities/works/filter-works. For non-Works entities this is the only structured filter input."
                    },
                    "sort": {
                        "title": "Sort",
                        "type": "string",
                        "description": "How to order results, as \"field:direction\", e.g. \"cited_by_count:desc\" (most-cited first), \"publication_date:desc\" (newest first), \"works_count:desc\" (for authors/institutions). Leave empty for the default relevance order (or a plain listing when there's no search term)."
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of records to return. The actor paginates automatically via OpenAlex's cursor (200 per request), so this can be large. Each returned record is one billable item.",
                        "default": 200
                    },
                    "mailto": {
                        "title": "Contact email (polite pool)",
                        "type": "string",
                        "description": "Optional email address added to requests per OpenAlex's polite-pool convention for faster, more reliable service. No account or key is required. If omitted a neutral default is used."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
