Project Gutenberg Metadata API

This API provides a simple way to retrieve metadata about books from Project Gutenberg in JSON format.

API Endpoint

The API has a single endpoint that accepts a book ID and returns metadata about that book.

Request

GET /?id={book_id}

Where {book_id} is the Project Gutenberg book ID.

Example

GET /?id=1342

This will return metadata for "Pride and Prejudice" by Jane Austen (book ID 1342).

Response

The API returns a JSON object with the following fields (when available):

  • id: The Project Gutenberg book ID
  • title: The title of the book
  • author: The author of the book
  • publicationDate: The publication date
  • language: The language of the book
  • subjects: An array of subject categories
  • downloadLinks: Links to download the book in various formats
  • source: Link to the original Project Gutenberg page

Error Responses

  • 400 Bad Request: Missing or invalid book ID
  • 404 Not Found: Book with the specified ID not found
  • 500 Internal Server Error: Server-side error

Examples

Example Request

GET /?id=1342

Example Response

{ "id": "1342", "source": "https://www.gutenberg.org/ebooks/1342", "title": "Pride and Prejudice", "author": "Austen, Jane", "publicationDate": "1998-06-01", "language": "English", "subjects": [ "England -- Fiction", "Courtship -- Fiction", "Young women -- Fiction", "Love stories", "Domestic fiction", "Sisters -- Fiction", "Social classes -- Fiction" ], "downloadLinks": { "html": "https://www.gutenberg.org/files/1342/1342-h/1342-h.htm", "text": "https://www.gutenberg.org/files/1342/1342.txt", "epub": "https://www.gutenberg.org/ebooks/1342.epub.images", "kindle": "https://www.gutenberg.org/ebooks/1342.kindle.images" } }

Notes

  • This API scrapes data from Project Gutenberg's website and may break if their site structure changes
  • Results are cached for 24 hours to reduce load on Project Gutenberg's servers
  • Please be respectful of Project Gutenberg's resources and don't make excessive requests