# ArXiv Papers Scraper (`leftwinglautus/arxiv-papers-scraper`) Actor

Search and scrape academic papers from the arXiv API by keyword, category, or author.

- **URL**: https://apify.com/leftwinglautus/arxiv-papers-scraper.md
- **Developed by:** [Moeeze Hassan](https://apify.com/leftwinglautus) (community)
- **Categories:** AI, News
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## ArXiv Papers Scraper

Search and scrape academic papers from the [arXiv API](https://arxiv.org/) by keyword, category, or author. The actor queries the arXiv Atom XML feed and returns structured paper records including title, authors, abstract, category, and direct PDF/abstract URLs.

### Features

- Full-text and metadata search via the arXiv search API
- Optional category filter (e.g. `cs.AI`, `cs.CL`, `stat.ML`)
- Sort by relevance or date, ascending or descending
- Direct links to the PDF and abstract pages

### Input Fields

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `query` | string | ✅ | `""` | Search query (keyword, author name, or phrase). |
| `maxResults` | integer | ❌ | `20` | Maximum number of papers to return (1–200). |
| `sortBy` | string (enum) | ❌ | `relevance` | Sort results by `relevance` or `date`. |
| `sortOrder` | string (enum) | ❌ | `descending` | Sort order: `descending` or `ascending`. |
| `category` | string | ❌ | `""` | Optional arXiv category filter (e.g. `cs.AI`, `cs.CL`, `stat.ML`). |

> At least a `query` or `category` must be provided.

### Output Fields

Each pushed dataset item is a paper record with the following fields:

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | arXiv paper ID (e.g. `2301.12345v1`). |
| `title` | string | Paper title. |
| `authors` | array\<string> | List of author names. |
| `abstract` | string | Paper abstract (whitespace-collapsed). |
| `publishedDate` | string | Original publication date (ISO-8601). |
| `updatedDate` | string | Last updated date (ISO-8601). |
| `primaryCategory` | string | Primary arXiv category. |
| `pdfUrl` | string | Direct URL to the PDF. |
| `arxivUrl` | string | URL to the arXiv abstract page. |

### Usage Example

#### Search for papers on "transformer attention"

```json
{
    "query": "transformer attention",
    "maxResults": 20,
    "sortBy": "relevance",
    "sortOrder": "descending"
}
```

#### Get the latest 10 papers in the `cs.AI` category

```json
{
    "query": "",
    "category": "cs.AI",
    "maxResults": 10,
    "sortBy": "date",
    "sortOrder": "descending"
}
```

#### Search for a specific author with a category filter

```json
{
    "query": "Yann LeCun",
    "category": "cs.LG",
    "maxResults": 50,
    "sortBy": "date",
    "sortOrder": "descending"
}
```

#### Run via the Apify CLI

```bash
apify run arxiv-papers-scraper --input '{"query":"transformer attention","maxResults":20}'
```

### Data Source

Papers are fetched from the arXiv export API at `http://export.arxiv.org/api/query`, which returns an Atom XML feed.

# Actor input Schema

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

Search query (keyword, author name, or phrase).

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

Maximum number of papers to return.

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

Sort results by relevance or date.

## `sortOrder` (type: `string`):

Sort order: descending or ascending.

## `category` (type: `string`):

Optional arXiv category filter (e.g. cs.AI, cs.CL, stat.ML).

## Actor input object example

```json
{
  "query": "",
  "maxResults": 20,
  "sortBy": "relevance",
  "sortOrder": "descending",
  "category": ""
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("leftwinglautus/arxiv-papers-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("leftwinglautus/arxiv-papers-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 '{}' |
apify call leftwinglautus/arxiv-papers-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/yNfwCEQ0dw836lIyc/builds/xEpP7GbhYndH0fgbh/openapi.json
