BYTETOOLS

Rick and Morty API

Free Rick and Morty API with no key: 800+ characters, episodes and locations with images, filtering and pagination. REST and GraphQL. Tested example.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-19

What is the Rick and Morty API?

The Rick and Morty API is a free, key-free API providing over 800 characters, plus episodes and locations, with images, filtering and pagination. It offers both REST and GraphQL interfaces.

This API is a favourite for front-end tutorials because it combines three things that are hard to find together for free: real images for every record, proper pagination metadata, and rich filtering — everything a realistic list-and-detail UI needs.

It also exposes a GraphQL endpoint alongside REST, which makes it one of the few free APIs where you can implement the same feature both ways and compare. That is genuinely useful when learning GraphQL without setting up a server.

Quick facts

Base URL
https://rickandmortyapi.com/api
Authentication
No key required.
Rate limit
No published hard limit; caching is requested.
Pricing
Free and open source.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the Rick and Morty API

Every request below was executed against the live API on 2026-08-19, and the response shown is the real body it returned — not an illustration.

1. Fetch a single character

GET https://rickandmortyapi.com/api/character/1

curl
curl 'https://rickandmortyapi.com/api/character/1'
JavaScript (fetch)
const res = await fetch("https://rickandmortyapi.com/api/character/1");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://rickandmortyapi.com/api/character/1", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200 (truncated)
{
  "id": 1,
  "name": "Rick Sanchez",
  "status": "Alive",
  "species": "Human",
  "type": "",
  "gender": "Male",
  "origin": {
    "name": "Earth (C-137)",
    "url": "https://rickandmortyapi.com/api/location/1"
  },
  "location": {
    "name": "Citadel of Ricks",
    "url": "https://rickandmortyapi.com/api/location/3"
  },
  "image": "https://rickandmortyapi.com/api/character/avatar/1.jpeg",
  "episode": [
    "https://rickandmortyapi.com/api/episode/1",
    "https://rickandmortyapi.com/api/episode/2",
    "https://rickandmortyapi.com/api/episode/3",
    "https://rickandmortyapi.com/api/episode/4",
    "https://rickandmortyapi.com/api/episode/5",
    "https://rickandmortyapi.com/api/episode/6",
    "https://rickandmortyapi.com/api/episode/7",
    "https://rickandmortyapi.com/api/episode/8",
    "https://rickandmortyapi.com/api/episode/9",
    "https://rickandmortyapi.com/api/episode/10",
    "https://rickandmortyapi.com/api/episode/11",
    "https://rickandmortyapi.com/api/episode/12",
    "https://rickandmortyapi.com/api/episode/13",
    "https://rickandmortyapi.com/api/episode/14",
    "https://rickandmortyapi.com/api/episode/15",
    "https://rickandmortyapi.com/api/episode/16",
    "https://rickandmortyapi.com/api/episode/17",
    "https://rickandmortyapi.com/api/episode/18",
    "https://rickandmortyapi.com/api/episode/19",
    "https://rickandmortyapi.com/api/episode/20",
    "https://rickandmortyapi.com/api/episode/21",
    "https://rickandmortyapi.com/api/episode/22",
    "https://rickandmortyapi.com/api/episode/23",
    "https://rickandmortyapi.com/api/episode/

Parameters

ParameterTypeRequiredDescription
<resource>pathRequiredcharacter, location or episode. character
<id>pathOptionalResource id, or a comma-separated list for several. 1
pageintegerOptionalPage number; results are paginated at 20 per page. 2
name / status / speciesqueryOptionalFilter characters by these attributes. rick

Response fields

info.count / pagesinteger
Total results and total pages.
info.next / prevstring|null
URLs for the adjacent pages — null at the boundaries.
results[].namestring
Character name.
results[].statusstring
Alive, Dead or unknown.
results[].imagestring
Character avatar URL, directly renderable.
results[].episodearray
URLs of episodes the character appears in.

What you can build with the Rick and Morty API

  • Build a character browser with search, filter and pagination
  • Compare REST and GraphQL implementations of the same feature
  • Practise image grids and infinite scroll with real assets
  • Create a portfolio project with visually appealing data

Common errors and how to fix them

404 with an error message

No results matched the filter.

Fix: Filtering to nothing returns 404 rather than an empty list — handle it as a normal empty state, not a failure.

Null next page

You are on the last page.

Fix: Check `info.next` for null instead of computing page numbers yourself.

Rick and Morty API — frequently asked questions

Is the Rick and Morty API free?

Yes, completely free with no API key or rate limit, and it offers both REST and GraphQL endpoints.

How does pagination work?

Results come 20 per page with an `info` object containing total count, total pages, and next/previous URLs. Follow `info.next` rather than constructing page URLs manually.

Why do I get a 404 when filtering?

When a filter matches nothing the API returns 404 with an error message rather than an empty results array. Treat it as an empty state in your UI.

Can I fetch multiple characters in one request?

Yes, pass a comma-separated list of ids such as /character/1,2,3, which returns an array and saves several round trips.

Tools that pair with this API

Rick and Morty API is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.