• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
aleaf

aleaf

Gutenberg

Public
Like
Gutenberg
Home
Code
2
README.md
H
gutenberg-metadata.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
gutenberg-metadata.ts
https://aleaf--83d3ab5a34ea11f088969e149126039e.web.val.run
README.md

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
HTTP
  • gutenberg-metadata.ts
    aleaf--83…9e.web.val.run
Code
README.md
H
gutenberg-metadata.ts
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.