The Rick and Morty API: an open source RESTful and GraphQL API

The Rick and Morty API: an open source RESTful and GraphQL API

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:

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

References and external resources

This could interest you

Become a more social person