# 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. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-booksrun-com-api-c3c88020/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## 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/parse-booksrun-com-api-c3c88020/browse_category \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-booksrun-com-api-c3c88020/get_best_sellers \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-booksrun-com-api-c3c88020/get_book_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-booksrun-com-api-c3c88020/get_buyback_condition_guide \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-booksrun-com-api-c3c88020/get_buyback_quote \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-booksrun-com-api-c3c88020/search_books \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","query":"<string>"}'
```
