Random Poem API

Retrieve a random poem by many famous authors. You can filter poem's by length (number of lines).

Make sure to read about the best art APIs to supplement your app.

GET
https://api.apileague.com/retrieve-random-poem

Parameters

NameExampleDescription
min-lines
n o q
5The minimum number of lines of the poem.
max-lines
n o q
20The maximum number of lines of the poem.
api-key
s r q
abcd1234Your API key.
Example Request and Response
GET
https://api.apileague.com/retrieve-random-poem?min-lines=10&max-lines=20
{
    "title": "Purpose",
    "author": "Amos Russel Wells",
    "poem": "Deeply and long the sap must flow\nEre the merest layer of elm can grow.\n\nMany a wave's recurrent shock\nIs needed to smooth the tiniest rock.\n\nThousands of leaves must fade and fall\nTo make the mold by the garden wall.\n\nThus, as the patient seasons roll,\nSlowly is fashioned a human soul.\n\nPurpose and failure and purpose still,\nSteadily moved by a quiet will,—\n\nLayer on layer in sturdy way,\nHardly seen the growth of a day,—\n\nTimes of failure and fear and fall,\nBut one strong tendency through it all,—\n\nGod and purpose and sun by sun\nReach the stars before they are done!\nFor I know the plans I have for you,” declares the Lord, “plans to prosper you and not to harm you, plans to give you hope and a future"
}
 Copy Codecurl -X GET 'https://api.apileague.com/retrieve-random-poem?min-lines=10&max-lines=20' \ -H 'x-api-key: myapikey'

Headers

Response Headers:

  • Content-Type: application/json
  • X-API-Quota-Request: The number of tokens used by the request
  • X-API-Quota-Used: The number of tokens used in total today
  • X-API-Quota-Left: The number of tokens left today (depends on your plan)

Frequently Asked Questions

Can I filter poems by length?

Yes, you can specify a minimum and maximum number of lines to retrieve poems that fit your desired length.

Are the poems by famous authors?

The database includes poems from many famous and classic authors, as well as some lesser-known ones.

Does it return the full text of the poem?

Yes, the API returns the full content of the poem along with the title and the author's name.

How is the Random Poem API different from the Random Quote API?

The Random Poem API returns complete poems or significant excerpts, whereas the Random Quote API returns short, memorable statements or citations.

Questions? Need Help? Ask Away

Quotas

Calling this endpoint costs
1 token