Poetry Foundation API: Get poem by title
Finds a poem on Poetry Foundation by title (optionally by poet) and returns its full public text, poet, printed source, publication year and subject tags.
Unofficial. Not affiliated with or endorsed by Poetry Foundation.
Inputs
Values from the run on Oct 31, 2026, shown under Output.
- Poet optional
poet The poet’s name to distinguish poems with the same title, for example Robert Frost.
Rudyard Kipling
- Title, required
title The title of the poem, for example The Road Not Taken.
If—
Input as JSON
{ "poet": "Rudyard Kipling", "title": "If—"}Output
{ "poet": "Rudyard Kipling", "tags": [ "Farewells & Good Luck", "Graduation", "Stanza Forms > Rhymed Stanza" ], "text": "If you can keep your head when all about you\n Are losing theirs and blaming it on you,\nIf you can trust yourself when all men doubt you,\n But make allowance for their doubting too;\nIf you can wait and not be tired by waiting,\n Or being lied about, don’t deal in lies,\nOr being hated, don’t g…", "title": "If—", "source": "A Choice of Kipling's Verse (1943)", "themes": [ "Living > Coming of Age" ], "poem_link": "https://www.poetryfoundation.org/poems/46473/if---" , "poet_page_link": "https://www.poetryfoundation.org/poets/rudyard-kipling" , "publication_year": 1943}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"poetryfoundation.org/get_poem","input":{"poet":"Rudyard Kipling","title":"If—"}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "poetryfoundation.org/get_poem" , "input": { "poet": "Rudyard Kipling", "title": "If—" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "poetryfoundation.org/get_poem" , "input": { "poet": "Rudyard Kipling", "title": "If—" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run poetryfoundation.org/get_poem# with {"poet":"Rudyard Kipling","title":"If—"}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "title" ], "properties": { "poet": { "type": "string", "description": "The poet’s name to distinguish poems with the same title, for example Robert Frost." }, "title": { "type": "string", "description": "The title of the poem, for example The Road Not Taken." } }}Output schema
{ "type": "object", "required": [ "title", "poet", "text", "source", "publication_year", "themes", "tags", "poet_page_link", "poem_link" ], "properties": { "poet": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "Occasions, poetic terms, emotions, and other category labels listed for the poem." }, "text": { "type": "string", "description": "Full poem text, with its line and stanza breaks." }, "title": { "type": "string" }, "source": { "type": [ "string", "null" ], "description": "Printed source citation, if shown on the poem page." }, "themes": { "type": "array", "items": { "type": "string" }, "description": "Subject categories listed for the poem." }, "poem_link": { "type": "string" }, "poet_page_link": { "type": [ "string", "null" ] }, "publication_year": { "type": [ "integer", "null" ], "description": "Year appearing in the printed source, if shown." } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
poetryfoundation.org/get_poem- Returns
- title, poet, full text, source, publication year, themes, tags, poet page link, poem link
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method poetryfoundation.org/get_poem with the inputs above.
Ask your agent
- Pull up the full text of "Ozymandias" by Percy Bysshe Shelley along with where it was first printed and the year.
- I need the complete poem "We Real Cool" by Gwendolyn Brooks from Poetry Foundation, plus its subject tags and a link to the poem page.
- What themes and tags are attached to Elizabeth Bishop's "One Art"? Also give me the text and the original source it appeared in.
- Find "Wild Geese" by Mary Oliver on poetryfoundation.org and give me the poem text, publication year, and a link to her poet page.
- Can you get me the words to "Do not go gentle into that good night"? I think it's Dylan Thomas, and I'd like to know when it was published.
See more
All Poetry Foundation methodsFinds poems matching a topic or occasion, or poems by a named poet, in Poetry Foundation search order. Older magazine poems without public text have no first two lines; untagged poems have no themes or occasions.
poetryfoundation.org/search_poemsGets the plain text of a public-domain Project Gutenberg book by title, optionally matching its author and language. Chooses the most downloaded matching edition with a plain-text file, removes the Gutenberg header and license, and can cut the text after a chosen number of words.
gutenberg.org/get_book_textGets a book's catalog details from Open Library by its title, with an optional author or ISBN to identify the right book. Reading availability reflects listed editions; details may be missing when the catalog has none.
openlibrary.org/get_bookFinds free public-domain Project Gutenberg books by title, author or topic, with authors, languages, subjects, recent downloads, and reading and download links. Public-domain status is based on the United States.
gutenberg.org/search_free_booksLooks up a Google Books book by title or ISBN. Returns its details, reader ratings and the Google Play ebook offer in a chosen country.
books.google.com/get_bookLooks up an audiobook in an Audible store by title (optionally narrowed by author) or by Audible book link, and returns its details, narrators, length, rating, visitor price, series, publisher summary and whether that store's Plus Catalog includes it.
audible.com/get_audiobookGets the full PubMed abstract and publication details for one article by title, PubMed link, or PubMed number (PMID). A title is searched in PubMed titles first and must closely match a found article. Some articles have no abstract or free full text.
pubmed.ncbi.nlm.nih.gov/get_articleFinds a Discogs release by title, artist or release link and returns its edition details, tracks, community counts, current price and sold price statistics.
discogs.com/get_release