# arXiv Paper Search (`arxiv.search`)

Search arXiv preprints by keywords and category: title, abstract, authors, dates, categories and PDF link.

- **Route:** `POST /v1/run/arxiv.search`
- **Price:** $0.0008 per request ($0.80 per 1,000) · `cost_usd` on every response
- **Source:** arXiv API (`arxiv`) · failover: no
- **Measured latency:** p50 93 ms · p95 93 ms · p99 93 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `query` | string | yes |  | Search words |
| `category` | string | no |  | arXiv category, e.g. cs.CL |
| `sort` | string | no | "relevance" | Sort order |
| `limit` | integer | no | 10 | Results to return |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `results` | id, title, summary, authors, published_at, categories, pdf_url. |
| `total` | Total matches. |
| `count` | Papers returned. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/arxiv.search \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"agent tool use","category":"cs.AI","sort":"newest","limit":5}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('arxiv.search', {'query': 'agent tool use', 'category': 'cs.AI', 'sort': 'newest', 'limit': 5})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run arxiv.search '{"query":"agent tool use","category":"cs.AI","sort":"newest","limit":5}'
```

Quote first (free, validates input): `POST /v1/quote/arxiv.search` with the same body.
