# Project Gutenberg Ebook Scraper (Gutendex) (`jungle_synthesizer/gutenberg-gutendex-public-domain-ebook-scraper`) Actor

Scrape the full Project Gutenberg catalog via the Gutendex JSON API. Filter by search, language, subject, author era, and download count. Returns EPUB, Kindle, plain-text, and HTML download URLs — built for AI training corpora, NLP datasets, and TTS pipelines.

- **URL**: https://apify.com/jungle\_synthesizer/gutenberg-gutendex-public-domain-ebook-scraper.md
- **Developed by:** [BowTiedRaccoon](https://apify.com/jungle_synthesizer) (community)
- **Categories:** AI, Education
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Project Gutenberg Ebook Scraper (Gutendex)

Scrape the full [Project Gutenberg](https://www.gutenberg.org/) public-domain catalog via the [Gutendex JSON API](https://gutendex.com/). Filter by search query, language, subject, author era, and minimum download count. Returns book metadata with direct EPUB, Kindle, plain-text, and HTML download URLs — built for AI training corpora, NLP datasets, and TTS pipelines.

### What does this actor do?

Project Gutenberg hosts over 78,000 public-domain books that are legally free to download and use, including for commercial AI/ML training. This actor paginates the entire catalog through the Gutendex API — the official REST wrapper — and delivers clean, structured records with:

- **Full text download URLs**: direct links to `.txt`, `.epub`, `.mobi`, and `.html` versions
- **Rich metadata**: authors with birth/death years, translators, subjects, bookshelves, and language codes
- **Copyright status flag**: `"true"`/`"false"`/`null` — essential for corpus licensing decisions
- **30-day download count**: a proxy for public interest and training-set priority

Every record is a flat JSON object with no nested arrays — ready to pipe into a vector database, fine-tuning pipeline, or document store.

### Use cases

- **LLM training corpora**: bulk-fetch plain-text URLs for thousands of public-domain works in a target language
- **NLP datasets**: filter by subject headings (e.g. `Philosophy`, `Science Fiction`) for domain-specific datasets
- **TTS pipelines**: filter by language code (`en`, `fr`, `de`, `ja`) and pull plain-text URLs for audio synthesis
- **Academic research**: enumerate works by author era using `authorYearStart`/`authorYearEnd`
- **Digital library projects**: mirror metadata for discovery interfaces

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `maxItems` | integer | *(required)* | Maximum number of books to return. Omit to fetch the full catalog (~78,000 books). |
| `search` | string | *(empty)* | Free-text search across titles, authors, and subjects. |
| `languages` | string | *(empty)* | Comma-separated ISO 639-1 codes, e.g. `en,fr,de`. Leave blank for all languages. |
| `topic` | string | *(empty)* | Topic or subject keyword filter, e.g. `science fiction`. |
| `authorYearStart` | integer | *(empty)* | Return only books whose authors were born after this year. |
| `authorYearEnd` | integer | *(empty)* | Return only books whose authors were born before this year. |
| `minDownloadCount` | integer | `0` | Return only books with at least this many 30-day downloads. |
| `sortBy` | string | `popular` | `popular` (most downloaded first) or `ascending` (by Gutenberg ID). |

**Minimal run** — top 10 most popular books:
```json
{ "maxItems": 10 }
````

**French classic literature** — authors born before 1900:

```json
{ "maxItems": 500, "languages": "fr", "authorYearEnd": 1900, "sortBy": "popular" }
```

**Full corpus, high-demand English books only**:

```json
{ "languages": "en", "minDownloadCount": 100 }
```

### Output

Each result is a flat JSON object:

```json
{
    "gutenbergId": "1342",
    "title": "Pride and Prejudice",
    "authors": "Austen, Jane",
    "authorBirthYears": "1775",
    "authorDeathYears": "1817",
    "translators": "",
    "subjects": "Domestic fiction | England -- Social life and customs -- 19th century -- Fiction | Love stories",
    "bookshelves": "Best Books Ever Listings | Harvard Classics",
    "languages": "en",
    "copyright": "false",
    "mediaType": "Text",
    "downloadCount": "52793",
    "coverImageUrl": "https://www.gutenberg.org/cache/epub/1342/pg1342.cover.medium.jpg",
    "epubUrl": "https://www.gutenberg.org/ebooks/1342.epub3.images",
    "kindleUrl": "https://www.gutenberg.org/ebooks/1342.kf8.images",
    "textPlainUrl": "https://www.gutenberg.org/ebooks/1342.txt.utf-8",
    "htmlUrl": "https://www.gutenberg.org/ebooks/1342.html.images",
    "gutendexUrl": "https://gutendex.com/books/1342/",
    "scrapedAt": "2026-05-29T02:00:00.000Z"
}
```

| Field | Description |
|-------|-------------|
| `gutenbergId` | Project Gutenberg numeric ID (as string) |
| `title` | Full book title |
| `authors` | Pipe-separated author names in `Last, First` format |
| `authorBirthYears` | Pipe-separated birth years (same order as authors) |
| `authorDeathYears` | Pipe-separated death years |
| `translators` | Pipe-separated translator names |
| `subjects` | Pipe-separated Library of Congress subject headings |
| `bookshelves` | Pipe-separated Gutenberg category tags |
| `languages` | Pipe-separated ISO 639-1 language codes |
| `copyright` | `"true"` / `"false"` / `null` |
| `mediaType` | Typically `"Text"` |
| `downloadCount` | 30-day download count (as string) |
| `coverImageUrl` | Direct URL to cover image (JPEG) |
| `epubUrl` | Direct URL to EPUB file |
| `kindleUrl` | Direct URL to Kindle (MOBI) file |
| `textPlainUrl` | Direct URL to plain-text `.txt` file |
| `htmlUrl` | Direct URL to HTML version |
| `gutendexUrl` | Gutendex API URL for this specific record |
| `scrapedAt` | ISO-8601 scrape timestamp |

### Performance and cost

- **No proxy required**: Gutendex is a free public API with no authentication or IP restrictions.
- **Rate limiting**: No documented cap. The actor uses a 300ms inter-page delay as a courtesy.
- **Memory**: 256 MB is sufficient for any run size.
- **Full catalog run**: ~78,000 books across ~2,500 pages at 32 books/page.
- **PPE pricing**: charged per result record via the standard profile.

### Notes

- Gutendex occasionally responds slowly (10-30 seconds per page). The actor uses a 90-second timeout with automatic retries — transient slowness does not cause failures.
- The `copyright: "false"` flag indicates the work is in the public domain in the United States. Verify licensing for your specific jurisdiction and use case before commercial use.
- Download URLs point directly to the `gutenberg.org` CDN. The actor does not download the book files themselves — it returns the URLs for downstream processing.

# Actor input Schema

## `sp_intended_usage` (type: `string`):

What will this data feed? E.g. lead lists, KYB checks, price tracking.

## `sp_improvement_suggestions` (type: `string`):

Provide any feedback or suggestions for improvements.

## `sp_contact` (type: `string`):

We'll personally help with your use case. No spam.

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

Maximum number of books to return. Leave empty to scrape the full catalog (~78 000 books).

## `search` (type: `string`):

Optional free-text search query (title, author, or subject keywords). Leave blank to fetch the entire catalog.

## `languages` (type: `string`):

Comma-separated ISO 639-1 language codes to filter by (e.g. "en,fr,de"). Leave blank for all languages.

## `topic` (type: `string`):

Topic or subject keyword to filter results (e.g. "science fiction"). Maps to Gutendex ?topic= param.

## `authorYearStart` (type: `integer`):

Return only books whose authors were born after this year.

## `authorYearEnd` (type: `integer`):

Return only books whose authors were born before this year.

## `minDownloadCount` (type: `integer`):

Return only books with at least this many downloads.

## `sortBy` (type: `string`):

Sort order for results: "popular" (most downloaded first) or "ascending" (by ID). Default is "popular".

## Actor input object example

```json
{
  "sp_intended_usage": "Describe your intended use...",
  "sp_improvement_suggestions": "Share your suggestions here...",
  "sp_contact": "Share your email here...",
  "maxItems": 10,
  "sortBy": "popular"
}
```

# Actor output Schema

## `results` (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 = {
    "sp_intended_usage": "Describe your intended use...",
    "sp_improvement_suggestions": "Share your suggestions here...",
    "sp_contact": "Share your email here...",
    "maxItems": 10,
    "search": "",
    "languages": "",
    "topic": "",
    "minDownloadCount": 0,
    "sortBy": "popular"
};

// Run the Actor and wait for it to finish
const run = await client.actor("jungle_synthesizer/gutenberg-gutendex-public-domain-ebook-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 = {
    "sp_intended_usage": "Describe your intended use...",
    "sp_improvement_suggestions": "Share your suggestions here...",
    "sp_contact": "Share your email here...",
    "maxItems": 10,
    "search": "",
    "languages": "",
    "topic": "",
    "minDownloadCount": 0,
    "sortBy": "popular",
}

# Run the Actor and wait for it to finish
run = client.actor("jungle_synthesizer/gutenberg-gutendex-public-domain-ebook-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "sp_intended_usage": "Describe your intended use...",
  "sp_improvement_suggestions": "Share your suggestions here...",
  "sp_contact": "Share your email here...",
  "maxItems": 10,
  "search": "",
  "languages": "",
  "topic": "",
  "minDownloadCount": 0,
  "sortBy": "popular"
}' |
apify call jungle_synthesizer/gutenberg-gutendex-public-domain-ebook-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=jungle_synthesizer/gutenberg-gutendex-public-domain-ebook-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Project Gutenberg Ebook Scraper (Gutendex)",
        "description": "Scrape the full Project Gutenberg catalog via the Gutendex JSON API. Filter by search, language, subject, author era, and download count. Returns EPUB, Kindle, plain-text, and HTML download URLs — built for AI training corpora, NLP datasets, and TTS pipelines.",
        "version": "0.1",
        "x-build-id": "Y6t6UR8ETzdB5OpKE"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/jungle_synthesizer~gutenberg-gutendex-public-domain-ebook-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-jungle_synthesizer-gutenberg-gutendex-public-domain-ebook-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/jungle_synthesizer~gutenberg-gutendex-public-domain-ebook-scraper/runs": {
            "post": {
                "operationId": "runs-sync-jungle_synthesizer-gutenberg-gutendex-public-domain-ebook-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/jungle_synthesizer~gutenberg-gutendex-public-domain-ebook-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-jungle_synthesizer-gutenberg-gutendex-public-domain-ebook-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "maxItems"
                ],
                "properties": {
                    "sp_intended_usage": {
                        "title": "What is the intended usage of this data?",
                        "minLength": 1,
                        "type": "string",
                        "description": "What will this data feed? E.g. lead lists, KYB checks, price tracking."
                    },
                    "sp_improvement_suggestions": {
                        "title": "How can we improve this crawler for you?",
                        "minLength": 1,
                        "type": "string",
                        "description": "Provide any feedback or suggestions for improvements."
                    },
                    "sp_contact": {
                        "title": "Contact email (optional)",
                        "minLength": 1,
                        "type": "string",
                        "description": "We'll personally help with your use case. No spam."
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "type": "integer",
                        "description": "Maximum number of books to return. Leave empty to scrape the full catalog (~78 000 books)."
                    },
                    "search": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "Optional free-text search query (title, author, or subject keywords). Leave blank to fetch the entire catalog."
                    },
                    "languages": {
                        "title": "Languages",
                        "type": "string",
                        "description": "Comma-separated ISO 639-1 language codes to filter by (e.g. \"en,fr,de\"). Leave blank for all languages."
                    },
                    "topic": {
                        "title": "Topic / Subject Filter",
                        "type": "string",
                        "description": "Topic or subject keyword to filter results (e.g. \"science fiction\"). Maps to Gutendex ?topic= param."
                    },
                    "authorYearStart": {
                        "title": "Author Birth Year Start",
                        "type": "integer",
                        "description": "Return only books whose authors were born after this year."
                    },
                    "authorYearEnd": {
                        "title": "Author Birth Year End",
                        "type": "integer",
                        "description": "Return only books whose authors were born before this year."
                    },
                    "minDownloadCount": {
                        "title": "Minimum Download Count",
                        "type": "integer",
                        "description": "Return only books with at least this many downloads."
                    },
                    "sortBy": {
                        "title": "Sort By",
                        "enum": [
                            "popular",
                            "ascending"
                        ],
                        "type": "string",
                        "description": "Sort order for results: \"popular\" (most downloaded first) or \"ascending\" (by ID). Default is \"popular\"."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
