The Poetry API provides access to a database of poems based on author, title, or randomly selected poems.
"https://openapi-idk8.onrender.com"
GET `/poetry/author/:author`
Description: Retrieves poems by a specific author.
Parameters:
[
{
"title": "A Lover's Complaint",
"author": "William Shakespeare",
"lines": [
"FROM off a hill whose concave womb reworded",
"A plaintful story from a sistering vale,",
"My spirits to attend this double voice accorded,",
"And down I laid to list the sad-tuned tale;",
"Ere long espied a fickle maid full pale,",
"Tearing of papers, breaking rings a-twain,",
"Storming her world with sorrow's wind and rain.",
...
"linecount": "6"
]
}
]
GET `https://openapi-idk8.onrender.com/poetry/title/blue`
Description: Retrieves poems by a specific title.
Parameters:
[
{
"title": "I noticed People disappeared",
"author": "Emily Dickinson",
"lines": [
"I noticed People disappeared",
"When but a little child --",
"Supposed they visited remote",
"Or settled Regions wild --",
"But did because they died",
"A Fact withheld the little child --"
],
...
"linecount": "6"
}
]
GET `https://openapi-idk8.onrender.com/poetry/random`
Description: Retrieves a random poem from the database.
[
{
"title": "Random Poem",
"author": "Unknown",
"lines": [
"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"Pellentesque nec justo in nisi efficitur congue.",
...
"linecount": "6"
]
}
]
500 Internal Server Error: Returned when there's an issue fetching poetry from the server.
Response Body:
{
"error": "Failed to fetch poetry"
}