# List series

> The blocks that group sets — Base, EX, Sword & Shield, Scarlet & Violet — with the number of sets in each.

- **Endpoint**: `GET /v1/series`
- **Cost**: 1 credit
- **Minimum plan**: free
- **Cache-Control**: `public, max-age=86400`

Source: https://pokemontcgapi.com/docs/api/series/list

Seventeen rows, so the whole list fits in one page. `id` is the slug, and it is the value `GET /v1/sets?series=` accepts — as does the name, because whichever one you stored should work.

## Query parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `orderBy` | string | -set_count | `set_count`, `name` or `slug`, with a leading `-` for descending. Every order ends on `slug` as the tiebreaker. |
| `limit` | integer | 50 | Rows per page, 1 to 250. Above 250 you get `LIMIT_EXCEEDED` — follow `links.next` instead of raising it. |
| `cursor` | string | — | Opaque keyset cursor from `links.next`. Never construct one; it carries the sort order it was issued for and is rejected if `orderBy` changes mid-run. |

## Headers

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `X-Api-Key` **required** | string | — | Your API key. `Authorization: Bearer <key>` is accepted as an alias. |
| `If-None-Match` | string | — | Send back the `ETag` you stored. The API returns a strong ETag on every catalogue response, and a 304 is a header exchange: no body, no database row read. |

## Example request

**curl**

```bash
curl -s -G "https://api.pokemontcgapi.com/v1/series" \
  --data-urlencode "limit=3" \
  -H "X-Api-Key: $PTCG_API_KEY"
```

**TypeScript**

`request.ts`

```ts
const url = new URL("https://api.pokemontcgapi.com/v1/series");
url.searchParams.set("limit", "3");

const res = await fetch(url, {
  headers: { "X-Api-Key": process.env.PTCG_API_KEY ?? "" },
});

if (!res.ok) {
  const { error } = await res.json();
  throw new Error(`${error.code}: ${error.message} (${error.request_id})`);
}

const { data, meta } = await res.json();
```

**Python**

`request.py`

```python
import os, httpx

res = httpx.get(
    "https://api.pokemontcgapi.com/v1/series",
    params={"limit": "3"},
    headers={"X-Api-Key": os.environ["PTCG_API_KEY"]},
)
res.raise_for_status()
payload = res.json()
```

## Example response

`200 OK` · `Cache-Control: public, max-age=86400`

`response.json`

```json
{
  "data": [
    {
      "id": "sword-shield",
      "slug": "sword-shield",
      "name": "Sword & Shield",
      "set_count": 22
    },
    {
      "id": "ex",
      "slug": "ex",
      "name": "EX",
      "set_count": 20
    },
    {
      "id": "scarlet-violet",
      "slug": "scarlet-violet",
      "name": "Scarlet & Violet",
      "set_count": 18
    }
  ],
  "meta": {
    "limit": 3,
    "count": 3,
    "total_count": 17,
    "has_more": true
  },
  "links": {
    "next": "https://api.pokemontcgapi.com/v1/series?cursor=eyJrIjpbMThdLCJpZCI6InNjYXJsZXQtdmlvbGV0IiwicyI6InNldF9jb3VudDpkZXNjLHNsdWc6YXNjIn0&limit=3"
  }
}
```

## Errors

Every error body carries `error.code`, `error.message` and `error.request_id`. Switch on the code, never on the message.

| Status | Code | When |
| --- | --- | --- |
| 401 | `MISSING_API_KEY` | No `X-Api-Key` header and no bearer token on a route that requires one. |
| 401 | `INVALID_API_KEY` | The key does not match any account. |
| 400 | `INVALID_CURSOR` | The cursor is malformed, or was issued for a different `orderBy` than the one on this request. |
| 400 | `INVALID_PARAMETER` | A query parameter has the wrong type or an unsupported value — a non-integer `limit`, an unknown `lang`, an unknown `region`, a sort key that is not sortable. |
| 400 | `LIMIT_EXCEEDED` | `limit` is above 250, or a batch request carries more than 100 ids. |

The full taxonomy, with what to do about each code, is on the [errors](https://pokemontcgapi.com/docs/errors) page.
