# The Simpsons API

> Look up characters, episodes, and locations from The Simpsons using the free, keyless The Simpsons API: page through 1,180+ characters with their occupations, catchphrases, and status, 760+ episodes with air dates and synopses, and 470+ Springfield locations, plus build CDN image URLs for any of them. No account or API key required. Disclaimer: this is an independent integration with the community-run The Simpsons API (thesimpsonsapi.com). It is not affiliated with, endorsed by, or sponsored by The Walt Disney Company, 20th Television, or the creators of The Simpsons; The Simpsons and all related names, characters, and trademarks are the property of their respective owners.

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

## Actions

### Build image URL

Build a CDN image URL from a resource's image path: a character's portrait path, or an episode's or location's image path, at one of the three sizes the CDN serves.

**Inputs**

- Image path (`image_path`, text, required): The resource's image path, such as '/character/1.webp' (a character's portrait path) or '/episode/1.webp'.
- Image size (`size`, text): The image width to request, in pixels. One of: `200` (200px), `500` (500px), `1280` (1280px). Default: `500`.

**Outputs**

- `imageUrl` (text)

**Example output**

```json
{
  "imageUrl": "https://cdn.thesimpsonsapi.com/500/character/1.webp"
}
```

### Get a character

Get a single character from The Simpsons by their numeric id. The detailed response adds a description and the episode and short they first appeared in.

**Inputs**

- Character ID (`character_id`, number, required): The numeric id of the character (for example, 1 for Homer Simpson). At least 1.

**Outputs**

- `character` (object)

**Example output**

```json
{
  "character": {
    "age": 1,
    "birthdate": "1990-11-07",
    "description": "Margaret Lenny \"Maggie\" Simpson is the one-year-old daughter and youngest child of Marge and Homer Simpson, the baby sister to Bart and Lisa Simpson and one of the five main characters of The Simpsons.",
    "first_appearance_ep": {
      "airdate": "1989-12-17",
      "episode_number": 1,
      "id": 1,
      "image_path": "/episode/1.webp",
      "name": "Simpsons Roasting on an Open Fire",
      "season": 1
    },
    "first_appearance_ep_id": 1,
    "first_appearance_sh": {
      "airdate": "1987-04-19",
      "episode_number": 1,
      "id": 1,
      "image_path": "/short/1.webp",
      "name": "Good Night",
      "season": 1
    },
    "first_appearance_sh_id": 1,
    "gender": "Female",
    "id": 5,
    "name": "Maggie Simpson",
    "occupation": "Unknown",
    "phrases": [
      "*suck-suck*",
      "Good night.",
      "Daddy."
    ],
    "portrait_path": "/character/5.webp",
    "status": "Alive"
  }
}
```

### Get a location

Get a single location from The Simpsons by its numeric id.

**Inputs**

- Location ID (`location_id`, number, required): The numeric id of the location (for example, 1 for 742 Evergreen Terrace). At least 1.

**Outputs**

- `location` (object)

**Example output**

```json
{
  "location": {
    "id": 1,
    "image_path": "/location/1.webp",
    "name": "742 Evergreen Terrace",
    "town": "Springfield",
    "use": "Residential"
  }
}
```

### Get an episode

Get a single episode of The Simpsons by its numeric id. Episodes are numbered chronologically by air date.

**Inputs**

- Episode ID (`episode_id`, number, required): The numeric id of the episode (for example, 1 for Simpsons Roasting on an Open Fire). At least 1.

**Outputs**

- `episode` (object)

**Example output**

```json
{
  "episode": {
    "airdate": "1989-12-17",
    "episode_number": 1,
    "id": 1,
    "image_path": "/episode/1.webp",
    "name": "Simpsons Roasting on an Open Fire",
    "season": 1,
    "synopsis": "When Mr. Burns announces that none of the workers will be getting Christmas bonuses, Homer keeps his lack of funds for the holidays a secret and gets a job as a mall Santa."
  }
}
```

### List characters

List characters from The Simpsons, one page at a time. Each character includes their name, age, gender, occupation, status, catchphrases, and portrait path.

**Inputs**

- Page (`page`, number): Which page of results to return, 20 per page (defaults to the first page). At least 1.

**Outputs**

- `characters` (object)

**Example output**

```json
{
  "characters": {
    "count": 1182,
    "next": "https://thesimpsonsapi.com/api/characters?page=2",
    "pages": 60,
    "prev": null,
    "results": [
      {
        "age": 39,
        "birthdate": "1956-05-12",
        "gender": "Male",
        "id": 1,
        "name": "Homer Simpson",
        "occupation": "Safety Inspector",
        "phrases": [
          "Doh!",
          "Why you little...!",
          "Woo-hoo!"
        ],
        "portrait_path": "/character/1.webp",
        "status": "Alive"
      }
    ]
  }
}
```

### List episodes

List episodes of The Simpsons, one page at a time. Each episode includes its season, episode number, air date, synopsis, and image path.

**Inputs**

- Page (`page`, number): Which page of results to return, 20 per page (defaults to the first page). At least 1.

**Outputs**

- `episodes` (object)

**Example output**

```json
{
  "episodes": {
    "count": 768,
    "next": "https://thesimpsonsapi.com/api/episodes?page=2",
    "pages": 39,
    "prev": null,
    "results": [
      {
        "airdate": "1989-12-17",
        "episode_number": 1,
        "id": 1,
        "image_path": "/episode/1.webp",
        "name": "Simpsons Roasting on an Open Fire",
        "season": 1,
        "synopsis": "When Mr. Burns announces that none of the workers will be getting Christmas bonuses, Homer keeps his lack of funds for the holidays a secret and gets a job as a mall Santa."
      }
    ]
  }
}
```

### List locations

List locations from The Simpsons, one page at a time. Each location includes its name, town, use, and image path.

**Inputs**

- Page (`page`, number): Which page of results to return, 20 per page (defaults to the first page). At least 1.

**Outputs**

- `locations` (object)

**Example output**

```json
{
  "locations": {
    "count": 477,
    "next": "https://thesimpsonsapi.com/api/locations?page=2",
    "pages": 24,
    "prev": null,
    "results": [
      {
        "id": 1,
        "image_path": "/location/1.webp",
        "name": "742 Evergreen Terrace",
        "town": "Springfield",
        "use": "Residential"
      }
    ]
  }
}
```
