show and short query parameters to customize your results.
Filter by show
Use theshow query parameter to get quotes from a specific TV series. Show names are case-insensitive.
Show names are case-insensitive.
Friends, friends, and FRIENDS all work the same way.Response example
Available shows
You can get a list of all available shows from the/quotes/shows endpoint:
- Breaking Bad
- Friends
- The Office
- Brooklyn Nine-Nine
- Stranger Things
- And many more
Filter by length
Use theshort=true query parameter to get only one-line quotes. This is useful when you need concise quotes that fit in limited space.
Response example
Combine filters
You can use bothshow and short parameters together to get one-line quotes from a specific show.
Filter with multiple quotes
Filters work the same way when requesting multiple quotes. Just add the query parameters to the/quotes/:number endpoint:
How filtering works
The API uses a pre-computed filtering system for O(1) performance:- When you specify
show, the API converts it to lowercase (e.g.,Friends→friends) - The filter key is built based on your parameters:
show+short=true→show:friends:shortshowonly →show:friendsshort=trueonly →short- No filters →
all
- The API uses this key to retrieve a random quote from the pre-filtered set
Error handling
If you request a show that doesn’t exist, you’ll receive a 404 response:Make sure to URL-encode show names with spaces. For example,
The Office becomes the%20office or use + like the+office.