The Rick and Morty API is a RESTful and GraphQL API based on the television show Rick and Morty. You will access to data about hundreds of characters, images, locations and episodes. The Rick and Morty API is filled with canonical information as seen on the TV show.
GraphQL
The GraphQL can be accesed in the base url: https://rickandmortyapi.com/graphql/ and you can run queries like this one:
query {
characters(page: 2, filter: { name: "rick" }) {
info {
count
}
results {
name
}
}
character(id: 1) {
id
}
}
REST
For the REST api, the base URL is: https://rickandmortyapi.com/api/. The base url contains information about all available API's resources. All requests are GET requests and go over https. All responses will return data in json. A request to the base URL would return the following data:
{
"characters": "https://rickandmortyapi.com/api/character",
"locations": "https://rickandmortyapi.com/api/location",
"episodes": "https://rickandmortyapi.com/api/episode"
}
This open source API is exceptional for testing purposes, it could be used as well for students, where you need to explain how an API works, how to interact with it from a specific language and so. Besides, it is about Rick and Morty, what could go wrong?
Wrappers
There are some wrappers that have been written around this API, so you can use them to access in case you need to:
- Elixir: ExShla - The Rick and Morty API Wrapper by l1h3r
- Go: The Rick and Morty API Go client by Leopoldo Caballero
- Java: Rick and Morty API Java Client by Adriano Rocha
- JavaScript: The Rick and Morty API Node client by Simple Rick
- .NET: RickAndMorty.Net.Api by Carlj28
- Python: Python implementation for the Rick and Morty API by Rohan Hazra
- R: mortyr by Mike Page
- Ruby: The Rick and Morty API Gem by Tommy Spielhoelle
- Swift: The Rick and Morty API Swift Client by Benjamin Bruch
Support The Rick and Morty API
You can help to maintain The Rick and Morty API's infrastructure! If you are using the API for your app, your online tutorials or your coding challenges, please consider supporting us to help keep the project alive.
The developers are not getting any money from this and they use their free time to keep the API running and the data up to date. Every contribution, however big or small, is super valuable for its future. You can donate to the project here.