# Literature search

> Member beta

`POST https://paperpurr.com/v1/literature/search`

Finds papers on a topic, with metadata, citation counts and, when available, abstracts and open-access links. If you already know the paper, use [Citation lookup](https://paperpurr.com/en/docs/lookup).

## Body parameters

- `query` (string, required) — Topic or keywords in English, 2–300 characters
- `limit` (integer, default 8) — 1–20. The most papers to return
- `year_from` (integer) — Earliest publication year, 1500–2100
- `year_to` (integer) — Latest publication year, 1500–2100

## Examples

curl:

```bash
curl -X POST "https://paperpurr.com/v1/literature/search" \
  -H "Authorization: Bearer $PAPERPURR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"peer feedback in undergraduate academic writing","limit":2,"year_from":2020}'
```

Python:

```python
import os
import requests

r = requests.post(
    "https://paperpurr.com/v1/literature/search",
    headers={"Authorization": f"Bearer {os.environ['PAPERPURR_API_KEY']}"},
    json={
        "query": "peer feedback in undergraduate academic writing",
        "limit": 2,
        "year_from": 2020
    },
)
print(r.json())
```

JS:

```javascript
const r = await fetch("https://paperpurr.com/v1/literature/search", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.PAPERPURR_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "query": "peer feedback in undergraduate academic writing",
    "limit": 2,
    "year_from": 2020
  }),
});
console.log(await r.json());
```

## Response

```json
{
  "results": [
    {
      "title": "Online Writing Feedback at University: Benefits and Impact on Undergraduate Students’ Academic Writing Literacy",
      "authors": [
        "Neda Chepinchikj"
      ],
      "year": 2025,
      "venue": "",
      "doi": "10.2139/ssrn.5580667",
      "url": "https://doi.org/10.2139/ssrn.5580667",
      "open_access_url": null,
      "cited_by": 0,
      "abstract": null,
      "source": "crossref"
    },
    {
      "title": "The relationship between peer feedback features and revision sources mediated by feedback acceptance: The effect on undergraduate students’ writing performance",
      "authors": [
        "Qi Lu",
        "Yuan Yao",
        "Xinhua Zhu"
      ],
      "year": 2023,
      "venue": "Assessing Writing",
      "doi": "10.1016/j.asw.2023.100725",
      "url": "https://doi.org/10.1016/j.asw.2023.100725",
      "open_access_url": null,
      "cited_by": 19,
      "abstract": null,
      "source": "crossref"
    }
  ],
  "request_id": "req_9d0e4c7ab1325f68e7a0c4d1"
}
```

- `results` (object[], required) — Ranked by relevance, empty when nothing is found. Preprints and published versions with the same title are merged and peer reviews are left out, so you may get fewer than `limit`.
  - `title` (string, required) — Title
  - `authors` (string[], required) — Authors, up to 10
  - `year` (integer | null, required) — Publication year, or `null` if unknown
  - `venue` (string, required) — Journal or conference, or an empty string
  - `doi` (string, required) — DOI, or an empty string
  - `url` (string, required) — Link
  - `open_access_url` (string | null, required) — Open-access link
  - `cited_by` (integer, required) — Times cited
  - `abstract` (string | null, required) — Abstract. One ending in … has been cut
  - `source` (string, required) — `openalex`, or `doaj` or `crossref` when OpenAlex doesn’t respond
- `request_id` (string, required) — Request ID

> **Tip:** Read the abstract or the paper before citing it for a claim.

## Possible errors

| Status | code | Cause | What to do |
| --- | --- | --- | --- |
| `400` | `missing_parameter` | A required parameter is missing. `param` names it. | Add the parameter. |
| `400` | `invalid_parameter` | A parameter has the wrong type or value. `param` names it. | Fix it to match the type and range in the reference. |
| `400` | `unknown_parameter` | The request has a query parameter or body field the endpoint doesn’t accept. | Remove it or check the spelling. |
| `400` | `invalid_json` | The request body isn’t a JSON object. | Send a single JSON object with `Content-Type: application/json`. |
| `429` | `rate_limit_exceeded` | A rate limit was hit. `message` explains. | Wait `Retry-After` seconds, then retry. Queue requests if several processes share one key. |
| `502` | `upstream_unavailable` | The literature databases, the rewriting model or the check service didn’t respond. | Retry later. Nothing is counted for this call. |

See [Authentication](https://paperpurr.com/en/docs/auth) for auth errors and [Errors](https://paperpurr.com/en/docs/errors) for the full list.

## Metering

- Free during the beta, but counts toward your rate limit.

Next: [Citation lookup](https://paperpurr.com/en/docs/lookup.md)
