Characters

The character model

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the character.

  • Name
    name
    Type
    string
    Description

    The character's name.

  • Name
    gender
    Type
    string
    Description

    The characters gender.

  • Name
    marital
    Type
    string
    Description

    The person the character is married to.

  • Name
    job
    Type
    array<string>
    Description

    List of jobs the character had.

  • Name
    workspace
    Type
    array<string>
    Description

    List of locations a character has worked.

  • Name
    firstAppearance
    Type
    string
    Description

    Title of the episode the character appeared in.

  • Name
    lastAppearance
    Type
    string
    Description

    The last episode the character was in.

  • Name
    actor
    Type
    string
    Description

    Name of the actor who portrayed the character.

  • Name
    episodes
    Type
    array<Episode>
    Description

    List of episodes the character appeared in.


GET/api/characters

List all characters

Lists all characters available and optionally includes the episodes they appeared in. The episodes are not included by default.

Optional attributes

  • Name
    limit
    Type
    integer
    Description

    Limit the number of characters returned.

  • Name
    includeEpisodes
    Type
    boolean
    Description

    Include the episodes the character appeared in.

Request

GET
/api/characters
curl -G https://theofficeapi.dev/api/characters \
  -d includeEpisodes=true \
  -d limit=10

Response

{
  "results": [
    {
      "id": 55,
      "name": "Michael Scott",
      "gender": "Male",
      "marital": "Holly Flax",
      "job": ["Regional Manager", "Founder and CEO"],
      "workplace": [
        "Dunder Mifflin Scranton",
        "The Michael Scott Paper Company"
      ],
      "firstAppearance": "Pilot",
      "lastAppearance": "Finale",
      "actor": "Steve Carell",

      // Included if `includeEpisodes` is true
      "episodes": [
        {
          "type": "MAIN",
          "id": 1,
          "title": "Pilot",
          "summary": "A documentary crew arrives at the Scranton, Pennsylvania, offices of Dunder Mifflin to observe the employees and learn about modern management. Regional manager Michael Scott  tries to paint a happy picture in the face of potential downsizing from corporate. The office also gets new employee Ryan Howard as a temporary worker, while salesman Jim Halpert pranks and antagonizes fellow salesman Dwight Schrute , much to the enjoyment of receptionist Pam Beesly .",
          "season": {
            "id": 1,
            "number": 1
          },
          "airDate": "2005-03-24",
          "episode": "1",
          "seriesEpisodeNumber": 1
        }
      ]
    },
    {
      "id": 2
      // ...
    }
  ],
  "meta": {
    "isFirstPage": true,
    "isLastPage": false,
    "currentPage": 1,
    "previousPage": null,
    "nextPage": 2,
    "pageCount": 9
  }
}

GET/api/character/:id

Retrieve a character

This endpoint allows you to retrieve a character by providing the character id. Refer to the list at the top of this page to see which properties are included with character objects.

Request

GET
/api/character/640150efe4cd7dc24960d943
curl https://theofficeapi.dev/api/character/62 \
  -d includeEpisodes=true

Response

{
  "id": 62,
  "name": "Pam Beesly",
  "gender": "Female",
  "marital": null,
  "job": [
    "Sales Representative, Dunder Mifflin Scranton,",
    "Sales Representative, Michael Scott Paper Company,",
  ],
  "workplace": ["Dunder Mifflin Scranton", "Michael Scott Paper Company"],
  "firstAppearance": "Pilot",
  "lastAppearance": "Finale",
  "actor": "Jenna Fischer",

  // Included if `includeEpisodes` is true
  "episodes": [
    {
      "type": "MAIN",
      "id": 1,
      "title": "Pilot",
      "summary": "A documentary crew arrives at the Scranton, Pennsylvania, offices of Dunder Mifflin to observe the employees and learn about modern management. Regional manager Michael Scott  tries to paint a happy picture in the face of potential downsizing from corporate. The office also gets new employee Ryan Howard as a temporary worker, while salesman Jim Halpert pranks and antagonizes fellow salesman Dwight Schrute , much to the enjoyment of receptionist Pam Beesly .",
      "season": {
        "id": 1,
        "number": 1
      },
      "airDate": "2005-03-24",
      "episode": "1",
      "seriesEpisodeNumber": 1
    },
    {
      "id": 2,
      // ...
    }
  ]
}