# IDs in every catalog

> Takes a title’s ID in one catalog and returns its IDs in the others.

> Documentation index for agents: https://kinodata.space/en/llms.txt — the whole documentation in one file: https://kinodata.space/en/llms-full.txt

Request: `GET https://api.kinodata.space/v1.3/ids/{type}/{id}`

The lightest request in the API: IDs only, without titles or metadata. Use it when you need the IDs for your own database or to open the title on a catalog site.

`tmdb` and `tmdb_tv` are separate ID spaces. The same number means different works in each: `/ids/tmdb/1396` is Tarkovsky’s *Mirror*, `/ids/tmdb_tv/1396` is *Breaking Bad*. Use the type TMDB itself gave you.

## Path parameters

- `type` (string, required) — The catalog the ID comes from: IMDb, Kinopoisk, TMDB (movie or series) or Kinorium.
  Values: `imdb`, `kp`, `tmdb`, `tmdb_tv`, `kinorium`.
- `id` (string, required) — The ID in that catalog. IMDb IDs are `tt` followed by digits (`tt1375666`); the others are digits (`447301`).

## Response fields

- `imdb_id` (string | null) — IMDb ID: `tt` followed by digits.
- `kp_id` (string | null) — Kinopoisk ID.
- `tmdb_id` (string | null) — TMDB movie ID. `null` for a series: its ID is in `tmdb_tv_id`.
- `tmdb_tv_id` (string | null) — TMDB series ID. At most one of `tmdb_id` and `tmdb_tv_id` is set.
- `kinorium_id` (string | null) — Kinorium ID.

## Errors

| status | code | when |
|---|---|---|
| 400 | `invalid_request` | Unknown `type`, or the ID does not match the catalog format: no `tt` for IMDb, not digits for the rest; a query parameter other than `lang`. |
| 404 | `not_found` | No title found for this ID. |
| 401 | `unauthorized` | The `X-API-Key` header is missing, or the key is unknown or revoked. |
| 429 | `rate_limited` | The per-second rate limit or the daily quota is used up. |

Every code and what to do about it is on the [Errors](https://kinodata.space/en/docs/errors.md) page.

## Examples

### By Kinopoisk ID

```bash
curl -H "X-API-Key: $KINODATA_KEY" \
  "https://api.kinodata.space/v1.3/ids/kp/447301"
```

Response `200`:

```json
{
  "imdb_id": "tt1375666",
  "kp_id": "447301",
  "tmdb_id": "27205",
  "tmdb_tv_id": null,
  "kinorium_id": "472809"
}
```

### TMDB series

```bash
curl -H "X-API-Key: $KINODATA_KEY" \
  "https://api.kinodata.space/v1.3/ids/tmdb_tv/1396"
```

Response `200`:

```json
{
  "imdb_id": "tt0903747",
  "kp_id": "404900",
  "tmdb_id": null,
  "tmdb_tv_id": "1396",
  "kinorium_id": "400796"
}
```

### Unknown ID

```bash
curl -H "X-API-Key: $KINODATA_KEY" \
  "https://api.kinodata.space/v1.3/ids/kp/999999999"
```

Response `404`:

```json
{
  "error": {
    "code": "not_found",
    "message": "title not found: kp 999999999"
  }
}
```

### Typo in type

```bash
curl -H "X-API-Key: $KINODATA_KEY" \
  "https://api.kinodata.space/v1.3/ids/tmbd/27205"
```

Response `400`:

```json
{
  "error": {
    "code": "invalid_request",
    "message": "unknown type \"tmbd\"",
    "field": "type",
    "allowed": [
      "imdb",
      "kp",
      "tmdb",
      "tmdb_tv",
      "kinorium"
    ],
    "hint": "did you mean \"tmdb\"?"
  }
}
```
