# BooksRun — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search millions of books and get instant buyback quotes on BooksRun. Browse bestsellers and categories, view detailed book information, and check condition guidelines to understand buyback prices and acceptance criteria.

**Category:** Marketplaces | **Website:** [booksrun.com/](https://booksrun.com/) | **Docs:** [parse.bot/marketplace/c3c88020-53ae-40c0-9e8e-20d902cc597b/booksrun-com-api](https://parse.bot/marketplace/c3c88020-53ae-40c0-9e8e-20d902cc597b/booksrun-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/booksrun/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Browse category

Browse books by category slug. Returns a paginated list of books in the specified category. Known categories: fiction, non-fiction, textbooks, categories (all books).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_slug` | string | Yes | Category slug identifying which category to browse |
| `page` | integer | No | Page number for pagination |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/booksrun/browse-category \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"category_slug":"<string>","page":"<integer>"}'
```

### Get best sellers

Retrieve the list of current best sellers from the BooksRun home page. Returns books with basic info including title, author, starting price, and slug for detail lookup.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/booksrun/get-best-sellers \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get book details

Retrieve full details for a book using its full slug. Includes structured metadata from JSON-LD (author, publisher, ISBN, description), pricing offers, and reader reviews. The slug must be the full format including ISBN and title (e.g. '9781718502703-python-crash-course-3rd-edition'). Bare ISBNs without the title slug suffix will return a not-found error.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `isbn_slug` | string | Yes | Full book slug in format '<isbn13>-<title-slug>' (e.g. '9781718502703-python-crash-course-3rd-edition'). Obtainable from search_books or browse_category results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/booksrun/get-book-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"isbn_slug":"<string>"}'
```

### Get buyback condition guide

Retrieve the buyback condition guide content explaining book acceptance criteria and condition standards. Returns both HTML and plain text versions of the guide.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/booksrun/get-buyback-condition-guide \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get buyback quote

Get an instant buyback quote for a specific ISBN-13. Adds the book to a temporary buyback cart and returns the quoted price. Also returns the current state of the buyback cart including all items.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `isbn` | string | Yes | ISBN-13 of the book to get a buyback quote for (e.g. '9781718502703') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/booksrun/get-buyback-quote \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"isbn":"<string>"}'
```

### Search books

Full-text search over the BooksRun catalog by title, author, or keyword. Returns a paginated list of matching books with basic info. Each result includes isbn_slug for detail lookup via get_book_details.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for pagination |
| `query` | string | Yes | Search keyword (title, author, or ISBN) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/booksrun/search-books \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","query":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.