books.toscrape.com APIbooks.toscrape.com ↗
Access the Books to Scrape catalog via API. List books with pagination and category filters, get pricing, ratings, stock counts, UPC, and descriptions.
curl -X GET 'https://api.parse.bot/scraper/90d3a98c-8a98-4813-ae65-71efbd7e5ad1/list_books?page=1&category=travel_2' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed Python client. Install the CLI, sign in, then pull this API’s generated client:
pip install parse-sdk parse login parse add --marketplace books-toscrape-com-api
parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Books to Scrape SDK — browse the catalog, drill into details."""
from parse_apis.Books_to_Scrape_API import BooksToScrape, BookNotFound
client = BooksToScrape()
# List books from the catalog (first page, all categories)
for book in client.book_summaries.list(limit=5):
print(book.title, book.price, book.rating)
# Filter by category and drill into the first result's details
summary = client.book_summaries.list(category="travel_2", limit=1).first()
if summary:
detail = summary.details()
print(detail.title, detail.upc, detail.availability, detail.category)
# Handle a missing book gracefully
try:
bad_summary = client.book_summaries.list(category="mystery_3", limit=1).first()
if bad_summary:
full = bad_summary.details()
print(full.description[:100])
except BookNotFound as exc:
print(f"Book not found: {exc.book_path}")
print("exercised: book_summaries.list / details / BookNotFound error handling")
List books from the catalog with pagination. Optionally filter by category slug. Returns 20 books per page with title, price (GBP), star rating (1-5), availability status, and product page URL. Paginate by incrementing page until has_next_page is false.
| Param | Type | Description |
|---|---|---|
| page | integer | Page number (1-based). Each page returns up to 20 books. |
| category | string | Category slug to filter by (e.g. 'travel_2', 'mystery_3', 'historical-fiction_4'). Omit to list all books across categories. |
{
"type": "object",
"fields": {
"page": "integer",
"books": "array of book summaries with title, price, rating, availability, url, book_path",
"has_next_page": "boolean",
"total_results": "integer or null"
},
"sample": {
"data": {
"page": 1,
"books": [
{
"url": "https://books.toscrape.com/catalogue/its-only-the-himalayas_981/index.html",
"price": "45.17",
"title": "It's Only the Himalayas",
"rating": 2,
"book_path": "its-only-the-himalayas_981",
"availability": "In stock"
}
],
"has_next_page": false,
"total_results": null
},
"status": "success"
}
}About the books.toscrape.com API
This API exposes 2 endpoints covering the full Books to Scrape catalog of 1,000 books. Use list_books to page through all titles or filter by category slug, receiving up to 20 books per page with price, star rating, availability, and URL. Use get_book_details to retrieve a single book's UPC, tax, description, stock count, and category by passing the book_path slug from the list response.
Catalog Browsing with list_books
The list_books endpoint returns paginated book summaries from the full catalog. Each page delivers up to 20 entries, each containing title, price (GBP, as a string), rating (integer 1–5), availability, a full url, and a book_path slug. Increment the page parameter (1-based) and stop when has_next_page returns false. Pass a category slug such as travel_2 or mystery_3 to narrow results to a single genre. When a category is filtered, total_results reflects that category's count; for the full catalog it may return null.
Book Detail Lookup with get_book_details
Pass any book_path value from a list_books response — for example, a-light-in-the-attic_1000 — to get_book_details. The response adds fields not present in list results: upc, tax, description, num_reviews, and a precise availability string that includes the in-stock count. price is returned as a bare GBP amount without a currency symbol. category is returned as a plain string, confirming which genre the book belongs to.
Coverage and Scope
The catalog covers fiction, non-fiction, and specialty categories — 50 in total, each identifiable by its slug. Category slugs follow the pattern {category-name}_{id} (e.g., historical-fiction_4). The rating field uses integers 1–5 across both endpoints, making cross-catalog rating comparisons straightforward without any text-to-number conversion.
The books.toscrape.com API is a managed, monitored endpoint for books.toscrape.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when books.toscrape.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official books.toscrape.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a price tracker across book categories using the
pricefield fromlist_books - Aggregate star ratings by category to surface the highest-rated genres in the catalog
- Populate a demo e-commerce product database using UPC, description, and availability from
get_book_details - Generate a category inventory report by iterating all 50 category slugs and summing
total_results - Test pagination logic in a frontend app using
has_next_pagefromlist_books - Sync stock counts from
availabilityinget_book_detailsto monitor in-stock status per title - Seed a recommendation engine with genre labels using the
categoryfield from book detail responses
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 250 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Books to Scrape have an official developer API?+
What does `get_book_details` return that `list_books` does not?+
get_book_details adds upc, tax, description, num_reviews, and a stock-count-inclusive availability string. The list_books response only carries title, price, rating, a simple availability status, url, and book_path — enough to browse but not enough for a full product record.How do category slugs work, and where do I find valid values?+
{category-name}_{numeric-id}, for example mystery_3 or historical-fiction_4. You can discover valid slugs by inspecting the url field in list_books results or by referencing the Books to Scrape site's category navigation. Passing an invalid slug will return no results.Does the API return user reviews or review text for books?+
get_book_details returns num_reviews as an integer count but does not return individual review text or reviewer metadata. The Books to Scrape source does not expose review content per book. You can fork this API on Parse and revise it to add a reviews endpoint if that structure becomes available.