# Project Gutenberg API

> Project Gutenberg returns public-domain book listings and plain text as a workflow and API.

Project Gutenberg (Gutenberg) Search free books finds books by required title, author, or topic, with optional language and sorting. Get book text returns a book’s plain text by required title, with optional author, language, and word limit.

- Page: https://fous.com/workflows/project-gutenberg
- Handle: `@project-gutenberg`
- Category: [Education](https://fous.com/workflows/category/education)
- Source website: https://gutenberg.org
- Last verified: Sep 29, 2026
- Fous is not affiliated with Project Gutenberg.

## Methods

### Get book text

Operation `get_book_text`, version 1. 1 credit per call.

Get the plain text of a public-domain Project Gutenberg book by title, optionally matching its author and language. Chooses the most downloaded matching edition with a plain-text file; removes Gutenberg notices and can cut the text after a chosen number of words.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `title` | string | yes | `"Pride and Prejudice"` | Book title, for example Pride and Prejudice. |
| `author` | string | no | `"Jane Austen"` | Author name to distinguish books, for example Jane Austen. |
| `language` | string | no | `"French"` | Book language, for example English or French. |
| `max_words` | integer | no | `600000` | Maximum number of words to include in the returned text, for example 200000. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "title"
  ],
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1,
      "description": "Book title, for example Pride and Prejudice.",
      "examples": [
        "Pride and Prejudice",
        "War and Peace",
        "Candide"
      ]
    },
    "author": {
      "type": "string",
      "description": "Author name to distinguish books, for example Jane Austen.",
      "examples": [
        "Jane Austen",
        "Leo Tolstoy",
        "Voltaire"
      ]
    },
    "language": {
      "type": "string",
      "default": "English",
      "description": "Book language, for example English or French.",
      "examples": [
        "French"
      ]
    },
    "max_words": {
      "type": "integer",
      "default": 200000,
      "maximum": 600000,
      "minimum": 1,
      "description": "Maximum number of words to include in the returned text, for example 200000.",
      "examples": [
        600000,
        300
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "title": "Pride and Prejudice",
      "author": "Jane Austen"
    },
    {
      "title": "War and Peace",
      "author": "Leo Tolstoy",
      "max_words": 600000
    },
    {
      "title": "Candide",
      "author": "Voltaire",
      "language": "French",
      "max_words": 300
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `title` | string | `"Candide, ou l'optimisme"` | Book title. |
| `author` | string | `"Voltaire"` | Book author. |
| `language` | string | `"French"` | Book language. |
| `book_text` | string |  | Book text with Project Gutenberg header and license footer removed. |
| `ebook_number` | integer | `4650` | Project Gutenberg ebook number. |
| `release_date` | string | `"2003-11-01"` | Project Gutenberg release date. |
| `text_was_cut` | boolean | `true` | Whether the returned text was shortened to max_words. |
| `book_page_link` | string | `"https://www.gutenberg.org/ebooks/4650"` | Project Gutenberg book page. |
| `total_word_count` | integer | `34080` | Words in the full cleaned text before cutting. |

**Example input**

```json
{
  "title": "Candide",
  "author": "Voltaire",
  "language": "French",
  "max_words": 300
}
```

**Example output**

```json
{
  "title": "Candide, ou l'optimisme",
  "author": "Voltaire",
  "language": "French",
  "book_text": "OEUVRES\r\n\r\nDE\r\n\r\nVOLTAIRE.\r\n\r\nTOME XXXIII\r\n\r\nDE L’ IMPRIMERIE DE A. FIRMIN DIDOT,\r\n\r\n\r\nRUE JACOB, Nº 24.\r\n\r\nOEUVRES\r\n\r\nDE\r\n\r\nVOLTAIRE\r\n\r\nPRÉFACES, AVERTISSEMENTS, NOTES, ETC.\r\n\r\nPAR M. BEUCHOT.\r\n\r\nTOM…",
  "ebook_number": 4650,
  "release_date": "2003-11-01",
  "text_was_cut": true,
  "book_page_link": "https://www.gutenberg.org/ebooks/4650",
  "total_word_count": 34080
}
```

### Search free books

Operation `search_free_books`, version 1. 1 credit per call.

Find free public-domain Project Gutenberg books by title, author, or topic, with authors, languages, subjects, recent downloads, and reading and download links. Public-domain status is based on the United States.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `sort` | string | no | `"newest"` | Sort by popularity, newest release, or title; for example popular. |
| `query` | string | yes | `"Jane Austen"` | Book title, author, or topic, for example Sherlock Holmes. |
| `language` | string | no | `"French"` | Language name or two-letter code, for example French or fr; default any. |
| `max_results` | integer | no | `5` | Maximum number of books to return, for example 20; at most 100. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "sort": {
      "enum": [
        "popular",
        "newest",
        "title"
      ],
      "type": "string",
      "default": "popular",
      "description": "Sort by popularity, newest release, or title; for example popular.",
      "examples": [
        "newest",
        "title"
      ]
    },
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Book title, author, or topic, for example Sherlock Holmes.",
      "examples": [
        "Jane Austen",
        "xzxzqwyarandomnobooktitle",
        "Sherlock Holmes"
      ]
    },
    "language": {
      "type": "string",
      "default": "any",
      "description": "Language name or two-letter code, for example French or fr; default any.",
      "examples": [
        "French"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum number of books to return, for example 20; at most 100.",
      "x-fous-developer": true,
      "examples": [
        5,
        30
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "sort": "newest",
      "query": "Jane Austen",
      "language": "French",
      "max_results": 5
    },
    {
      "query": "xzxzqwyarandomnobooktitle"
    },
    {
      "query": "Sherlock Holmes"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `books` | array |  |  |
| `books[].title` | string | `"Raison et sensibilité, ou les deux manières d'aimer (Tome 4)"` |  |
| `books[].authors` | array |  |  |
| `books[].subjects` | array |  |  |
| `books[].languages` | array |  |  |
| `books[].ebook_number` | integer | `37634` |  |
| `books[].book_page_link` | string | `"https://www.gutenberg.org/ebooks/37634"` |  |
| `books[].cover_image_link` | string or null | `"https://www.gutenberg.org/cache/epub/37634/pg37634.cover.medium.jpg"` |  |
| `books[].read_online_link` | string or null | `"https://www.gutenberg.org/cache/epub/37634/pg37634-images.html"` |  |
| `books[].epub_download_link` | string or null | `"https://www.gutenberg.org/ebooks/37634.epub3.images"` |  |
| `books[].downloads_last_30_days` | integer or null | `385` |  |
| `books[].plain_text_download_link` | string or null | `"https://www.gutenberg.org/ebooks/37634.txt.utf-8"` |  |

**Example input**

```json
{
  "sort": "newest",
  "query": "Jane Austen",
  "language": "French",
  "max_results": 5
}
```

**Example output**

```json
{
  "books": [
    {
      "title": "Raison et sensibilité, ou les deux manières d'aimer (Tome 4)",
      "authors": [
        {
          "name": "Austen, Jane",
          "birth_year": 1775,
          "death_year": 1817
        }
      ],
      "subjects": [
        "England -- Social life and customs -- 19th century -- Fiction",
        "Inheritance and succession -- Fiction"
      ],
      "languages": [
        "French"
      ],
      "ebook_number": 37634,
      "book_page_link": "https://www.gutenberg.org/ebooks/37634",
      "cover_image_link": "https://www.gutenberg.org/cache/epub/37634/pg37634.cover.medium.jpg",
      "read_online_link": "https://www.gutenberg.org/cache/epub/37634/pg37634-images.html",
      "epub_download_link": "https://www.gutenberg.org/ebooks/37634.epub3.images",
      "downloads_last_30_days": 385,
      "plain_text_download_link": "https://www.gutenberg.org/ebooks/37634.txt.utf-8"
    },
    {
      "title": "Persuasion",
      "authors": [
        {
          "name": "Austen, Jane",
          "birth_year": 1775,
          "death_year": 1817
        }
      ],
      "subjects": [
        "England -- Social life and customs -- 19th century -- Fiction",
        "Psychological fiction"
      ],
      "languages": [
        "French"
      ],
      "ebook_number": 36777,
      "book_page_link": "https://www.gutenberg.org/ebooks/36777",
      "cover_image_link": "https://www.gutenberg.org/cache/epub/36777/pg36777.cover.medium.jpg",
      "read_online_link": "https://www.gutenberg.org/cache/epub/36777/pg36777-images.html",
      "epub_download_link": "https://www.gutenberg.org/ebooks/36777.epub3.images",
      "downloads_last_30_days": 698,
      "plain_text_download_link": "https://www.gutenberg.org/ebooks/36777.txt.utf-8"
    }
  ]
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@project-gutenberg",
  "visibility": "public",
  "operation": "get_book_text",
  "version": 1,
  "input": {
    "title": "Pride and Prejudice",
    "author": "Jane Austen"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@project-gutenberg\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_book_text\",\n  \"version\": 1,\n  \"input\": {\n    \"title\": \"Pride and Prejudice\",\n    \"author\": \"Jane Austen\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@project-gutenberg",
  "visibility": "public",
  "operation": "get_book_text",
  "version": 1,
  "input": {
    "title": "Pride and Prejudice",
    "author": "Jane Austen"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@project-gutenberg","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Find books by title, author, or topic
- Filter book searches by language
- Compare recent book downloads
- Read book text for research
- Limit returned text to a chosen word count

## FAQ

### Is Fous affiliated with Project Gutenberg?

No. Fous is not affiliated with Project Gutenberg. This workflow reads the public gutenberg.org website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a Project Gutenberg account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from gutenberg.org when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### How can I find books by topic or author?

Search free books finds books by title, author, or topic, with optional language and sorting.

### Can I get the text of a book?

Get book text returns plain text by title, with optional author and language matching.

### Can I limit how much book text is returned?

Get book text can cut the returned text after a chosen maximum number of words.

## Related

- [Google Books API](https://fous.com/workflows/google-books.md): Google Books searches books and provides book details, reader ratings, and local ebook prices when available; newest results sort by publication date.
- [Open Library API](https://fous.com/workflows/open-library.md): Open Library returns book search results, catalog details, and author works; availability reflects listed editions, not current loan availability, and catalog details may be missing.
- [Goodreads API](https://fous.com/workflows/goodreads.md): Goodreads returns public book searches, matched-book details with variable editions, popular or newest reviews, author books by popularity or date, and up to 100 quotes.
- [OverDrive API](https://fous.com/workflows/overdrive.md): Find ebooks and audiobooks at public libraries.
- [Bible Gateway API](https://fous.com/workflows/bible-gateway.md): Bible Gateway provides passage readings up to one chapter, searches returning up to 100 related verses, and a daily verse that may differ by date or translation availability.
- [Britannica API](https://fous.com/workflows/britannica.md): Britannica returns public encyclopedia articles with introductions, quick facts, headings, update dates and images, plus search results with titles, descriptions, links and images when shown.
- [Audible API](https://fous.com/workflows/audible.md): Audible offers audiobooks, podcasts, and audio entertainment, with public book details and current bestselling audiobook charts; availability and categories vary by store.
- [Poetry Foundation API](https://fous.com/workflows/poetry-foundation.md): Poetry Foundation provides poems, poets, and poetry resources; poem searches follow its search order, while full text is limited to publicly available poems.
- [All Education workflows](https://fous.com/workflows/category/education)
