{
  "openapi": "3.1.0",
  "info": {
    "title": "Public Domain Books API",
    "version": "1.0.0",
    "description": "All 78,037 Project Gutenberg ebooks in 56 languages with full-text search and download links.\n\nThe world's free library, searchable. The complete Project Gutenberg catalog — 78,037 public-domain ebooks in 56 languages — with full-text search over titles, authors AND Library of Congress subjects ('pride and prejudice' → Gutenberg #1342; 'detective fiction' → 1,190 books), author and language filters (Jules Verne in French: 47 works), parsed display authors ('Austen, Jane, 1775-1817' becomes 'Jane Austen'), subjects, LoC classes and curated bookshelves. Every book ships with ready-to-use links: the Gutenberg landing page, plain-text and EPUB downloads, and a cover image — all from Gutenberg's stable cache layout (verified live). A random endpoint (optionally per language) powers book-of-the-day features, and detail responses include more works by the same author (Moby Dick → Typee, and the rest of Melville). Reading apps, e-ink devices, education platforms, language-learning tools, literary games and AI training corpora — the classics, one API call away.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/books.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/books"
  },
  "servers": [
    {
      "url": "https://api-books.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Entertainment",
      "description": "Public Domain Books API belongs to the Entertainment category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/books/{id}": {
      "get": {
        "operationId": "bookDetail",
        "summary": "Book Detail",
        "description": "Book Detail endpoint of the Public Domain Books API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/books/book-detail"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2701"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "book": {
                    "id": 2701,
                    "title": "Moby Dick; Or, The Whale",
                    "authors": "Melville, Herman, 1819-1891",
                    "first_author": "Herman Melville",
                    "language": "en",
                    "issued": "2001-07-01",
                    "subjects": "Whaling -- Fiction; Sea stories; Psychological fiction; Ship captains -- Fiction; Adventure stories; Mentally ill -- Fiction; Ahab, Captain (Fictitious character) -- Fiction; Whales -- Fiction; Whaling ships -- Fiction",
                    "locc": "PS",
                    "bookshelves": "Best Books Ever Listings; Category: Adventure; Category: Novels; Category: Classics of Literature; Category: American Literature",
                    "links": {
                      "gutenberg_url": "https://www.gutenberg.org/ebooks/2701",
                      "text": "https://www.gutenberg.org/cache/epub/2701/pg2701.txt",
                      "epub": "https://www.gutenberg.org/cache/epub/2701/pg2701-images.epub",
                      "cover": "https://www.gutenberg.org/cache/epub/2701/pg2701.cover.medium.jpg"
                    }
                  },
                  "more_by_author": [
                    {
                      "id": 15,
                      "title": "Moby-Dick; or, The Whale",
                      "language": "en"
                    },
                    {
                      "id": 1900,
                      "title": "Typee: A Romance of the South Seas",
                      "language": "en"
                    },
                    {
                      "id": 2489,
                      "title": "Moby Dick; Or, The Whale",
                      "language": "en"
                    },
                    {
                      "id": 2694,
                      "title": "I and My Chimney",
                      "language": "en"
                    },
                    {
                      "id": 4045,
                      "title": "Omoo: Adventures in the South Seas",
                      "language": "en"
                    },
                    {
                      "id": 8118,
                      "title": "Redburn. His First Voyage Being the Sailor Boy Confessions and Reminiscences of the Son-Of-A-Gentleman in the Merchant Navy",
                      "language": "en"
                    },
                    {
                      "id": 10712,
                      "title": "White Jacket; Or, The World on a Man-of-War",
                      "language": "en"
                    },
                    {
                      "id": 11231,
                      "title": "Bartleby, the Scrivener: A Story of Wall-Street",
                      "language": "en"
                    },
                    {
                      "id": 12384,
                      "title": "Battle-Pieces and Aspects of the War",
                      "language": "en"
                    },
                    {
                      "id": 12841,
                      "title": "John Marr and Other Poems",
                      "language": "en"
                    }
                  ],
                  "note": "Download links are constructed from Gutenberg's stable cache layout; a rare title may lack a given format."
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/sources": {
      "get": {
        "operationId": "dataSources",
        "summary": "Data Sources",
        "description": "Data Sources endpoint of the Public Domain Books API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/books/data-sources"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "sources": [
                    {
                      "slug": "gutenberg",
                      "name": "Project Gutenberg catalog",
                      "publisher": "Project Gutenberg",
                      "licence": "public domain works; metadata feed",
                      "source_url": "https://www.gutenberg.org/",
                      "file_url": "https://www.gutenberg.org/cache/epub/feeds/pg_catalog.csv.gz",
                      "cadence": "catalog feed regenerated daily; occasional re-scrape",
                      "record_count": 78037,
                      "retrieved_at": "2026-09-06"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/books/random": {
      "get": {
        "operationId": "randomBook",
        "summary": "Random Book",
        "description": "Random Book endpoint of the Public Domain Books API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/books/random-book"
        },
        "parameters": [
          {
            "name": "language",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "es"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "book": {
                    "id": 48946,
                    "title": "Gloria (novela completa)",
                    "authors": "Pérez Galdós, Benito, 1843-1920",
                    "first_author": "Benito Pérez Galdós",
                    "language": "es",
                    "issued": "2015-05-12",
                    "subjects": "Spain -- Fiction; Catholic Church -- Spain -- Clergy -- Fiction",
                    "locc": "PQ",
                    "bookshelves": "Category: Novels",
                    "links": {
                      "gutenberg_url": "https://www.gutenberg.org/ebooks/48946",
                      "text": "https://www.gutenberg.org/cache/epub/48946/pg48946.txt",
                      "epub": "https://www.gutenberg.org/cache/epub/48946/pg48946-images.epub",
                      "cover": "https://www.gutenberg.org/cache/epub/48946/pg48946.cover.medium.jpg"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/books": {
      "get": {
        "operationId": "searchBooks",
        "summary": "Search Books",
        "description": "Search Books endpoint of the Public Domain Books API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/books/search-books"
        },
        "parameters": [
          {
            "name": "author",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "1"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "pride and prejudice"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "page": 1,
                  "limit": 5,
                  "total": 3,
                  "total_pages": 1,
                  "books": [
                    {
                      "id": 1342,
                      "title": "Pride and Prejudice",
                      "authors": "Austen, Jane, 1775-1817",
                      "first_author": "Jane Austen",
                      "language": "en",
                      "issued": "1998-06-01",
                      "subjects": "England -- Fiction; Young women -- Fiction; Love stories; Sisters -- Fiction; Domestic fiction; Courtship -- Fiction; Social classes -- Fiction",
                      "locc": "PR",
                      "bookshelves": "Best Books Ever Listings; Harvard Classics; Category: Romance; Category: Novels; Category: Classics of Literature; Category: British Literature",
                      "links": {
                        "gutenberg_url": "https://www.gutenberg.org/ebooks/1342",
                        "text": "https://www.gutenberg.org/cache/epub/1342/pg1342.txt",
                        "epub": "https://www.gutenberg.org/cache/epub/1342/pg1342-images.epub",
                        "cover": "https://www.gutenberg.org/cache/epub/1342/pg1342.cover.medium.jpg"
                      }
                    },
                    {
                      "id": 42671,
                      "title": "Pride and Prejudice",
                      "authors": "Austen, Jane, 1775-1817; Chapman, R. W. (Robert William), 1881-1960 [Editor]",
                      "first_author": "Jane Austen",
                      "language": "en",
                      "issued": "2013-05-09",
                      "subjects": "England -- Fiction; Young women -- Fiction; Love stories; Sisters -- Fiction; Domestic fiction; Courtship -- Fiction; Social classes -- Fiction",
                      "locc": "PR",
                      "bookshelves": "Best Books Ever Listings; Category: Romance; Category: Novels; Category: Classics of Literature; Category: British Literature",
                      "links": {
                        "gutenberg_url": "https://www.gutenberg.org/ebooks/42671",
                        "text": "https://www.gutenberg.org/cache/epub/42671/pg42671.txt",
                        "epub": "https://www.gutenberg.org/cache/epub/42671/pg42671-images.epub",
                        "cover": "https://www.gutenberg.org/cache/epub/42671/pg42671.cover.medium.jpg"
                      }
                    },
                    {
                      "id": 37431,
                      "title": "Pride and Prejudice, a play founded on Jane Austen's novel",
                      "authors": "MacKaye, Steele, Mrs., 1845-1924; Austen, Jane, 1775-1817",
                      "first_author": "Steele MacKaye",
                      "language": "en",
                      "issued": "2011-09-15",
                      "subjects": "England -- Drama; Courtship -- Drama; Young women -- Drama; Social classes -- Drama; Domestic drama; Sisters -- Drama; Bennet, Elizabeth (Fictitious character) -- Drama",
                      "locc": "PR",
                      "bookshelves": "Category: Plays/Films/Dramas; Category: British Literature",
                      "links": {
                        "gutenberg_url": "https://www.gutenberg.org/ebooks/37431",
                        "text": "https://www.gutenberg.org/cache/epub/37431/pg37431.txt",
                        "epub": "https://www.gutenberg.org/cache/epub/37431/pg37431-images.epub",
                        "cover": "https://www.gutenberg.org/cache/epub/37431/pg37431.cover.medium.jpg"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 1 token per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}