# Book Search (Open Library) (`openlibrary.search`)

Search books by title, author or subject in Open Library: authors, first publication year, editions, ISBNs, subjects and cover image.

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

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `query` | string | yes |  | Search words; supports title:, author:, subject: |
| `limit` | integer | no | 10 | Results to return |

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

| Field | Meaning |
|---|---|
| `books` | work_id, title, authors, first_published, editions, isbn, subjects, cover, url. |
| `total` | Total matches. |
| `count` | Books returned. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/openlibrary.search \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"dune frank herbert","limit":3}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('openlibrary.search', {'query': 'dune frank herbert', 'limit': 3})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run openlibrary.search '{"query":"dune frank herbert","limit":3}'
```

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