# Poetry Foundation API

> Poetry Foundation returns poem texts and search results as a workflow and API.

Poetry Foundation (PF) Get poem returns public poem text and details; it needs a title and optionally a poet. Search poems returns matching poems with titles, poets, available opening lines, and themes or occasions; it needs a topic, occasion, or poet name.

- Page: https://fous.com/workflows/poetry-foundation
- Handle: `@poetry-foundation`
- Category: [Education](https://fous.com/workflows/category/education)
- Source website: https://poetryfoundation.org
- Last verified: Sep 29, 2026
- Fous is not affiliated with Poetry Foundation.

## Methods

### Get poem

Operation `get_poem`, version 1. 1 credit per call.

Get a poem’s complete public text, poet, source, publication year when shown, and subject tags by title. Optionally specify a poet to distinguish identical titles. Only poems with full text on a public Poetry Foundation page are returned; source and year may be unavailable.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `poet` | string | no | `"Robert Frost"` | The poet’s name to distinguish poems with the same title, for example Robert Frost. |
| `title` | string | yes | `"The Road Not Taken"` | The title of the poem, for example The Road Not Taken. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "title"
  ],
  "properties": {
    "poet": {
      "type": "string",
      "description": "The poet’s name to distinguish poems with the same title, for example Robert Frost.",
      "examples": [
        "Robert Frost",
        "Erika L. Sánchez",
        "Rudyard Kipling"
      ]
    },
    "title": {
      "type": "string",
      "description": "The title of the poem, for example The Road Not Taken.",
      "examples": [
        "The Road Not Taken",
        "Prodigal Daughter",
        "If—"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "poet": "Robert Frost",
      "title": "The Road Not Taken"
    },
    {
      "poet": "Erika L. Sánchez",
      "title": "Prodigal Daughter"
    },
    {
      "poet": "Rudyard Kipling",
      "title": "If—"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `poet` | string | `"Robert Frost"` |  |
| `tags` | array |  | Occasions, poetic terms, emotions, and other category labels listed for the poem. |
| `text` | string |  | Full poem text, with its line and stanza breaks. |
| `title` | string | `"The Road Not Taken"` |  |
| `source` | string or null | `"Poetry (June 2024)"` | Printed source citation, if shown on the poem page. |
| `themes` | array |  | Subject categories listed for the poem. |
| `poem_link` | string | `"https://www.poetryfoundation.org/poems/44272/the-road-not-taken"` |  |
| `poet_page_link` | string or null | `"https://www.poetryfoundation.org/poets/robert-frost"` |  |
| `publication_year` | integer or null | `2024` | Year appearing in the printed source, if shown. |

**Example input**

```json
{
  "poet": "Robert Frost",
  "title": "The Road Not Taken"
}
```

**Example output**

```json
{
  "poet": "Robert Frost",
  "tags": [
    "Graduation",
    "Stanza Forms > Rhymed Stanza"
  ],
  "text": "Two roads diverged in a yellow wood,\nAnd sorry I could not travel both\nAnd be one traveler, long I stood\nAnd looked down one as far as I could\nTo where it bent in the undergrowth;\n\nThen took the other…",
  "title": "The Road Not Taken",
  "source": null,
  "themes": [
    "Activities > Travels & Journeys"
  ],
  "poem_link": "https://www.poetryfoundation.org/poems/44272/the-road-not-taken",
  "poet_page_link": "https://www.poetryfoundation.org/poets/robert-frost",
  "publication_year": null
}
```

### Search poems

Operation `search_poems`, version 1. 1 credit per call.

Find 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.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `query` | string | yes | `"wedding"` | Topic, occasion, or poet name, for example grief, wedding, or Mary Oliver. |
| `max_results` | integer | no | `35` | Maximum number of poems to return, for example 20 (up to 50). |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Topic, occasion, or poet name, for example grief, wedding, or Mary Oliver.",
      "examples": [
        "wedding",
        "grief",
        "zzzxxyyqqqnotapoem"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 50,
      "minimum": 1,
      "description": "Maximum number of poems to return, for example 20 (up to 50).",
      "x-fous-developer": true,
      "examples": [
        35,
        5
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "query": "wedding",
      "max_results": 35
    },
    {
      "query": "grief"
    },
    {
      "query": "zzzxxyyqqqnotapoem"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `poems` | array |  |  |
| `poems[].poet` | string or null | `"Matthew Dickman"` |  |
| `poems[].title` | string | `"Grief"` |  |
| `poems[].poem_link` | string | `"https://www.poetryfoundation.org/poems/150394/grief-5d0c057c36f0c"` |  |
| `poems[].first_two_lines` | string or null | `"When grief comes to you as a purple gorilla\nyou must count yourself lucky."` | The first two available lines, separated by a newline; null if the poem text is not published. |
| `poems[].themes_or_occasions` | array |  |  |

**Example input**

```json
{
  "query": "grief"
}
```

**Example output**

```json
{
  "poems": [
    {
      "poet": "Matthew Dickman",
      "title": "Grief",
      "poem_link": "https://www.poetryfoundation.org/poems/150394/grief-5d0c057c36f0c",
      "first_two_lines": "When grief comes to you as a purple gorilla\nyou must count yourself lucky.",
      "themes_or_occasions": [
        "Living",
        "The Mind",
        "Death & Dying"
      ]
    },
    {
      "poet": "Barbara Crooker",
      "title": "Grief",
      "poem_link": "https://www.poetryfoundation.org/poems/88766/grief-56e86db5ba0be",
      "first_two_lines": "is a river you wade in until you get to the other side.\nBut I am here, stuck in the middle, water parting",
      "themes_or_occasions": [
        "Nature",
        "Living",
        "Bodies of Water"
      ]
    },
    {
      "poet": "Elizabeth Barrett Browning",
      "title": "Grief",
      "poem_link": "https://www.poetryfoundation.org/poems/47646/grief-56d2283e927df",
      "first_two_lines": "I tell you, hopeless grief is passionless;\nThat only men incredulous of despair,",
      "themes_or_occasions": [
        "Living",
        "Death & Dying",
        "Mourning"
      ]
    }
  ]
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@poetry-foundation",
  "visibility": "public",
  "operation": "get_poem",
  "version": 1,
  "input": {
    "poet": "Robert Frost",
    "title": "The Road Not Taken"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@poetry-foundation\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_poem\",\n  \"version\": 1,\n  \"input\": {\n    \"poet\": \"Robert Frost\",\n    \"title\": \"The Road Not Taken\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@poetry-foundation",
  "visibility": "public",
  "operation": "get_poem",
  "version": 1,
  "input": {
    "poet": "Robert Frost",
    "title": "The Road Not Taken"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@poetry-foundation","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Find poems about a topic or occasion
- Browse poems by a named poet
- Retrieve a poem’s full public text
- Review poem themes and occasions
- Check a poem’s source and publication year when shown

## FAQ

### Is Fous affiliated with Poetry Foundation?

No. Fous is not affiliated with Poetry Foundation. This workflow reads the public poetryfoundation.org website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a Poetry Foundation account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from poetryfoundation.org when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### How can I find poems about a topic?

Search poems finds matching poems by topic or occasion.

### How can I find poems by a poet?

Search poems finds poems matching a poet’s name.

### How can I retrieve a poem’s full text?

Get poem returns the full public text when you provide its title; you can add a poet to distinguish identical titles.

## Related

- [BrainyQuote API](https://fous.com/workflows/brainyquote.md): BrainyQuote returns topic-matched quotes in displayed order, a person’s description and up to 100 quotes with topic tags and links, or the quote shown for the chosen daily category and BrainyQuote’s current day.
- [Project Gutenberg API](https://fous.com/workflows/project-gutenberg.md): Project Gutenberg offers free public-domain ebooks and reading materials, with searchable book details and plain text from the most-downloaded matching edition available.
- [Open Library API](https://fous.com/workflows/open-library.md): Open Library returns book search results, catalog details, and author works; availability reflects listed editions, not current loan availability, and catalog details may be missing.
- [Wikipedia API](https://fous.com/workflows/wikipedia.md): Wikipedia returns article summaries, images, facts, relevant search matches, readable text and daily historical events, plus human-view counts from July 2015 onward.
- [Goodreads API](https://fous.com/workflows/goodreads.md): Goodreads returns public book searches, matched-book details with variable editions, popular or newest reviews, author books by popularity or date, and up to 100 quotes.
- [Quran.com API](https://fous.com/workflows/quran-com.md): Quran.com provides Quran reading and search: up to 50 verses with Arabic and translations, optional transliteration, and only the first 50 verses of longer passages.
- [Bible Gateway API](https://fous.com/workflows/bible-gateway.md): Bible Gateway provides passage readings up to one chapter, searches returning up to 100 related verses, and a daily verse that may differ by date or translation availability.
- [PubMed API](https://fous.com/workflows/pubmed.md): PubMed searches medical and life-science articles by topic and retrieves one article’s abstract and publication details; abstracts and free full-text links may be unavailable.
- [All Education workflows](https://fous.com/workflows/category/education)
