Nspxt Literary Excerpts API

Access random literary excerpts from Project Gutenberg's extensive collection of public domain books

Random Excerpts

Get random literary excerpts from classic books in the public domain, perfect for inspiration or education.

Powerful Filtering

Filter excerpts by author, genre, or time period to find content that matches your needs.

Rich Metadata

Each excerpt comes with detailed metadata including book title, author, publication year, and more.

How It Works

1. Make an API Request

GET /api/random-excerpt

Send a request to our API endpoint to get a random excerpt. You can add filters to get more specific results.

2. Get JSON Response

Receive a well-structured JSON response containing the excerpt and rich metadata about the source.

3. Use in Your Application

Integrate literary content into your applications, websites, or creative projects with ease.

Example Response
{
  "excerpt": "It was the best of times, it was the worst of times, it was the age of wisdom...",
  "metadata": {
    "book_id": 98,
    "title": "A Tale of Two Cities",
    "author": "Charles Dickens",
    "publication_year": 1859,
    "language": "eng",
    "genres": ["Historical Fiction", "French Revolution"]
  },
  "attribution": "Excerpt from A Tale of Two Cities by Charles Dickens, provided by Nspxt",
  "gutenberg_url": "https://www.gutenberg.org/ebooks/98"
}

Example API Requests

Get a random excerpt from any book
GET /api/random-excerpt

Returns a random excerpt from any book in the database.

Try it
Get an excerpt from a specific author
GET /api/random-excerpt?author=Shakespeare

Returns a random excerpt from works by Shakespeare.

Try it
Filter by time period
GET /api/random-excerpt?year_from=1800&year_to=1850

Returns a random excerpt from books published between 1800 and 1850.

Try it
List available genres
GET /api/genres

Returns a list of all available genres with book counts.

Try it

Ready to Get Started?

Explore our comprehensive API documentation to learn more about how to integrate Nspxt literary excerpts into your applications.

View API Documentation

About Project Gutenberg

Project Gutenberg is a volunteer effort to digitize and archive cultural works, founded in 1971 by Michael S. Hart. It's the oldest digital library and offers over 60,000 free ebooks, with a focus on older works for which U.S. copyright has expired.

All excerpts provided by this API come from books in the public domain in the United States. Please respect copyright laws in your country when using this content.

Visit Project Gutenberg