# PDF to Audiobook — Text to Speech for PDF, EPUB, DOCX & Web (`tidydata/pdf-to-audiobook`) Actor

Turn PDF, EPUB, DOCX, TXT files and web articles into natural-sounding audiobooks (MP3 or M4B with chapters) with Kokoro AI voices. English, Spanish, French, Italian, Portuguese, Hindi. Bulk text to speech from datasets. No API key needed.

- **URL**: https://apify.com/tidydata/pdf-to-audiobook.md
- **Developed by:** [tidydata](https://apify.com/tidydata) (community)
- **Categories:** AI, For creators, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $24.00 / 1,000 audio minutes

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 🎧 PDF to Audiobook — Text to Speech for PDF, EPUB, DOCX & web articles

![Real runs: an EPUB in Spanish, a novel in plain text, a Wikipedia article and Word files turned into MP3 and M4B audiobooks with chapters, read by Kokoro AI voices](https://api.apify.com/v2/key-value-stores/UJXqVadHhfb2eqS2e/records/pdf-to-audiobook.png)

**Turn any document into a natural-sounding audiobook.** Give it a PDF, EPUB, Word file, text, Markdown or the link of a web article and get back an **MP3 or M4B audiobook with chapter marks**, read by **Kokoro**, one of the best open text-to-speech AI models (Apache-2.0). English (US & UK), Spanish, French, Italian, Brazilian Portuguese and Hindi, 38 voices.

**$0.03 per minute of audio** — **$1.80 per hour**, no start fee, no subscription. No subscription, no API key, no account at any TTS service. Failed and skipped documents are free.

- ✅ **PDF, EPUB, DOCX, ODT, RTF, TXT, Markdown, HTML** files and **web articles** (main text only: menus, ads and comments are left out)
- ✅ **Chapters** from the book's own table of contents (EPUB, PDF bookmarks, Word headings, Markdown headings, "Chapter 1" lines) → **chapter marks** in the MP3/M4B and, if you want, **one file per chapter**
- ✅ **Clean reading**: page numbers, running headers and footers, hyphenated line breaks, footnote marks, links and Project Gutenberg licence text are removed before reading
- ✅ **M4B audiobook** for Apple Books and audiobook apps, with the **EPUB cover** as artwork, title and author
- ✅ **38 Kokoro voices**, female or male, adjustable **speed** (0.5×–2×), language detected automatically
- ✅ **Bulk text to speech**: a list of texts, or a **text column of another Actor's dataset** (articles, posts, product descriptions) → one audio file per row, billed by total length
- ✅ The **exact text that was read** is saved as a .txt (free), so you can check it
- ✅ **Google Docs, Google Drive, Dropbox, OneDrive** links, file uploads, a key-value store, or a dataset of links
- ✅ Ready for **n8n, Make, Zapier, the API and AI agents**: every file comes back as a download link that works without a token

### What can I use it for?

| You want… | Settings |
|---|---|
| **Listen to a PDF or ebook** on the go (study notes, reports, papers, novels) | MP3 or M4B · Female or male · speed 1.0–1.2 |
| An **audiobook of your own book** (self-publishing draft, beta readers) | M4B · one file per chapter |
| **Learn a language** with graded readers in Spanish, French, Italian or Portuguese | Language set · speed 0.85–0.9 |
| **Audio versions of blog posts** or newsletters | Article links or a dataset of a scraper · MP3 |
| **Voice-overs and narration** for videos, e-learning, product descriptions | Texts list · one file per text |
| **Accessibility**: read documents aloud for people with dyslexia or low vision | Any document · speed to taste |

### How to use it

1. Paste one or more **document links** (or upload files, or write the text).
2. Choose the **voice** (female/male or a named voice) and the **format** (MP3 or M4B).
3. Run it and open the **Results** tab: one row per document with the audiobook link, its chapters and duration.

Input example (API, n8n, Make):

```json
{
  "fileUrls": ["https://example.com/my-book.epub", "https://docs.google.com/document/d/DOC_ID/edit"],
  "voice": "female",
  "outputFormat": "m4b",
  "chapterFiles": true,
  "speed": 1.0
}
```

Bulk text to speech from another Actor's dataset:

```json
{ "datasetId": "DATASET_ID", "datasetTextField": "text", "datasetNameField": "title", "voice": "male" }
```

### Output example

```json
{
  "status": "ok",
  "documentType": "epub",
  "title": "Alice's Adventures in Wonderland",
  "author": "Lewis Carroll",
  "language": "en-us",
  "voice": "af_heart",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/…/records/alice.m4b?signature=…",
  "duration": "02:21:40",
  "chapterCount": 12,
  "chapters": [{"number": 1, "title": "Chapter I. Down the Rabbit-Hole", "startSec": 0, "durationSec": 668.2}],
  "textUrl": "https://api.apify.com/v2/key-value-stores/…/records/alice-read-text.txt?signature=…",
  "characters": 141303,
  "chargedEvents": {"audio-minute": 142}
}
```

### Pricing

Pay only for the audio you get, **per started minute**: **$0.03 / minute**, everything included: chapter files, the text file, the cover and all formats are included. Examples: a 10-page article (~12 min) = **$0.36**; a 300-page novel (~9 h) = **about $16**.

- **Bulk texts** are billed by their **total** length in the run, not one minute each: 100 short product descriptions of 10 seconds = 17 minutes = $0.51.
- **Failed or skipped documents are never charged**, and every document is checked against your maximum cost per run **before** it is read.
- Faster speed = shorter audio = cheaper.

### Voices and languages

| Language | Female (default) | Male (default) | More voices |
|---|---|---|---|
| English (US) | Heart | Michael | Bella, Nicole, Aoede, Kore, Sarah, Nova, Sky · Fenrir, Puck, Echo, Eric, Liam, Onyx, Adam |
| English (UK) | Emma | George | Isabella, Alice, Lily · Fable, Lewis, Daniel |
| Spanish | Dora | Alex | Santa (male) |
| French | Siwis | — | |
| Italian | Sara | Nicola | |
| Portuguese (Brazil) | Dora | Alex | Santa (male) |
| Hindi | Alpha | Omega | Beta · Psi |

The language is taken from the book's metadata or detected from the text; you can also set it. Any voice can read any of these languages (with its own accent).

### Speed

The voice runs on CPU, faster than real time. With the default **4 GB of memory**, **one hour of audio takes about 40–65 minutes** (it depends on how busy Apify's servers are); with **16 GB about twice as fast** (two voices read in parallel). **The price per minute is the same at any memory.** The default timeout is 4 hours, enough for about 4 hours of audio at 4 GB: for a long novel use 16 GB and/or a longer timeout (the Actor tells you before starting if a document can't finish in time, free). Documents are read one after another.

### Limits and good to know

- **Scanned PDFs** (images without a text layer) can't be read: run them through an OCR tool first, e.g. [PDF Text Extractor](https://apify.com/tidydata/pdf-image-text-extractor), and pass the text.
- **DRM-protected ebooks** (Kindle, Adobe DRM) are refused. Old .doc files: save as .docx or PDF.
- Links to YouTube, TikTok, Instagram, Facebook, X and other social platforms are refused. Read only documents you have the right to turn into audio.
- Pages that need JavaScript or a login can't be read as articles: download the file and upload it.
- Safety limits (all adjustable): 1,500,000 characters (~28 h) per document, 2,000 PDF pages, 200 MB per file, 100 documents per run.
- Numbers, dates and abbreviations are read by the voice's own rules; tables and code blocks are skipped.

### FAQ

**How good are the voices?** Kokoro-82M topped the open TTS Arena leaderboard among open models when it came out; it sounds natural for long listening. It is not a clone of any real person's voice.

**Can I sell the audiobook?** Kokoro is Apache-2.0, so the audio is yours to use commercially; the rights to the *text* are the author's. Some stores (e.g. ACX/Audible) have their own rules about AI narration — check them.

**Will it read the footnotes, page numbers and headers?** No: page numbers, repeated headers/footers and footnote marks are removed, and EPUB footnotes are skipped. The saved .txt shows exactly what was read.

**Is my document kept?** Files are stored in your own Apify storage only, under your account's data retention.

### Related Actors

- [PDF Text Extractor — PDF & Image to Text OCR](https://apify.com/tidydata/pdf-image-text-extractor) — get the text out of scanned PDFs first
- [Audio & Video Transcription](https://apify.com/tidydata/audio-video-transcription) — the other way round: speech to text
- [Audio Noise Remover](https://apify.com/tidydata/audio-noise-remover) — clean your own voice recordings

Questions or a document that fails? Open an issue on the **Issues** tab: we answer quickly.

# Actor input Schema

## `fileUrls` (type: `array`):

One link per line: PDF, EPUB, DOCX, ODT, RTF, TXT or Markdown files, Google Docs / Google Drive / Dropbox / OneDrive share links, or any web article (its main text is read, menus and ads are left out). Each document becomes one audiobook. DRM-protected ebooks and scanned PDFs without text are not supported (free).

## `uploadedFiles` (type: `array`):

Upload PDF, EPUB, DOCX, TXT… files from your computer (they go to a key-value store of your account and only this run reads them).

## `texts` (type: `array`):

Each line/item is read aloud into its own audio file (bulk text to speech). Paste a whole article as one item; Markdown headings (# Title) become chapters.

## `language` (type: `string`):

Language of the text: it decides the pronunciation and the default voice.

## `voice` (type: `string`):

'Female' / 'Male' pick the best Kokoro voice for the detected language. A named voice reads any language with its own accent.

## `speed` (type: `number`):

1 = natural pace (about 150 words per minute in English). 0.9 for learners, 1.2-1.3 for fast listening. You pay per minute of the result, so faster = cheaper.

## `outputFormat` (type: `string`):

Chapter marks come from the book's table of contents (EPUB, PDF bookmarks, Word headings, Markdown headings). EPUB covers are embedded as artwork.

## `chapterFiles` (type: `boolean`):

Besides the full audiobook, return each chapter as its own MP3 (or the chosen format). Included in the price.

## `readChapterTitles` (type: `boolean`):

Say each chapter's title before it, with a short pause.

## `readTitle` (type: `boolean`):

Starts with e.g. 'Alice's Adventures in Wonderland. By Lewis Carroll.' when the document has them.

## `saveText` (type: `boolean`):

A .txt with exactly what the voice read (after removing page numbers, headers, footnote marks, links). Free.

## `embedCover` (type: `boolean`):

Use the ebook's cover as the audiobook artwork (MP3 / M4B / M4A).

## `bitrateKbps` (type: `integer`):

Mono speech: 64 kbps is clear and small (≈ 28 MB per hour); 96-128 for archiving.

## `maxCharactersPerDocument` (type: `integer`):

Reading stops after about this many characters (1,500,000 ≈ 28 hours of audio), so a huge file by mistake can't run up a big bill. A novel is 300,000-600,000.

## `maxPagesPerPdf` (type: `integer`):

Only the first pages are read beyond this.

## `maxDocuments` (type: `integer`):

Stop after this many documents (links, texts, dataset rows together).

## `maxFileSizeMb` (type: `integer`):

Bigger files are not downloaded (free).

## `keyValueStoreId` (type: `string`):

Read aloud the documents saved in one of your key-value stores (keys ending in .pdf, .epub, .docx, .txt…). Only read access to this one store is requested.

## `keyValueStoreKeys` (type: `array`):

Record keys to read. Empty = every document record of the store (up to 'Max documents').

## `datasetId` (type: `string`):

A dataset from another run: each row's text field is read aloud into its own file (e.g. articles, posts, product descriptions), and/or its document links are turned into audiobooks. Only read access to this one dataset is requested.

## `datasetTextField` (type: `string`):

Field holding the text to read (nested paths work: article.body). One audio file per row.

## `datasetUrlFields` (type: `string`):

Field name(s), comma separated, holding links to PDF/EPUB/DOCX files or articles.

## `datasetNameField` (type: `string`):

Optional: name each audio file after this field (e.g. title, id).

## Actor input object example

```json
{
  "fileUrls": [
    "https://api.apify.com/v2/key-value-stores/zCfleofV9kYG6liyw/records/sample-book.epub"
  ],
  "language": "auto",
  "voice": "female",
  "speed": 1,
  "outputFormat": "mp3",
  "chapterFiles": false,
  "readChapterTitles": true,
  "readTitle": true,
  "saveText": true,
  "embedCover": true,
  "bitrateKbps": 64,
  "maxCharactersPerDocument": 1500000,
  "maxPagesPerPdf": 2000,
  "maxDocuments": 100,
  "maxFileSizeMb": 200
}
```

# Actor output Schema

## `results` (type: `string`):

One row per document: download link of the audiobook, chapters with start times, duration, language, voice, status and the reason when it failed.

## `files` (type: `string`):

Every audio and text file made in the run.

# 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 = {
    "fileUrls": [
        "https://api.apify.com/v2/key-value-stores/zCfleofV9kYG6liyw/records/sample-book.epub"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tidydata/pdf-to-audiobook").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 = { "fileUrls": ["https://api.apify.com/v2/key-value-stores/zCfleofV9kYG6liyw/records/sample-book.epub"] }

# Run the Actor and wait for it to finish
run = client.actor("tidydata/pdf-to-audiobook").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 '{
  "fileUrls": [
    "https://api.apify.com/v2/key-value-stores/zCfleofV9kYG6liyw/records/sample-book.epub"
  ]
}' |
apify call tidydata/pdf-to-audiobook --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tidydata/pdf-to-audiobook"
        }
    }
}
```

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/xf6LtkSO6bX75swJN/builds/Pc1czMhaDaFMJ6QGH/openapi.json
