PoetryDB API

⭐ Beginner's Pick Books / No Auth Required Beginner HTTPS CORS
Free to Use Varies (check documentation)

Overview

PoetryDB serves a curated collection of classic English poems via a simple REST API—searchable by author, title, or first line. No authentication or rate limiting to worry about.

💡

Beginner Tip

The URL pattern is the API itself: https://poetrydb.org/{field}/{search-term}. Try https://poetrydb.org/author/Shakespeare to get all Shakespeare poems as JSON immediately.

Available Data

PoetryDB data via REST API
JSON-formatted response data
Freely accessible without authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from PoetryDB",
    "description": "Enables you to get instant data from our vast poetry collection",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

title Title of the poem.
author Name of the poet.
lines Array of strings where each element is one line of the poem.
linecount Total number of lines in the poem as a string.

Implementation Example

const url = "https://github.com/thundercomb/poetrydb";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

"404" or empty array response Author name or title not in the PoetryDB collection, or spelling mismatch
Fetch https://poetrydb.org/author to get the full list of available authors first, then use an exact name from that list.
Response contains "Poem not found" object The search term matched no entries
PoetryDB returns a JSON object with "reason" when nothing matches—check for this key in your response handling before accessing poem fields.
Line breaks lost in display The "lines" field is an array of strings, not a pre-formatted block
Join the "lines" array with "\n" (newline) to reconstruct the poem: poem.lines.join("\n").

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 20/20
🔒 Security 15/15
🛠 Developer XP 20/20
✓ Reliability 7/15
Response Time 39ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Books
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →