# Casa del Libro Books Scraper (Spain) (`bibian/casadellibro-books-scraper`) Actor

Extract book listings from Casa del Libro, a major Spanish bookstore: title, author, publisher, category, ISBN, format, page count, price, currency, stock status, language and publication date.

- **URL**: https://apify.com/bibian/casadellibro-books-scraper.md
- **Developed by:** [Vivien MORVAN](https://apify.com/bibian) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 book listings

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Casa del Libro Books Scraper (Spain)

Scrape [Casa del Libro](https://www.casadellibro.com), a major Spanish bookstore, for book data: title, author, publisher, category, ISBN, format, page count, prices and stock status, ready for price tracking, market research and catalog comparison in Spain.

### What you can do with it

- **Track book prices in Spain**: pull current price, currency and stock status for new and recently reissued titles.
- **Build a catalog or price-comparison feed**: export title, author, publisher, ISBN, format and page count for cataloging or matching against your own inventory.
- **Research the Spanish publishing market**: see which publishers and categories dominate newly released books over the last 30 days.
- **Feed a book recommendation or metadata database**: ISBN, language and publication date are ready for deduplication against other sources.

### Input

| Field | What it does |
|---|---|
| Maximum number of books | The run stops once this many books are saved. |

### Output

One record per book:

```json
{
  "title": "Responsabilidad por daños en la construcción modular de edificios",
  "author": "PEDRO PEREZ CABALLERO ABAD",
  "publisher": "Editorial Dykinson, S.L.",
  "category": "Derecho civil",
  "isbn": "9791370474553",
  "bookFormat": "Paperback",
  "numberOfPages": 156,
  "price": 19,
  "currency": "EUR",
  "inStock": false,
  "language": "es",
  "datePublished": "2026-10-01",
  "url": "https://www.casadellibro.com/libro-responsabilidad-por-danos-en-la-construccion-modular-de-edificios/9791370474553/18780048"
}
```

Export the dataset as JSON, CSV or Excel, or read it through the Apify API.

### Good to know

- Books are listed from Casa del Libro's own "new and recently reissued books" sitemap (last 30 days for printed books, ebooks and audiobooks, last 7 days for textbooks, last 90 days for pre-orders), not a paginated listing: the site's robots.txt blocks every listing, sort and search path (`/libros/p1*`...`/p9*`, `/libros/ordenar*`, `/libros/*?*`, `/fichas*`, `/libreria*`), so the sitemap is the only discovery path available. A typical run has several thousand book URLs to pick from.
- `inStock` reflects the edition's real-time availability on the site: a `false` value means the edition is currently out of stock, not a scraping error.
- `author` is the book's own published bibliographic credit (the same kind of public attribution as a film's director), never a private individual's contact data. Co-written books list every credited author.
- `category` is the most specific category Casa del Libro's own breadcrumb gives for the book (e.g. "Derecho civil", "Poesía contemporánea española del XIX al XXI").
- `price` and `numberOfPages` are numbers, not text, even though the site publishes them as strings.
- A handful of listed editions occasionally come back 404 between the sitemap being generated and the page being fetched (taken off sale, merged into another ISBN); those are skipped rather than failing the run.
- No browser and no proxy needed: runs are fast and cheap.
- The dataset contains public book catalog information only. No personal data of any individual (buyer, reviewer, or bookstore staff) is collected.

### Why this one

- **One record per book with its ISBN.** `isbn`, `author`, `publisher`, `bookFormat` and `numberOfPages` are separate fields.
- **Prices and stock.** `price`, `currency` and `inStock` for every book, ready for price tracking.

### Pricing

Pay per result: **$2.00 per 1,000 books**, plus $0.00005 per run start. For example, 100 books cost about $0.20. You only pay for the books you receive, and platform usage is included in that price.

### Run it from your code

JavaScript:

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('bibian/casadellibro-books-scraper').call({
  maxItems: 50,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

Python:

```python
from apify_client import ApifyClient

client = ApifyClient(token="<APIFY_TOKEN>")
run = client.actor("bibian/casadellibro-books-scraper").call(run_input={
    "maxItems": 50
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
```

### Frequently asked questions

**Do I need an account, cookies or a proxy for Casa del Libro?** No. The actor reads publicly visible pages only.

**How do I track book prices?** Schedule a daily run with Apify Schedules and compare `price` and `inStock` for the same `isbn` between runs.

**Which formats can I export?** JSON, CSV, Excel, XML, HTML table or RSS, from the dataset page or through the API.

**Can I connect it to Make, Zapier, n8n or Google Sheets?** Yes, through Apify integrations and webhooks.

**Is it legal to scrape?** The actor collects publicly visible book data and respects the robots.txt rules of the site. How you use the data is your responsibility: check the site's terms and the laws that apply to you, for example the GDPR.

**Something does not work?** Open an issue in the Issues tab. Every public actor is test-run daily and the broken ones are repaired.

**Did this save you time?** A short review on the Store page helps other people find the actor, and tells me what to improve next.

### More data scrapers by the same author

- [ALDI Australia Scraper (Prices & Specials)](https://apify.com/bibian/aldi-australia-products-scraper)
- [Precios Claros Argentina Supermarket Prices Scraper](https://apify.com/bibian/preciosclaros-prices-scraper)
- [Motor.es Used Cars Scraper (Spain)](https://apify.com/bibian/motor-es-cars-scraper)

# Actor input Schema

## `maxItems` (type: `integer`):

The run stops once this many books are saved.

## Actor input object example

```json
{
  "maxItems": 50
}
```

# Actor output Schema

## `books` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("bibian/casadellibro-books-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("bibian/casadellibro-books-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call bibian/casadellibro-books-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bibian/casadellibro-books-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/aezpTkhF93Yvgeggk/builds/nvfuvJpyQDF5NceuY/openapi.json
