# Crossref Scholarly Search (`crossref.works`)

Search 160M+ scholarly works in Crossref: DOI, title, authors, journal, year, citation count and abstract when the publisher deposits one.

- **Route:** `POST /v1/run/crossref.works`
- **Price:** $0.0008 per request ($0.80 per 1,000) · `cost_usd` on every response
- **Source:** Crossref REST API (`crossref`) · failover: no
- **Measured latency:** not enough calls measured yet
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `query` | string | yes |  | Search words |
| `limit` | integer | no | 10 | Results to return |
| `from_year` | integer | no | 0 | Only works published from this year (0 = any) |
| `sort` | string | no | "relevance" | Sort order |

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

| Field | Meaning |
|---|---|
| `results` | doi, title, authors, journal, year, cited_by, abstract, url. |
| `total` | Total matches. |
| `count` | Works returned. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/crossref.works \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"retrieval augmented generation","limit":5,"from_year":2023}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('crossref.works', {'query': 'retrieval augmented generation', 'limit': 5, 'from_year': 2023})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run crossref.works '{"query":"retrieval augmented generation","limit":5,"from_year":2023}'
```

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