# Bookshop.org — 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 for books by keyword or category, view detailed information like metadata and pricing, discover curated reading lists, and find independent bookstores near you on Bookshop.org. Filter results by format and browse new releases to discover your next read.

**Category:** E-commerce | **Website:** [bookshop.org/](https://bookshop.org/) | **Docs:** [parse.bot/marketplace/cc07f8e2-f776-4687-860b-e08e413757bb/bookshop-org-api](https://parse.bot/marketplace/cc07f8e2-f776-4687-860b-e08e413757bb/bookshop-org-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/bookshop-org/`
**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

### Get book details

Retrieve full details for a specific book by its product page URL (obtained from search_books or get_books_by_category results). Returns title, author, price string, full description text, and structured metadata (publisher, pages, dimensions, language, etc.). Requires one page fetch per call.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | Yes | The book detail URL from search_books or get_books_by_category results (detail_url field). |

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

### Get books by category

Browse books within a named category on Bookshop.org. Categories map internally to BISAC subject codes. Supports pagination via offset/limit. Returns book summaries with title, author, price, cover image, and detail URL. Prices are in cents (USD).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category` | string | Yes | Category slug. Verified values: fiction, nonfiction, romance, fantasy, mystery, sci-fi, ya, kids, popular-books, special-offers, ebooks, pre-order-offers. Other values are attempted as BISAC prefix lookups. |
| `limit` | integer | No | Max results to return per page. |
| `offset` | integer | No | Offset for pagination. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/bookshop-org/get-books-by-category \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"category":"<string>","limit":"<integer>","offset":"<integer>"}'
```

### Get bookstore listings

Find independent bookstore partners near a geographic location. Uses latitude/longitude coordinates and a search radius in miles. Returns store name, address, city, state, and contact information when available.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `lat` | number | No | Latitude of the search center. |
| `lng` | number | No | Longitude of the search center. |
| `radius` | integer | No | Search radius in miles. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/bookshop-org/get-bookstore-listings \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"lat":"<number>","lng":"<number>","radius":"<integer>"}'
```

### Get new books

Retrieve the curated 'New Books' list from Bookshop.org. Returns recently published titles with their authors and detail URLs. The list is editorially curated and typically contains 10-20 books. No input parameters required.

**Estimated cost:** Metered

_No parameters required._

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

### Search books

Full-text search over Bookshop.org's catalog by keyword (title, author, or ISBN). Supports pagination via offset/limit and optional format filtering. Returns book summaries including title, author, price, cover image, and detail URL. Prices are in cents (USD). The total is an estimate from the search engine and may exceed actual retrievable results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `format` | string | No | Filter by book format. |
| `limit` | integer | No | Max results to return per page. |
| `offset` | integer | No | Offset for pagination. |
| `query` | string | Yes | Search keyword (title, author, or ISBN). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/bookshop-org/search-books \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"format":"<string>","limit":"<integer>","offset":"<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.