# Rick and Morty API
> The Rick and Morty universe as an API — every character, location and episode from the show. Look up a character by id or search and filter the roster by name, status (alive, dead, unknown), species, type and gender (e.g. all living Mortys), browse locations by name, type and dimension, or pull episodes by name or episode code (e.g. S03E07 → The Ricklantis Mixup). Each character carries status, species, origin and last-known location, episode appearances and a portrait; locations carry their type and dimension; episodes carry the air date and cast size. Backed by the open rickandmortyapi.com dataset. Ideal for fan sites, trivia and quiz games, Discord bots, learning projects and any Rick and Morty app.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/rickandmorty-api/..."
```

## Pricing
- **Free** (Free) — 9,000 calls/Mo, 2 req/s
- **Starter** ($3/Mo) — 130,000 calls/Mo, 8 req/s
- **Pro** ($10/Mo) — 640,000 calls/Mo, 20 req/s
- **Mega** ($31/Mo) — 2,700,000 calls/Mo, 50 req/s

## Endpoints

### Rick and Morty

#### `GET /v1/character` — A character by id or filtered search

**Parameters:**
- `id` (query, optional, string) — Character id, e.g. 1 (Rick Sanchez) Example: `1`
- `name` (query, optional, string) — Name search, e.g. morty
- `status` (query, optional, string) — alive | dead | unknown
- `species` (query, optional, string) — Species, e.g. Human
- `gender` (query, optional, string) — female | male | genderless | unknown
- `page` (query, optional, string) — Page number (default 1) Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rickandmorty-api/v1/character?id=1&page=1"
```

**Response:**
```json
{
    "data": {
        "character": {
            "id": 1,
            "url": "https://rickandmortyapi.com/api/character/1",
            "name": "Rick Sanchez",
            "type": null,
            "image": "https://rickandmortyapi.com/api/character/avatar/1.jpeg",
            "gender": "Male",
            "origin": "Earth (C-137)",
            "status": "Alive",
            "species": "Human",
            "location": "Citadel of Ricks",
            "episode_count": 51
        }
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:35.151Z",
        "request_id": "5ee22bcd-a297-408d-b460-a83e5e45dee0"
    },
    "status": "ok",
    "message": "Character retrieved",
    "success": true
}
```

#### `GET /v1/episode` — An episode by id or filtered search

**Parameters:**
- `id` (query, optional, string) — Episode id, e.g. 28 Example: `28`
- `name` (query, optional, string) — Name search
- `episode` (query, optional, string) — Episode code, e.g. S03E07
- `page` (query, optional, string) — Page number (default 1) Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rickandmorty-api/v1/episode?id=28&page=1"
```

**Response:**
```json
{
    "data": {
        "episode": {
            "id": 28,
            "url": "https://rickandmortyapi.com/api/episode/28",
            "name": "The Ricklantis Mixup",
            "episode": "S03E07",
            "air_date": "September 10, 2017",
            "character_count": 65
        }
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:35.241Z",
        "request_id": "7eab8110-fff6-4939-8772-f80c3d4c541e"
    },
    "status": "ok",
    "message": "Episode retrieved",
    "success": true
}
```

#### `GET /v1/location` — A location by id or filtered search

**Parameters:**
- `id` (query, optional, string) — Location id, e.g. 3 (Citadel of Ricks) Example: `3`
- `name` (query, optional, string) — Name search, e.g. earth
- `type` (query, optional, string) — Type, e.g. Planet
- `dimension` (query, optional, string) — Dimension search
- `page` (query, optional, string) — Page number (default 1) Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rickandmorty-api/v1/location?id=3&page=1"
```

**Response:**
```json
{
    "data": {
        "location": {
            "id": 3,
            "url": "https://rickandmortyapi.com/api/location/3",
            "name": "Citadel of Ricks",
            "type": "Space station",
            "dimension": "unknown",
            "resident_count": 101
        }
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:35.307Z",
        "request_id": "d94f2779-6009-4577-a93a-d9b9cc8ec2d6"
    },
    "status": "ok",
    "message": "Location retrieved",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Filters & usage notes

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rickandmorty-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "The Rick and Morty universe. /v1/character = a character by id or search/filter (name, status, species, type, gender); /v1/location = a location by id or filter (name, type, dimension); /v1/episode = an episode by id or filter (name, episode code). Add page= to paginate searches.",
        "source": "rickandmortyapi.com",
        "filters": {
            "episode": [
                "name",
                "episode (e.g. S03E07)"
            ],
            "location": [
                "name",
                "type",
                "dimension"
            ],
            "character": [
                "name",
                "status (alive|dead|unknown)",
                "species",
                "type",
                "gender"
            ]
        },
        "endpoints": [
            "/v1/character",
            "/v1/location",
            "/v1/episode",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:35.381Z",
        "request_id": "960561da-fa1d-49a2-87e4-2335e2d2750c"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/rickandmorty-api
OpenAPI spec: https://www.oanor.com/api/rickandmorty-api/openapi.json
