# Avatar API

> Bring Avatar: The Last Airbender into a workflow from the free, keyless Avatar API: its characters, with their nation, bending, portrait, allies and enemies; all 61 episodes, with their air dates and credits; and a bank of multiple-choice trivia questions. Look a character up by name or nickname, find every firebender, post what aired on this day, pick an episode for movie night, or run a daily trivia question with an answer checker that takes a letter or the words. The service's records are a scrape of the Avatar Wiki, with names missing and rows out of place, and they are put right here before anything is returned.

App · Film, TV & Fandom · 12 actions. Web page: https://docs.lodol.com/docs/integrations/avatar-api

## Actions

### Check a trivia answer

Mark a player's answer to a question and get the right one back. The answer can be the option's letter or its words, however they are capitalised: 'Fire Nation' answers 'the Fire Nation'. A wrong answer, one that picks out none of the options and no answer at all are all marked wrong rather than failing the step, so a quiz bot can reply to anything a player sends.

**Inputs**

- Question (`question_id`, number, required): The question being answered: the question_id a trivia step returned. The same number always means the same question, with its options in the same order.
- Answer (`answer`, text, required): The player's answer: the option's letter (B) or its words (the Fire Nation), however they are capitalised or punctuated. A word or two is enough when only one option contains it: 'comet' answers Sozin's comet.

**Outputs**

- `answer` (text)
- `correct` (true/false)
- `correct_answer` (text)
- `correct_letter` (text)
- `matched_letter` (text)
- `matched_option` (text)
- `message` (text)
- `question` (text)
- `question_id` (number)

**Example output**

```json
{
  "answer": "Fire Nation",
  "correct": true,
  "correct_answer": "the Fire Nation",
  "correct_letter": "B",
  "matched_letter": "B",
  "matched_option": "the Fire Nation",
  "message": "Correct: the answer is B) the Fire Nation.",
  "question": "\"Long ago, the four nations lived together in harmony. Then, everything changed when ________ attacked.\"",
  "question_id": 1
}
```

### Check service status

Check whether the Avatar API is answering, how quickly, and how much of the rate limit is left. This is the one action that reports a problem as a value instead of failing the step, so a workflow can decide what to do about it. Being throttled is reported separately from being down.

**Inputs**: None.

**Outputs**

- `message` (text)
- `online` (true/false)
- `rate_limit` (number)
- `rate_limit_remaining` (number)
- `rate_limited` (true/false)
- `reachable` (true/false)
- `response_time_ms` (number)
- `status_code` (number)

**Example output**

```json
{
  "message": "The Avatar API is up and serving the show.",
  "online": true,
  "rate_limit": 5000,
  "rate_limit_remaining": 4999,
  "rate_limited": false,
  "reachable": true,
  "response_time_ms": 96.2,
  "status_code": 200
}
```

### Find characters

Browse the characters, or just the ones you want: search their names, nicknames, titles and groups for a word, keep only one nation, or only the benders of one element, or only the non-benders. The service records neither a nation nor an element, so both are read off each character, which is what makes 'every firebender' one step. The number of characters matching is always reported, however many are returned.

**Inputs**

- Search for (`search`, text): A word to look for in the characters' names, their nicknames, their titles and the groups they belong to, 2 to 120 characters. Best match leads: a hit on a name outranks one on a nickname, which outranks one in a title. Leave empty to browse rather than search.
- Nation (`nation`, text): Only keep characters from one of the four nations. The service records no such field, so it is read off each character's ethnicity or homeland: Aang, Appa and Momo count as Air Nomads. Leave empty for all four. One of: `water_tribe` (Water Tribe), `earth_kingdom` (Earth Kingdom), `fire_nation` (Fire Nation), `air_nomads` (Air Nomads).
- Bending (`bending`, text): Only keep the benders of one element, or only the non-benders. The service records no such field either, so it is read off each character's fighting styles: bloodbending counts as water, metalbending as earth and lightning as fire, and Aang, the Avatar, counts for all four. Leave empty for everyone. One of: `water` (Waterbenders), `earth` (Earthbenders), `fire` (Firebenders), `air` (Airbenders), `none` (Non-benders).
- Order by (`sort`, text): How to order the characters. Ignored when you search, because a search is ordered by how well each character matches. Defaults to the service's own order, which puts the main cast first. One of: `listed` (Main cast first (the service's order)), `name` (Name, A to Z). Default: `listed`.
- Number of characters (`limit`, number): How many characters to return, from 1 to 100. Defaults to 25, which is more than the service holds, so leaving it alone returns everyone who matched. From 1 to 100. Default: `25`.

**Outputs**

- `bending` (text)
- `character_count` (number)
- `characters` (list)
- `collection_size` (number)
- `nation` (text)
- `requested_count` (number)
- `search` (text)
- `sort` (text)
- `total_matches` (number)

**Example output**

```json
{
  "bending": null,
  "character_count": 2,
  "characters": [
    {
      "affiliations": [
        "Ba Sing Se (formerly)",
        "Dai Li (formerly)"
      ],
      "ages": [],
      "allies": [
        "The Dai Li (formerly)",
        "Joo Dee (formerly)"
      ],
      "alternative_names": [],
      "bender": true,
      "bending": [
        "Earthbending"
      ],
      "bending_text": "Earthbending",
      "born": null,
      "character_id": 13,
      "died": null,
      "enemies": [
        "Team Avatar",
        "Azula",
        "Jet",
        "Kuei",
        "Earth Kingdom",
        "the Dai Li"
      ],
      "eye_color": "Black",
      "fighting_styles": [
        "Earthbending"
      ],
      "first_appearance": "\"City of Walls and Secrets\"",
      "gender": "Male",
      "hair_color": null,
      "image_url": "https://static.wikia.nocookie.net/avatar/images/8/8d/Long_Feng_scheming.png/revision/latest/scale-to-width-down/333?cb=20140510202422",
      "last_appearance": "\"The Crossroads of Destiny\" (actual) (chronological & release order); Ruins of the Empire Part Two (flashback)",
      "love_interests": [],
      "name": "Long Feng",
      "nation": "Earth Kingdom",
      "nationality": "Earth Kingdom",
      "positions": [
        "Earthbending master",
        "Grand Secretariat of Ba Sing Se (formerly)",
        "Head of the Dai Li (formerly)"
      ],
      "predecessors": [],
      "skin_color": null,
      "successors": [],
      "voiced_by": [],
      "weapons": [
        "Earth"
      ]
    },
    {
      "affiliations": [
        "Earth Kingdom",
        "Kyoshi Warriors",
        "Team Avatar"
      ],
      "ages": [],
      "allies": [
        "Kyoshi Warriors",
        "Oyaji",
        "Sokka",
        "Katara",
        "Aang",
        "Toph",
        "Zuko",
        "Appa",
        "Momo",
        "Mai",
        "Ty Lee",
        "Iroh",
        "Order of the White Lotus"
      ],
      "alternative_names": [],
      "bender": false,
      "bending": [],
      "bending_text": "Non-bender",
      "born": null,
      "character_id": 8,
      "died": null,
      "enemies": [
        "Ozai",
        "Azula",
        "the warden",
        "Fire Nation (formerly)",
        "Zuko (formerly)",
        "Ty Lee (formerly)"
      ],
      "eye_color": "Blue",
      "fighting_styles": [
        "Tessenjutsu",
        "chi blocking"
      ],
      "first_appearance": "\"The Warriors of Kyoshi\"",
      "gender": "Female",
      "hair_color": "Auburn",
      "image_url": "https://static.wikia.nocookie.net/avatar/images/1/14/Suki.png/revision/latest/scale-to-width-down/333?cb=20130819094354",
      "last_appearance": null,
      "love_interests": [
        "Sokka (boyfriend)"
      ],
      "name": "Suki",
      "nation": "Earth Kingdom",
      "nationality": "Earth Kingdom",
      "positions": [
        "Fire Nation prisoner (formerly)",
        "Kyoshi Warriors' leader",
        "Member of Team Avatar",
        "Fire Lord Zuko's guard"
      ],
      "predecessors": [],
      "skin_color": "Light",
      "successors": [],
      "voiced_by": [],
      "weapons": [
        "War fans",
        "katana"
      ]
    }
  ],
  "collection_size": 13,
  "nation": "earth_kingdom",
  "requested_count": 2,
  "search": null,
  "sort": "name",
  "total_matches": 3
}
```

### Find episodes

Browse all 61 episodes, or just the ones you want: one season, a search of the titles and credits, or the episodes first aired on a day of the year, for an 'on this day' post. Titles come without the quote marks the service wraps them in, and air dates as real dates. The number of episodes matching is always reported, however many are returned.

**Inputs**

- Search for (`search`, text): A word to look for in the episode titles and credits, 2 to 120 characters: a title word finds that episode, and a director's or a writer's name finds theirs. A hit on the title outranks one in the credits. Leave empty to browse rather than search.
- Season (`season`, text): Only keep one season. The show calls its seasons books, one for each element Aang has to learn. Leave empty for all three. One of: `1` (Book One: Water), `2` (Book Two: Earth), `3` (Book Three: Fire).
- First aired on the day of (`anniversary_of`, date): Only keep the episodes first aired on this day of the year, in any year. Give today's date for an 'on this day' post: on July 19 it finds all four parts of the finale. Leave empty for any day.
- Order by (`sort`, text): How to order the episodes. Ignored when you search, because a search is ordered by how well each episode matches. Defaults to the order they aired in. One of: `air_order` (In the order they aired), `newest_first` (Newest first), `title` (Title, A to Z). Default: `air_order`.
- Number of episodes (`limit`, number): How many episodes to return, from 1 to 100. Defaults to 25; the show has 61, so raise it to 61 to list them all. From 1 to 100. Default: `25`.

**Outputs**

- `anniversary_of` (text)
- `collection_size` (number)
- `episode_count` (number)
- `episodes` (list)
- `requested_count` (number)
- `search` (text)
- `season` (number)
- `sort` (text)
- `total_matches` (number)

**Example output**

```json
{
  "anniversary_of": "2026-07-19",
  "collection_size": 61,
  "episode_count": 4,
  "episodes": [
    {
      "air_date": "2008-07-19",
      "animated_by": "JM Animation",
      "book": "Book Three: Fire",
      "code": "S03E18",
      "directed_by": "Ethan Spaulding",
      "episode_id": 58,
      "number_in_season": 18,
      "production_code": "318",
      "season": 3,
      "title": "Sozin's Comet, Part 1: The Phoenix King",
      "viewers_millions": 5.59,
      "written_by": [
        "Michael Dante DiMartino"
      ],
      "written_by_text": "Michael Dante DiMartino"
    },
    {
      "air_date": "2008-07-19",
      "animated_by": "Moi Animation",
      "book": "Book Three: Fire",
      "code": "S03E19",
      "directed_by": "Giancarlo Volpe",
      "episode_id": 59,
      "number_in_season": 19,
      "production_code": "319",
      "season": 3,
      "title": "Sozin's Comet, Part 2: The Old Masters",
      "viewers_millions": 5.59,
      "written_by": [
        "Aaron Ehasz"
      ],
      "written_by_text": "Aaron Ehasz"
    },
    {
      "air_date": "2008-07-19",
      "animated_by": "JM Animation",
      "book": "Book Three: Fire",
      "code": "S03E20",
      "directed_by": "Joaquim Dos Santos",
      "episode_id": 60,
      "number_in_season": 20,
      "production_code": "320",
      "season": 3,
      "title": "Sozin's Comet, Part 3: Into the Inferno",
      "viewers_millions": 5.59,
      "written_by": [
        "Michael Dante DiMartino",
        "Bryan Konietzko"
      ],
      "written_by_text": "Michael Dante DiMartino and Bryan Konietzko"
    },
    {
      "air_date": "2008-07-19",
      "animated_by": "JM Animation",
      "book": "Book Three: Fire",
      "code": "S03E21",
      "directed_by": "Joaquim Dos Santos",
      "episode_id": 61,
      "number_in_season": 21,
      "production_code": "321",
      "season": 3,
      "title": "Sozin's Comet, Part 4: Avatar Aang",
      "viewers_millions": 5.59,
      "written_by": [
        "Michael Dante DiMartino",
        "Bryan Konietzko"
      ],
      "written_by_text": "Michael Dante DiMartino and Bryan Konietzko"
    }
  ],
  "requested_count": 25,
  "search": null,
  "season": null,
  "sort": "air_order",
  "total_matches": 4
}
```

### Get a character

Look up one character and get everything the service knows about them: their nation and bending, a portrait, nicknames, allies and enemies, titles, and who voiced them. Pick them from the list, or pass a name, a nickname or an id in from an earlier step: 'Mushi' finds Iroh, and a nickname two characters share comes back saying which rather than guessing. The service's records are a scrape of the Avatar Wiki with rows out of place; they are put back before anything is returned.

**Inputs**

- Character (`character`, text, required): The character to look up. Pick one from the list, or type a name, a nickname (Mushi, Twinkle Toes, The Blue Spirit) or the character_id an earlier step returned. A partial name works when only one character matches it.

**Outputs**

- `character` (object)
- `matched_on` (text)
- `requested_character` (text)

**Example output**

```json
{
  "character": {
    "affiliations": [
      "Earth Kingdom",
      "Kyoshi Warriors",
      "Team Avatar"
    ],
    "ages": [],
    "allies": [
      "Kyoshi Warriors",
      "Oyaji",
      "Sokka",
      "Katara",
      "Aang",
      "Toph",
      "Zuko",
      "Appa",
      "Momo",
      "Mai",
      "Ty Lee",
      "Iroh",
      "Order of the White Lotus"
    ],
    "alternative_names": [],
    "bender": false,
    "bending": [],
    "bending_text": "Non-bender",
    "born": null,
    "character_id": 8,
    "died": null,
    "enemies": [
      "Ozai",
      "Azula",
      "the warden",
      "Fire Nation (formerly)",
      "Zuko (formerly)",
      "Ty Lee (formerly)"
    ],
    "eye_color": "Blue",
    "fighting_styles": [
      "Tessenjutsu",
      "chi blocking"
    ],
    "first_appearance": "\"The Warriors of Kyoshi\"",
    "gender": "Female",
    "hair_color": "Auburn",
    "image_url": "https://static.wikia.nocookie.net/avatar/images/1/14/Suki.png/revision/latest/scale-to-width-down/333?cb=20130819094354",
    "last_appearance": null,
    "love_interests": [
      "Sokka (boyfriend)"
    ],
    "name": "Suki",
    "nation": "Earth Kingdom",
    "nationality": "Earth Kingdom",
    "positions": [
      "Fire Nation prisoner (formerly)",
      "Kyoshi Warriors' leader",
      "Member of Team Avatar",
      "Fire Lord Zuko's guard"
    ],
    "predecessors": [],
    "skin_color": "Light",
    "successors": [],
    "voiced_by": [],
    "weapons": [
      "War fans",
      "katana"
    ]
  },
  "matched_on": "name",
  "requested_character": "Suki"
}
```

### Get a random character

Pick one character at random, for a character spotlight, from everyone or from one nation or element. Different every call. Set a seed when two runs have to agree instead.

**Inputs**

- Nation (`nation`, text): Only keep characters from one of the four nations. The service records no such field, so it is read off each character's ethnicity or homeland: Aang, Appa and Momo count as Air Nomads. Leave empty for all four. One of: `water_tribe` (Water Tribe), `earth_kingdom` (Earth Kingdom), `fire_nation` (Fire Nation), `air_nomads` (Air Nomads).
- Bending (`bending`, text): Only keep the benders of one element, or only the non-benders. The service records no such field either, so it is read off each character's fighting styles: bloodbending counts as water, metalbending as earth and lightning as fire, and Aang, the Avatar, counts for all four. Leave empty for everyone. One of: `water` (Waterbenders), `earth` (Earthbenders), `fire` (Firebenders), `air` (Airbenders), `none` (Non-benders).
- Seed (`seed`, text): Any text you like. Two runs given the same seed make the same pick, which is what a test, a screenshot or a step that retries needs. Leave empty for a genuinely different pick each time.

**Outputs**

- `bending` (text)
- `character` (object)
- `nation` (text)
- `pool_size` (number)
- `seed` (text)

**Example output**

```json
{
  "bending": null,
  "character": {
    "affiliations": [
      "Ba Sing Se (formerly)",
      "Dai Li (formerly)"
    ],
    "ages": [],
    "allies": [
      "The Dai Li (formerly)",
      "Joo Dee (formerly)"
    ],
    "alternative_names": [],
    "bender": true,
    "bending": [
      "Earthbending"
    ],
    "bending_text": "Earthbending",
    "born": null,
    "character_id": 13,
    "died": null,
    "enemies": [
      "Team Avatar",
      "Azula",
      "Jet",
      "Kuei",
      "Earth Kingdom",
      "the Dai Li"
    ],
    "eye_color": "Black",
    "fighting_styles": [
      "Earthbending"
    ],
    "first_appearance": "\"City of Walls and Secrets\"",
    "gender": "Male",
    "hair_color": null,
    "image_url": "https://static.wikia.nocookie.net/avatar/images/8/8d/Long_Feng_scheming.png/revision/latest/scale-to-width-down/333?cb=20140510202422",
    "last_appearance": "\"The Crossroads of Destiny\" (actual) (chronological & release order); Ruins of the Empire Part Two (flashback)",
    "love_interests": [],
    "name": "Long Feng",
    "nation": "Earth Kingdom",
    "nationality": "Earth Kingdom",
    "positions": [
      "Earthbending master",
      "Grand Secretariat of Ba Sing Se (formerly)",
      "Head of the Dai Li (formerly)"
    ],
    "predecessors": [],
    "skin_color": null,
    "successors": [],
    "voiced_by": [],
    "weapons": [
      "Earth"
    ]
  },
  "nation": "earth_kingdom",
  "pool_size": 3,
  "seed": null
}
```

### Get a random episode

Pick one episode at random (the answer to 'what shall we watch tonight?') from the whole show or from one season. Different every call. Set a seed when two runs have to agree instead.

**Inputs**

- Season (`season`, text): Only keep one season. The show calls its seasons books, one for each element Aang has to learn. Leave empty for all three. One of: `1` (Book One: Water), `2` (Book Two: Earth), `3` (Book Three: Fire).
- Seed (`seed`, text): Any text you like. Two runs given the same seed make the same pick, which is what a test, a screenshot or a step that retries needs. Leave empty for a genuinely different pick each time.

**Outputs**

- `episode` (object)
- `pool_size` (number)
- `season` (number)
- `seed` (text)

**Example output**

```json
{
  "episode": {
    "air_date": "2005-09-23",
    "animated_by": "JM Animation",
    "book": "Book One: Water",
    "code": "S01E14",
    "directed_by": "Dave Filoni",
    "episode_id": 14,
    "number_in_season": 14,
    "production_code": "114",
    "season": 1,
    "title": "The Fortuneteller",
    "viewers_millions": null,
    "written_by": [
      "Aaron Ehasz",
      "John O'Bryan"
    ],
    "written_by_text": "Aaron Ehasz and John O'Bryan"
  },
  "pool_size": 20,
  "season": 1,
  "seed": null
}
```

### Get a random trivia question

Pick one of the service's multiple-choice questions at random, with its options lettered and set out ready to post, and its answer. Different every call. Set a seed when two runs have to agree instead. For a question that stays the same all day, use Get the trivia question of the day.

**Inputs**

- Seed (`seed`, text): Any text you like. Two runs given the same seed make the same pick, which is what a test, a screenshot or a step that retries needs. Leave empty for a genuinely different pick each time.

**Outputs**

- `pool_size` (number)
- `question` (object)
- `seed` (text)

**Example output**

```json
{
  "pool_size": 35,
  "question": {
    "correct_answer": "Yip-yip",
    "correct_letter": "B",
    "options": [
      {
        "letter": "A",
        "text": "Whoa"
      },
      {
        "letter": "B",
        "text": "Yip-yip"
      },
      {
        "letter": "C",
        "text": "Hiyah"
      },
      {
        "letter": "D",
        "text": "Up"
      }
    ],
    "options_text": "A) Whoa\nB) Yip-yip\nC) Hiyah\nD) Up",
    "question": "What phrase makes Appa fly?",
    "question_id": 26
  },
  "seed": null
}
```

### Get a trivia quiz

Put together a quiz of several different questions, returned as records, as one block of text ready to post, and with a separate answer key, so a workflow can send the quiz now and the answers later. Different every call; a seed makes the same quiz every time.

**Inputs**

- Number of questions (`count`, number): How many different questions the quiz holds, from 1 to 50. Defaults to 5. Asking for more than the service has gives all of them, in a shuffled order. From 1 to 50. Default: `5`.
- Seed (`seed`, text): Any text you like. Two runs given the same seed make the same pick, which is what a test, a screenshot or a step that retries needs. Leave empty for a genuinely different pick each time.

**Outputs**

- `answer_key` (text)
- `pool_size` (number)
- `question_count` (number)
- `questions` (list)
- `quiz_text` (text)
- `requested_count` (number)
- `seed` (text)

**Example output**

```json
{
  "answer_key": "1. B) South\n2. C) Zuko",
  "pool_size": 35,
  "question_count": 2,
  "questions": [
    {
      "correct_answer": "South",
      "correct_letter": "B",
      "options": [
        {
          "letter": "A",
          "text": "North"
        },
        {
          "letter": "B",
          "text": "South"
        }
      ],
      "options_text": "A) North\nB) South",
      "question": "Sokka and Katara are from the Water Tribe of the ____ Pole",
      "question_id": 35
    },
    {
      "correct_answer": "Zuko",
      "correct_letter": "C",
      "options": [
        {
          "letter": "A",
          "text": "Jet"
        },
        {
          "letter": "B",
          "text": "Haru"
        },
        {
          "letter": "C",
          "text": "Zuko"
        },
        {
          "letter": "D",
          "text": "Bumi"
        }
      ],
      "options_text": "A) Jet\nB) Haru\nC) Zuko\nD) Bumi",
      "question": "What is the name of the Fire Nation prince tasked with finding the Avatar?",
      "question_id": 4
    }
  ],
  "quiz_text": "1. Sokka and Katara are from the Water Tribe of the ____ Pole\nA) North\nB) South\n\n2. What is the name of the Fire Nation prince tasked with finding the Avatar?\nA) Jet\nB) Haru\nC) Zuko\nD) Bumi",
  "requested_count": 2,
  "seed": "weekly-quiz"
}
```

### Get an episode

Look up one episode: its title, season, air date, director, writers and animation studio. Pick it from the list, or pass a title, a code such as S02E06, or its number in the whole series (1 to 61) in from an earlier step. A title that fits several episodes - 'Sozin's Comet' has four parts - comes back listing them rather than guessing.

**Inputs**

- Episode (`episode`, text, required): The episode to look up. Pick one from the list, or type a title, a code such as S02E06 or 2x06, or its number in the whole series, from 1 to 61. A partial title works when only one episode matches it.

**Outputs**

- `episode` (object)
- `matched_on` (text)
- `requested_episode` (text)

**Example output**

```json
{
  "episode": {
    "air_date": "2006-05-05",
    "animated_by": "JM Animation",
    "book": "Book Two: Earth",
    "code": "S02E06",
    "directed_by": "Ethan Spaulding",
    "episode_id": 26,
    "number_in_season": 6,
    "production_code": "206",
    "season": 2,
    "title": "The Blind Bandit",
    "viewers_millions": null,
    "written_by": [
      "Michael Dante DiMartino"
    ],
    "written_by_text": "Michael Dante DiMartino"
  },
  "matched_on": "code",
  "requested_episode": "S02E06"
}
```

### Get show details

Get the show's synopsis, genres and creators, when it aired, and how many seasons and episodes it ran to, season by season. The service's own record says the show aired from 2003, but its episode list starts on February 21, 2005, the night it premiered, so the dates and counts here are worked out from the episodes themselves.

**Inputs**: None.

**Outputs**

- `creators` (list)
- `creators_text` (text)
- `episode_count` (number)
- `first_aired` (text)
- `genres` (list)
- `last_aired` (text)
- `season_count` (number)
- `seasons` (list)
- `synopsis` (text)
- `title` (text)
- `years_aired` (text)

**Example output**

```json
{
  "creators": [
    {
      "name": "Michael Dante DiMartino",
      "url": "https://www.imdb.com/name/nm0227204/"
    },
    {
      "name": "Bryan Konietzko",
      "url": "https://www.imdb.com/name/nm1665983/"
    }
  ],
  "creators_text": "Michael Dante DiMartino and Bryan Konietzko",
  "episode_count": 61,
  "first_aired": "2005-02-21",
  "genres": [
    "Animation",
    "Action",
    "Adventure",
    "Family",
    "Fantasy",
    "Mystery"
  ],
  "last_aired": "2008-07-19",
  "season_count": 3,
  "seasons": [
    {
      "book": "Book One: Water",
      "episode_count": 20,
      "first_aired": "2005-02-21",
      "last_aired": "2005-12-02",
      "season": 1
    },
    {
      "book": "Book Two: Earth",
      "episode_count": 20,
      "first_aired": "2006-03-17",
      "last_aired": "2006-12-01",
      "season": 2
    },
    {
      "book": "Book Three: Fire",
      "episode_count": 21,
      "first_aired": "2007-09-21",
      "last_aired": "2008-07-19",
      "season": 3
    }
  ],
  "synopsis": "The world is divided into four nations -- the Water Tribe, the Earth Kingdom, the Fire Nation and the Air Nomads -- each represented by a natural element for which the nation is named. Benders have the ability to control and manipulate the element from their nation. Only the Avatar is the master of all four elements. The ruthless Fire Nation wants to conquer the world but the only bender who has enough power, the Avatar, has disappeared ... until now. His tribe soon discovers that Aang is the long-lost Avatar. Now Katara and Sokka must safeguard Aang on his journey to master all four elements and save the world from the Fire Nation.",
  "title": "Avatar: The Last Airbender",
  "years_aired": "2005\u20132008"
}
```

### Get the trivia question of the day

Pick one question for a day and keep picking that same question all day, so a morning step can post the question and an evening one the answer. Each day takes the next question in one fixed order through the whole bank, so no question comes round again until every other one has had its day, where a fresh random pick each day would repeat within a week about half the time. Add a seed of your own to give a workspace its own order.

**Inputs**

- Day (`date`, date): The day to pick a question for. Leave empty for today in UTC, which is what a scheduled step wants.
- Seed (`seed`, text): Any text you like, to give this workspace its own order of questions, so two workspaces post different questions on the same day. Leave empty for the shared order.

**Outputs**

- `cycle_day` (number)
- `date` (text)
- `pool_size` (number)
- `question` (object)
- `seed` (text)

**Example output**

```json
{
  "cycle_day": 24,
  "date": "2026-09-29",
  "pool_size": 35,
  "question": {
    "correct_answer": "Metalbending",
    "correct_letter": "D",
    "options": [
      {
        "letter": "A",
        "text": "Bloodbending"
      },
      {
        "letter": "B",
        "text": "Energybending"
      },
      {
        "letter": "C",
        "text": "Lightningbending"
      },
      {
        "letter": "D",
        "text": "Metalbending"
      }
    ],
    "options_text": "A) Bloodbending\nB) Energybending\nC) Lightningbending\nD) Metalbending",
    "question": "Toph creates the earthbending technique...?",
    "question_id": 30
  },
  "seed": null
}
```
