# Manuscripts

List, fetch and add manuscripts in a collection.

## List manuscripts

`GET /v1/manuscripts` returns the newest first, 20 at a time. Filter with `century`, `place` or `q` for full-text search.

```shell
curl https://api.warraq.dev/v1/manuscripts?place=Baghdad \
  -H "Authorization: Bearer wq_live_3f9a7c21"
```

```js
const res = await fetch('https://api.warraq.dev/v1/manuscripts?place=Baghdad', {
  headers: { Authorization: `Bearer ${process.env.WARRAQ_KEY}` }
});
const body = await res.json();
```

```python
import os, requests

res = requests.get(
    "https://api.warraq.dev/v1/manuscripts?place=Baghdad",
    headers={"Authorization": f"Bearer {os.environ['WARRAQ_KEY']}"},
)
body = res.json()
```

## The manuscript object

```json
{
  "id": "ms_8d21",
  "title": "Kitāb al-Jabr wa-l-Muqābala",
  "author": "al-Khwārizmī",
  "copyist": "Yūsuf ibn ʿAlī",
  "place": "Baghdad",
  "century": 12,
  "status": "ready"
}
```

### Status

A new scan is `reading` until Warraq finishes with it, then `ready`. A scan it can’t read is `failed`, with the reason in `error`.
