# Rick and Morty API API

> Returns Rick and Morty characters, locations and episodes with their attributes, filterable by name.

Category: Entertainment & Books. Region: global. 6 endpoints at `https://api.hoshime.com/v1/rickandmorty/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/rickandmorty
## GET /v1/rickandmorty/characters

Characters, 20 per page, optionally filtered by name.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | no | Part of a character name, such as rick. |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `episodeCount` (integer (int64)), `gender` (string), `id` (string), `image` (string), `location` (string), `name` (string), `origin` (string), `species` (string), `status` (string), `type` (string)

```bash
curl "https://api.hoshime.com/v1/rickandmorty/characters" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/rickandmorty/character

One character: species, status, origin, last location and episode count.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Character id, such as 1. (e.g. 1) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `episodeCount` (integer (int64)), `gender` (string), `id` (string), `image` (string), `location` (string), `name` (string), `origin` (string), `species` (string), `status` (string), `type` (string)

```bash
curl "https://api.hoshime.com/v1/rickandmorty/character?id=1" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/rickandmorty/location

One location: its type, dimension and number of residents.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Location id, such as 3. (e.g. 3) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `dimension` (string), `id` (string), `name` (string), `residentCount` (integer (int64)), `type` (string)

```bash
curl "https://api.hoshime.com/v1/rickandmorty/location?id=3" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/rickandmorty/episodes

Episodes, 20 per page, optionally filtered by a part of the title.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | no | Part of the episode title, such as pilot. |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `airDate` (string), `characterCount` (integer (int64)), `characterIds` (string[]), `code` (string), `id` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/rickandmorty/episodes" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/rickandmorty/episode

One episode by its id, with its air date, code and the ids of the characters in it.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | integer | yes | Episode id, such as 1. (e.g. 1) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `airDate` (string), `characterCount` (integer (int64)), `characterIds` (string[]), `code` (string), `id` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/rickandmorty/episode?id=1" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/rickandmorty/locations

Locations, 20 per page, optionally filtered by name, type or dimension.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | no | Part of the location name, such as earth. |
| `type` | string | no | Part of the location type, such as planet. (e.g. planet) |
| `dimension` | string | no | Part of the dimension name, such as dimension c-137. |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `dimension` (string), `id` (string), `name` (string), `residentCount` (integer (int64)), `type` (string)

```bash
curl "https://api.hoshime.com/v1/rickandmorty/locations?type=planet" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
