# Crossref Works & DOI Metadata (`grit-77/crossref-works`) Actor

Crossref works and DOI metadata scraper for bibliographic enrichment. Export publication metadata as JSON; search modes also provide journal and funder records.

- **URL**: https://apify.com/grit-77/crossref-works.md
- **Developed by:** [Grit](https://apify.com/grit-77) (community)
- **Categories:** Education, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 works

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Crossref Works & DOI Metadata

Crossref works scraper returns publication and DOI metadata from Crossref. Crossref API searches can also return journal and funder records with source links.

**Build status:** Unpublished draft. Python tests, the local actor run and the required CLI schema command are blocked by this session's process-access error. Read [REPORT.md](REPORT.md) before publishing.

### What it returns

The default dataset uses one row per successful metadata record or input/source error. recordType distinguishes works, journals and funders. Missing counts remain null.

| Field | Type | Example value |
|---|---|---|
| `recordType` | string | `"work"` |
| `status` | string | `"ok"` |
| `doi` | string | `"10.1038/nphys1170"` |
| `title` | string | `"Measured measurement"` |
| `url` | nullable / see code | `null` |
| `sourceUrl` | nullable / see code | `null` |
| `fetchedAt` | nullable / see code | `null` |
| `errors` | nullable / see code | `null` |
| `workType` | nullable / see code | `null` |
| `publisher` | nullable / see code | `null` |
| `containerTitle` | nullable / see code | `null` |
| `publishedDate` | nullable / see code | `null` |
| `citationCount` | integer | `11` |
| `referenceCount` | integer | `10` |
| `issn` | nullable / see code | `null` |
| `isbn` | nullable / see code | `null` |
| `language` | nullable / see code | `null` |
| `authors` | nullable / see code | `null` |
| `licenses` | nullable / see code | `null` |
| `funders` | nullable / see code | `null` |
| `abstract` | nullable / see code | `null` |
| `references` | nullable / see code | `null` |
| `totalDois` | nullable / see code | `null` |
| `currentDois` | nullable / see code | `null` |
| `backfileDois` | nullable / see code | `null` |
| `subjects` | nullable / see code | `null` |
| `funderId` | nullable / see code | `null` |
| `location` | nullable / see code | `null` |
| `alternateNames` | nullable / see code | `null` |
| `input` | nullable / see code | `null` |
| `httpStatus` | nullable / see code | `null` |

Licence metadata can describe text/data mining rights. A listed licence URL does not itself establish that an article is open access.

### Input example

```json
{
  "mode": "doi",
  "dois": [
    "10.1038/nphys1170"
  ],
  "maxItems": 1
}
```

Use the input schema for the remaining filters and defaults.

### Output example and provenance

An actual actor-output sample is pending the local run. [tests/fixtures/work.json](tests/fixtures/work.json) is a saved real Crossref response, with this exact excerpt from its message:

```json
{
  "DOI": "10.1038/nphys1170",
  "title": ["Measured measurement"],
  "is-referenced-by-count": 11,
  "reference-count": 10
}
```

The mapping uses doi, title, citationCount and referenceCount for these fields. The local acceptance script writes sample_output.json from the actual default dataset after it can run.

### Proposed pricing

Custom work event: **$0.0005 per successful metadata row**, or **$0.50 per 1,000**.
The same event covers successful work/DOI, journal and funder results. Error rows are uncharged. Duplicate DOI inputs are removed before retrieval.
No actor-start event or reference/licence surcharge is proposed.

The [most-used Crossref comparator in the returned API cohort by observed total users](https://apify.com/ryanclinton/crossref-paper-search) charged $0.002 per paper on the 2026-10-05 Store API observation. See [PRICING.md](PRICING.md) and its timestamped receipt.
The owner must configure monetization before publishing. Platform resource costs depend on Console settings.

### Limits

- maxItems defaults to 100 and accepts 1–10,000. The cap includes error rows and applies to rows emitted by this invocation.
- concurrency controls 1–3 DOI tasks. HTTP requests remain serial in both pools; rate-limit headers can increase pacing.
- pageSize accepts 1–1,000. Works use cursor pagination; journals and funders use offsets.
- maxRetries accepts 0–5; its default is 3. Timeouts, 429 and selected 5xx responses use backoff. Retry-After waits longer than 120 seconds produce an error row.
- Crossref search can change during pagination. Source failures leave explicit partial-result errors when there is room within maxItems.
- Only Crossref-registered DOI metadata is supported. DOI resolution does not fetch full text or other registration agencies.
- Counts, references, abstracts and licences reflect publisher deposits; completeness varies.
- Dataset writes and manual event charges are separate operations. A storage failure or interrupted run can leave a charge without a saved row. Automatic migration/restart deduplication is not implemented.
- The source is the public official API, without login or paid Crossref Plus access.

### FAQ

**What limits the output?** The maxItems input caps output rows; its schema maximum is 10,000. Source availability and errors may yield fewer rows.

**Does it need a proxy, login, or API key?** The actor calls public Crossref endpoints without an API key. The optional mailto input identifies the client.

**How is it priced?** PRICING.md proposes $0.0005 per successful metadata row and no custom charge for error rows. The proposal is not published.

**What happens on rate limits?** The client learns Crossref rate-limit headers and waits between requests; it retries throttling and transient failures.

**How fresh is the data?** Metadata reflects Crossref at retrieval; fetchedAt is retrieval time, while publication dates come from deposited metadata.

**Does a licence field grant reuse rights?** Read the deposited licence URL and its terms; the actor only supplies metadata.

### Use with AI agents / MCP

An AI agent can call a published actor through the Apify MCP server or Apify API, pass the JSON input, then read the run’s default dataset. Check the actor’s published identifier and permissions in your Apify account.

After publication, an AI agent can invoke the actor through Apify's API or [Apify MCP server](https://docs.apify.com/platform/integrations/mcp).
Give the agent an operation, a query or DOI list, maxItems and a run budget. Retain sourceUrl and fetchedAt in any cited answer.
A compact request is {"mode":"doi","dois":\["10.1038/nphys1170"],"maxItems":1}.
MCP connects an agent to external tools; here it would call this actor. The package does not include a separate MCP server.

### Local development and verification

Use the existing project Python. Runtime dependencies are Apify and httpx, already present in the designated environment.
These required acceptance commands have not yet run successfully in this session:

```powershell
& C:/GritWork/earn/.venv/Scripts/python.exe -m pytest tests -m "not live" -q
& C:/GritWork/earn/.venv/Scripts/python.exe -m pytest tests -m live -q
apify validate-schema
& C:/GritWork/earn/.venv/Scripts/python.exe tests/verify_behavior.py
```

For a manual local run, storage/key_value_stores/default/INPUT.json already contains the sample input:

```powershell
$env:APIFY_LOCAL_STORAGE_DIR = "$PWD/storage"
$env:ACTOR_TEST_PAY_PER_EVENT = "true"
& C:/GritWork/earn/.venv/Scripts/python.exe -m src
```

The behavior verifier varies inputs, inspects saved results and simulated charges, and writes real sample_output.json plus evidence/behavior-proof.json. Its local simulated prices do not represent actual Store charges.

# Actor input Schema

## `mode` (type: `string`):

Choose the record type. Works can be scoped by journal ISSN or funder ID.

## `query` (type: `string`):

Keywords for works, journals or funders. Required for journal/funder search. For works, provide a query, filter, ISSN or funder ID.

## `dois` (type: `array`):

Used in DOI mode. Bare DOI, doi: prefix and doi.org URLs are accepted. Duplicate DOI values are removed; invalid entries become uncharged error rows.

## `issn` (type: `string`):

Optional works scope, for example 0028-0836. Cannot be combined with funderId.

## `funderId` (type: `string`):

Optional works scope: numeric Crossref funder ID, 10.13039/ DOI or its doi.org URL. Cannot be combined with issn.

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

Works mode only. Comma-separated official filters, for example from-pub-date:2024-01-01,type:journal-article,has-license:true. Unsupported filters produce a source error row.

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

Sorting for works search. Relevance requires a search query. Not applied in other modes.

## `order` (type: `string`):

Ordering for works search. Not applied in other modes.

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

Optional real contact email that you monitor. Sent to Crossref in the mailto parameter and User-Agent to request polite-pool access. Never saved to result rows.

## `maxItems` (type: `integer`):

Hard cap on total output rows, including error rows. DOI duplicates do not consume this cap.

## `concurrency` (type: `integer`):

Up to three DOI tasks are scheduled at once. HTTP requests remain serial in both pools to respect Crossref concurrency limits.

## `pageSize` (type: `integer`):

Records requested per page, additionally limited by remaining maxItems.

## `includeReferences` (type: `boolean`):

Include references array for work records. referenceCount is included regardless. Full reference lists can make records large.

## `requestTimeoutSecs` (type: `integer`):

Timeout per HTTP attempt.

## `maxRetries` (type: `integer`):

Retries after timeouts, rate limits and transient server errors, with backoff.

## Actor input object example

```json
{
  "mode": "works",
  "query": "climate change",
  "sort": "published",
  "order": "desc",
  "maxItems": 100,
  "concurrency": 1,
  "pageSize": 100,
  "includeReferences": false,
  "requestTimeoutSecs": 30,
  "maxRetries": 3
}
```

# Actor output Schema

## `dataset` (type: `string`):

Open the default dataset to download metadata results in JSON.

# 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 = {
    "query": "climate change"
};

// Run the Actor and wait for it to finish
const run = await client.actor("grit-77/crossref-works").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 = { "query": "climate change" }

# Run the Actor and wait for it to finish
run = client.actor("grit-77/crossref-works").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "query": "climate change"
}' |
apify call grit-77/crossref-works --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,grit-77/crossref-works"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/O9FzmPyK1sBbZUERr/builds/vUWNgOHtfO9gHACXA/openapi.json
