# arXiv Paper API - Metadata by ID, No Key, Free for Missing (`stas_k/arxiv-paper-api`) Actor

Junk lines and ids arXiv never had vanish quietly: they come back free with the reason instead of a billed row. Send ids or links, get title, authors, abstract, categories, DOI and PDF links.

- **URL**: https://apify.com/stas_k/arxiv-paper-api.md
- **Developed by:** [Stas K](https://apify.com/stas_k) (community)
- **Categories:** Developer tools, AI, Education
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 87.5% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.80 / 1,000 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 Paper API - metadata by id, no key, free for missing

Send arXiv ids or links on arxiv.org, get one row per paper: title, authors, abstract,
categories, dates, DOI, journal reference and PDF link. No API key, no browser, no proxy.

An id that arXiv never saw is a **verdict**: the row comes back free with the reason, so a
literature check does not pay for papers that do not exist.

### Input

| field | what it is |
|---|---|
| `papers` | arXiv ids (`1706.03762`, `hep-th/9901001`, `cond-mat.mes-hall/0211022`) or links (`https://arxiv.org/abs/1706.03762`, `https://arxiv.org/pdf/1706.03762.pdf`). A version such as `1706.03762v5` reads that version, not the newest one. The API answers old ids only in canonical form, so a sub-archive is dropped for the request: `cond-mat.mes-hall/0211022` and `cond-mat/0211022` are the same paper and are charged once. |
| `maxPapers` | How many papers to read and sell. Default 100, maximum 500. |
| `includeAbstract` | Add the full abstract to every row. On by default. |

### Output, one row per paper

`arxivId`, `version`, `title`, `authors`, `publishedAt`, `updatedAt`, `primaryCategory`,
`categories`, `comment`, `journalRef`, `doi`, `abstract`, `absUrl`, `pdfUrl`, `billable`,
plus `actorIndex` and `actorInput` so the input order can be rebuilt.

Free status rows carry `status` and `reason` instead of paper fields:

- `INVALID_INPUT` - the line is not an arXiv id or a link on arxiv.org.
- `DUPLICATE` - the same id was already sent in this run.
- `NOT_FOUND` - a valid id, but arXiv has no paper behind it.
- `NOT_CHECKED_TIME`, `NOT_CHECKED_CAP`, `NOT_CHECKED_BILLING`, `NOT_CHECKED_ERROR` - the
  line was not read, and the reason says why (deadline, spending limit, unreadable price,
  an unreachable arXiv, an id arXiv refused).

One refused id does not cost the rest. arXiv answers HTTP 500 for a whole `id_list` when a
single id in it is bad, so a version the API will not serve used to take down every paper in
the chunk. The run now splits the chunk until the refused id stands alone: the papers beside
it are sold, and that one line comes back free as `NOT_CHECKED_ERROR` with the reason, to be
sent again later.

### Price

$0.80 per 1,000 papers: `paper-delivered` is charged once per paper that came back with
metadata. A missing id, a malformed line and a duplicate cost nothing. The lowest spending
limit you can set per run is $0.05.

### Politeness and limits

The arXiv API is keyless, and its terms ask for one request at a time with a pause of a few
seconds and a User-Agent that names the caller. Ids therefore go out in chunks of 50 with a
3 second pause between chunks, so 500 papers take 10 requests and about 30 seconds of
waiting. The run reads at most 500 papers.

### What this actor does not do

- It does not search by keyword, author or category: it reads the ids you give it.
- It does not download or parse the PDF: `pdfUrl` points at the file, the text is yours to
  fetch.
- It does not give the full version history: a row carries the newest version and its
  number. Older versions are not read.
- It does not build a citation graph.

### Source

Data comes from the official arXiv Atom API (`export.arxiv.org/api/query`), keyless.
Metadata is reported as arXiv returns it; the abstract is returned with its line breaks
collapsed into single spaces. arXiv is operated by Cornell University and subject to its own
terms of use.

# Actor input Schema

## `papers` (type: `array`):

arXiv ids (1706.03762, hep-th/9901001) or links on arxiv.org. Versions such as 1706.03762v5 are accepted.

## `maxPapers` (type: `integer`):

How many papers to read and sell. Default 100, maximum 500.

## `includeAbstract` (type: `boolean`):

Add the full abstract text to every row. On by default.

## Actor input object example

```json
{
  "papers": [
    "1706.03762",
    "https://arxiv.org/abs/2103.00020",
    "not-an-arxiv-id"
  ],
  "maxPapers": 100,
  "includeAbstract": true
}
```

# Actor output Schema

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

One row per id. Paid rows carry arxivId, version, title, authors, publishedAt, updatedAt, primaryCategory, categories, comment, journalRef, doi, absUrl, pdfUrl and billable true; every other row is a free status row with a reason and no paper. Status rows are written in batches of up to 100, so sort by actorIndex to get the input order back.

## `summary` (type: `string`):

Counters of the run: requested, attempted, delivered, chargedEvents, deliveredUncharged, deliveredUnverified, chargeUncertain, writeErrors, papersNotFound, papersInvalid, cutByLimit, byStatus, counterMismatch, stopReason, datasetNote, firstFailure and priceNote. A copy under RUN_SUMMARY-<runId> is kept in the named store arxiv-paper-summary.

# 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 = {
    "papers": [
        "1706.03762",
        "https://arxiv.org/abs/2103.00020",
        "not-an-arxiv-id"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("stas_k/arxiv-paper-api").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 = { "papers": [
        "1706.03762",
        "https://arxiv.org/abs/2103.00020",
        "not-an-arxiv-id",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("stas_k/arxiv-paper-api").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 '{
  "papers": [
    "1706.03762",
    "https://arxiv.org/abs/2103.00020",
    "not-an-arxiv-id"
  ]
}' |
apify call stas_k/arxiv-paper-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,stas_k/arxiv-paper-api"
        }
    }
}
```

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/qWJG6JXC4AvQ11dAg/builds/TATW2gkzlEL8n4Ab3/openapi.json
