# arXiv & PubMed Papers Scraper + OpenAlex Citations API (`autotroph/arxiv-pubmed-openalex-normalizer`) Actor

Scrape & cross-deduplicate arXiv preprints and NIH PubMed papers enriched with live OpenAlex citations, DOIs, ORCIDs, ROR institutions, MeSH/arXiv taxonomies, grants & open-access PDFs. Built for AI literature review, RAG & Apify MCP.

- **URL**: https://apify.com/autotroph/arxiv-pubmed-openalex-normalizer.md
- **Developed by:** [Shuma Fujino](https://apify.com/autotroph) (community)
- **Categories:** AI, Developer tools, MCP servers
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 normalized academic papers

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

## arXiv & PubMed Papers Scraper + OpenAlex Citations API

Scrape clean, deduplicated **arXiv preprints and NIH PubMed articles** enriched with **live OpenAlex citation counts, canonical DOIs, ORCIDs, ROR institutions, MeSH/arXiv taxonomies, funding grants, and direct open-access PDFs** — **zero proxies, $0.00005 start fee (512 MB default), $0.004/paper ($4.00 / 1,000 papers)**. MCP-ready.

### Quickstart Input

Click **Start** with the pre-filled defaults to fetch 5 enriched, cross-deduplicated papers in seconds:

```json
{
  "sources": ["arxiv", "pubmed"],
  "query": "retrieval augmented generation",
  "maxItems": 5,
  "includeOpenAlexEnrichment": true,
  "deduplicateAcrossSources": true
}
```

### Why This Actor Beats Naive arXiv & PubMed Scrapers

| Capability | Naive Single-Source XML / HTML Scrapers | arXiv & PubMed + OpenAlex Citation Normalizer |
|---|---|---|
| **Data Sources & Cost** | Scrapes HTML pages or queries one flat XML feed without enrichment (brittle selectors, missing fields, proxy waste) | Fuses **official zero-proxy arXiv Export/OAI-PMH XML + NIH PubMed E-utilities XML + OpenAlex Works JSON** in batched API calls |
| **Canonical DOI & Deduplication** | Emits raw versioned URLs (`http://arxiv.org/abs/1706.03762v7`) and duplicates papers appearing in both arXiv and PubMed | Strips version suffixes (`arxiv_id` + `arxiv_version`), resolves publisher & DataCite arXiv DOIs (`10.48550/arxiv.*`), and merges cross-source duplicates into a single `canonical_id` |
| **Live Citation Graph & Impact** | arXiv XML and PubMed XML contain **zero citation counts** or reference graph metrics | Batch-enriches via **OpenAlex Works API** with `cited_by_count`, `referenced_works_count`, `fwci` (Field-Weighted Citation Impact), `citation_percentile`, `citations_per_year`, and `counts_by_year` |
| **Authors, ORCIDs & ROR Institutions** | Missing ORCID identifiers, unstructured raw affiliation strings, no country codes or institutional IDs | Resolves validated **ORCIDs** (`orcid_count`), deduplicated canonical **ROR institutions** (`ror`, `openalex_id`), and ISO-2 `institution_countries` |
| **Taxonomy Normalization** | Raw cryptic arXiv codes (`cs.CL`, `q-bio.GN`) or flat MeSH strings without UI/major-topic flags | Maps arXiv codes to human-readable `arxiv_category_names`, extracts structured **MeSH descriptors** (`ui`, `name`, `is_major_topic`), plus OpenAlex `topics` and `research_domain` |
| **Open-Access PDF Resolution** | Misses PMC full-text PDFs and publisher OA repositories; leaves broken or non-HTTPS links | Deterministically resolves `is_open_access`, `oa_status` (`gold`/`diamond`/`green`/`hybrid`/`bronze`/`closed`), `oa_license`, and direct `pdf_url` (arXiv PDF, OpenAlex `best_oa_location`, or PMC PDF) |
| **Funding Grants & Peer-Review Status** | Drops NIH `GrantList` entries or misses non-NIH funders; fails to flag peer-review vs preprint or retraction status | Fuses **NIH PubMed `GrantList`** + **OpenAlex `funders`/`awards`** with ROR IDs, plus explicit `is_peer_reviewed` and `is_retracted` flags |
| **Deterministic Integrity Verification** | Silent schema drift, raw newlines in titles, malformed DOIs/ORCIDs, broken date formats | Built-in per-paper deterministic integrity verifier (`integrity_valid`, `integrity_errors`) — **100% pass across 20 real arXiv & PubMed papers** (vs. `6.0%` for naive single-source XML) |

### Verified Output Schema Example (`1706.03762`)

```json
{
  "canonical_id": "doi:10.48550/arxiv.1706.03762",
  "doi": "10.48550/arxiv.1706.03762",
  "doi_url": "https://doi.org/10.48550/arxiv.1706.03762",
  "doi_source": "arxiv_datacite_doi",
  "arxiv_id": "1706.03762",
  "arxiv_version": "v7",
  "pmid": null,
  "pmcid": null,
  "openalex_id": "W2626778328",
  "source_origin": "arxiv",
  "data_sources": ["arxiv_api", "openalex"],
  "title": "Attention Is All You Need",
  "publication_date": "2017-06-12",
  "updated_date": "2023-08-02",
  "publication_year": 2017,
  "venue_name": "arXiv",
  "publication_type": "preprint",
  "is_peer_reviewed": false,
  "is_retracted": false,
  "author_count": 8,
  "orcid_count": 4,
  "institution_countries": ["US", "CA"],
  "primary_category": "cs.CL",
  "arxiv_categories": ["cs.CL", "cs.LG"],
  "arxiv_category_names": ["Computation and Language", "Machine Learning"],
  "topics": ["Natural Language Processing Techniques", "Topic Modeling"],
  "research_domain": "Physical Sciences",
  "cited_by_count": 126677,
  "referenced_works_count": 94,
  "fwci": 563.9497,
  "citations_per_year": 12667.7,
  "openalex_enriched": true,
  "is_open_access": true,
  "oa_status": "diamond",
  "pdf_url": "https://arxiv.org/pdf/1706.03762.pdf",
  "landing_page_url": "https://arxiv.org/abs/1706.03762",
  "funding_count": 8,
  "integrity_valid": true,
  "integrity_errors": []
}
```

### Input Configuration

- **`sources`**: Any combination of `["arxiv", "pubmed"]` (default: both, round-robin balanced).
- **`query`**: Optional free-text search query (e.g., `"large language models"`, `"CRISPR gene editing"`).
- **`arxivCategories`**: Optional arXiv subject filters (e.g., `["cs.AI", "cs.LG", "cs.CL", "q-bio.GN"]`).
- **`arxivIds` / `pmids`**: Optional exact arXiv IDs (e.g., `["1706.03762", "2501.12948"]`) or PubMed PMIDs (`["38786024"]`) for direct lookup.
- **`meshTerms`**: Optional NIH MeSH descriptors for PubMed (e.g., `["CRISPR-Cas Systems", "Immunotherapy"]`).
- **`publishedAfter` / `publishedBefore` / `sortBy` / `minCitations` / `openAccessOnly` / `maxItems`**: Date bounds, ordering (`relevance`, `submittedDate`, `citations`), citation threshold, OA filter, and output cap (1–500).
- **`includeOpenAlexEnrichment` / `deduplicateAcrossSources` / `strictValidation`**: Toggle OpenAlex citation graph enrichment, cross-source deduplication, and strict integrity filtering.

### MCP & AI Agent Integration

Connect this Actor directly to Claude Code, Cursor, VS Code, or any **Model Context Protocol (MCP)** client via Apify's hosted MCP server:

```bash
claude mcp add --transport http arxiv-pubmed-openalex \
  "https://mcp.apify.com?tools=autotroph/arxiv-pubmed-openalex-normalizer" \
  --header "Authorization: Bearer YOUR_APIFY_TOKEN"
```

```json
{
  "mcpServers": {
    "arxiv-pubmed-openalex": {
      "type": "http",
      "url": "https://mcp.apify.com?tools=autotroph/arxiv-pubmed-openalex-normalizer",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

### Transparent Pay-Per-Event (PPE) Pricing

- **`apify-actor-start`**: `$0.00005` per run start (512 MB default — essentially free to test)
- **`paper-normalized`**: `$0.004` per normalized, integrity-verified paper (`$4.00 / 1,000 papers`, including arXiv/PubMed XML parsing, OpenAlex citation graph enrichment, ORCID/ROR resolution, funding fusion, and integrity checks)
- **Zero proxy surcharge**: Powered strictly by official public arXiv, NIH PubMed E-utilities, and OpenAlex APIs.

### Local Standalone Test (No Apify Credentials Needed)

```bash
python -m src.main --local-test --sources arxiv,pubmed --max-items 3
```

# Actor input Schema

## `sources` (type: `array`):

Sources to query: any combination of 'arxiv' and 'pubmed' (defaults to \['arxiv', 'pubmed'], round-robin balanced).

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

Free-text search keywords applied across selected sources (e.g., 'large language models', 'CRISPR gene editing', 'protein folding'). Leave blank for latest AI/ML + biomedical research.

## `arxivCategories` (type: `array`):

Optional arXiv subject categories (e.g., \['cs.AI', 'cs.LG', 'cs.CL', 'q-bio.GN']). Defaults to \['cs.AI', 'cs.LG', 'cs.CL'] when no query or arXiv IDs are supplied.

## `arxivIds` (type: `array`):

Optional exact arXiv IDs or URLs for direct normalization (e.g., \['1706.03762', '2501.12948']).

## `pmids` (type: `array`):

Optional exact numeric PubMed PMIDs for direct normalization (e.g., \['38786024', '38909984']).

## `meshTerms` (type: `array`):

Optional NIH Medical Subject Headings (MeSH) descriptors to filter PubMed queries (e.g., \['CRISPR-Cas Systems', 'Immunotherapy', 'mRNA Vaccines']).

## `publishedAfter` (type: `string`):

Optional inclusive lower publication date bound in ISO YYYY-MM-DD format (e.g., '2023-01-01').

## `publishedBefore` (type: `string`):

Optional inclusive upper publication date bound in ISO YYYY-MM-DD format (e.g., '2026-12-31').

## `sortBy` (type: `string`):

Result ordering: 'relevance' (default), 'submittedDate' (most recent first), or 'citations' (highest OpenAlex cited_by_count first).

## `minCitations` (type: `integer`):

Optional minimum OpenAlex citation count filter (0 disables filter).

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

When true, emit only papers with verified open-access status or direct PDF link.

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

Maximum number of deduplicated, normalized academic papers to emit (1 to 500).

## `includeOpenAlexEnrichment` (type: `boolean`):

Batch-enrich papers with live OpenAlex citation counts, FWCI, ORCIDs, ROR institutions, funding grants, and OA PDF URLs.

## `deduplicateAcrossSources` (type: `boolean`):

Merge duplicate papers appearing in both arXiv and PubMed (by canonical DOI or normalized title) into a single unified record.

## `strictValidation` (type: `boolean`):

When true, records failing deterministic identifier, date, or schema integrity checks are skipped instead of billed/pushed.

## Actor input object example

```json
{
  "sources": [
    "arxiv",
    "pubmed"
  ],
  "query": "retrieval augmented generation",
  "arxivCategories": [],
  "arxivIds": [],
  "pmids": [],
  "meshTerms": [],
  "publishedAfter": "",
  "publishedBefore": "",
  "sortBy": "relevance",
  "minCitations": 0,
  "openAccessOnly": false,
  "maxItems": 5,
  "includeOpenAlexEnrichment": true,
  "deduplicateAcrossSources": true,
  "strictValidation": false
}
```

# Actor output Schema

## `papers` (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 = {
    "sources": [
        "arxiv",
        "pubmed"
    ],
    "query": "retrieval augmented generation",
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("autotroph/arxiv-pubmed-openalex-normalizer").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 = {
    "sources": [
        "arxiv",
        "pubmed",
    ],
    "query": "retrieval augmented generation",
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("autotroph/arxiv-pubmed-openalex-normalizer").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 '{
  "sources": [
    "arxiv",
    "pubmed"
  ],
  "query": "retrieval augmented generation",
  "maxItems": 5
}' |
apify call autotroph/arxiv-pubmed-openalex-normalizer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,autotroph/arxiv-pubmed-openalex-normalizer"
        }
    }
}
```

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/9ibQN0tJsyLaNLvke/builds/pTuDVLl2zjJSsLOcU/openapi.json
