7 | officeapi.dev is a free JSON API for quotes, facts and information on NBC’s beloved mockumentary series The Office.
10 |Try An Example
13 |try episodes/
22 |try characters/
23 |* Max of 5 results shown. Actual data length may vary.
28 |
32 | Documentation
33 |Introduction
38 |Welcome to the officeapi.dev! This documentation should help familiarise yourself with the resources available and how to consume them with HTTP requests.
39 | 40 |What is a REST API?
41 |An API is an application programming interface - in short, it’s a set of rules and instructions that lets programs talk to each other, exposing data and functionality across the internet in a consistent format.
42 |REST stands for Representational State Transfer. This is an architectural pattern that describes how distributed systems can expose a consistent interface. When people use the term ‘REST API,’ they are generally referring to an API accessed via HTTP protocol at a predefined set of URLs.
43 |These URLs represent various resources - any information or content accessed at that location, which can be returned as JSON, HTML, audio files, or images. Often, resources have one or more methods that can be performed on them over HTTP, like GET, POST, PUT and DELETE.
44 |The officeapi.dev only allows you to GET data; all other operations are prohibited.
45 |Usage
49 |Let's make our first API request to the officeapi.dev!
50 |Open a terminal and use curl or httpie to make the following request to get a character from the API:
51 |After making that request, you will get a response much like the following:
53 |If your response looks slightly different, that's okay - we've most likely updated the response with new data.
55 |
58 |
59 | Resources
61 |The following resources are available through the officeapi:
62 |-
63 |
- quotes string -- the URL root for quote resources 64 |
- characters string -- the URL root for character resources 65 |
- episodes string -- the URL root for episode resources 66 |
- crew string -- the URL root for crew resources 67 |
69 |
70 |
71 |
Quotes
73 |A quote resource is a phrase said by a character.
74 |Endpoints
75 |-
76 |
- /quotes/ -- get a list of all quotes in our database. 77 |
- /quotes/:id/ -- get a specific quote by id. 78 | 79 |
- /quotes/random -- get a random quote from any character. 80 |
As an example, if I make a request for a random quote, the response will be similar to the following:
83 |84 |
Example request:
85 |Characters
92 |A character resource is an entity representing a personality portrayed on the tv show.
93 |Endpoints
94 |-
95 |
- /characters/ -- get a list of all characters in our database. 96 |
- /characters/:id/ -- get a specific character by id. 97 |
- /characters/random -- get a random character in our database. 98 |
As an example, if I wanted to get Jim Halpert back from the database, the request would look like the following:
101 |102 |
Example request:
103 |Episodes
110 |An episode resource is an entity representing a specific installment from the tv show.
111 |Our database contains information for each episode from the series.
112 |Endpoints
113 |-
114 |
- /episodes/ -- get a list of all episodes in our database. 115 |
- /episodes/:id/ -- get a specific episode by id. 116 |
- /episodes/random -- get a random episode from our database. 117 |
As an example, if I wanted to get the data related to the pilot episode in season one, the request would look like the following:
120 |121 |
Example request:
122 |Crew
129 |A crew resource is an entity representing a crew member from the tv show. A crew member can be an actor, writer or director, as indicated by the 'role' property on the resource returned.
130 |Endpoints
131 |-
132 |
- /crew/ -- get a list of all crew members in our database. 133 |
- /crew/:id/ -- get a specific crew resource by id. 134 |
- /crew/random -- get a random crew member from our database. 135 |
As an example, if I wanted to get the data related to writer and actor Michael Schur, the request would look like the following:
138 |139 |
Example request:
140 |
152 |
157 |