# Librarything — 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 retrieve detailed metadata, reviews, and author information from LibraryThing's vast catalog. Access member libraries, trending titles, author works, and tag-based book collections to explore one of the web's largest book cataloging communities.

**Category:** Education | **Website:** [librarything.com/](https://librarything.com/) | **Docs:** [parse.bot/marketplace/812fd553-eabf-43ce-82f3-b137d2cc055c/librarything-com-api](https://parse.bot/marketplace/812fd553-eabf-43ce-82f3-b137d2cc055c/librarything-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-librarything-com-api-812fd553/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_author_works

Get works by an author using their LibraryThing author slug. Returns a list of works with work_id, title, and URL. The author slug can be found in author page URLs (e.g. 'rowlingjk' for J.K. Rowling).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `author_id` | string | Yes | Author code/slug from LibraryThing author URL (e.g. 'rowlingjk', 'tolkienjrr') |
| `limit` | integer | No | Maximum number of works to return |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-librarything-com-api-812fd553/get_author_works \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"author_id":"<string>","limit":"<integer>"}'
```

### get_book_by_isbn

Look up a book by ISBN-10 or ISBN-13 and return its basic details including work ID, title, author, and rating. Returns input_not_found error if no book matches the ISBN.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `isbn` | string | Yes | ISBN-10 or ISBN-13 (e.g. '9780451524935' or '0743273567') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-librarything-com-api-812fd553/get_book_by_isbn \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"isbn":"<string>"}'
```

### get_book_details

Get detailed book information by work ID from the LibraryThing REST API. Returns title, author, description, rating (0-5 scale), original publication date, and tags. Returns input_not_found error if the work ID does not exist.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `work_id` | string | Yes | LibraryThing work ID (numeric string, e.g. '113') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-librarything-com-api-812fd553/get_book_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"work_id":"<string>"}'
```

### get_book_reviews

Get member reviews for a book by work ID. Returns paginated reviews with username, rating (star count), review text (truncated to 1000 chars), and date. Each page returns up to 100 reviews.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for pagination |
| `work_id` | string | Yes | LibraryThing work ID (numeric string) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-librarything-com-api-812fd553/get_book_reviews \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","work_id":"<string>"}'
```

### get_member_library

Get a member's book catalog/library. Returns a paginated list of books with title, author, publication date, entry date, and rating. Use offset to paginate through results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of books to return |
| `offset` | integer | No | Pagination offset (number of books to skip) |
| `username` | string | Yes | LibraryThing username (e.g. 'timspalding') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-librarything-com-api-812fd553/get_member_library \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","offset":"<integer>","username":"<string>"}'
```

### get_tag_books

Get books tagged with a specific tag. Returns books sorted by popularity within that tag. Tags are user-generated labels (e.g. 'fiction', 'science', 'history'). Author and tag_count may be null depending on page structure.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of books to return |
| `tag` | string | Yes | Tag name (e.g. 'fiction', 'science', 'history', 'fantasy') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-librarything-com-api-812fd553/get_tag_books \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","tag":"<string>"}'
```

### get_zeitgeist_books

Get zeitgeist/trending book data and site statistics from LibraryThing. For the 'overview' category, returns site-wide statistics (member counts, books cataloged, etc.), most reviewed books, most cataloged books, and top authors. Other categories return section-specific data.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category` | string | No | Zeitgeist category. 'overview' returns main stats with top authors and most reviewed books. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-librarything-com-api-812fd553/get_zeitgeist_books \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category":"<string>"}'
```

### search_books

Search for books by keyword using the LibraryThing REST API. Returns matching works with title, author, and rating. The REST API returns a single best-match result; if no REST match is found, falls back to the HTML search page for broader results. Rating is on a 0-5 scale.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of results to return |
| `query` | string | Yes | Search keyword or phrase (book title, author name, or topic) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-librarything-com-api-812fd553/search_books \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","query":"<string>"}'
```
