---
title: "Export games of a user"
method: GET
path: "/api/games/user/{username}"
tags: ["Games"]
---

# Export games of a user

`GET /api/games/user/{username}`

Download all games of any user in PGN or [ndjson](#description/streaming-with-nd-json) format.
Games are sorted by reverse chronological order (most recent first).
We recommend streaming the response, for it can be very long.
<https://lichess.org/@/german11> for instance has more than 500,000 games.
The game stream is throttled, depending on who is making the request:
  - Anonymous request: 20 games per second
  - [OAuth2 authenticated](#description/authentication) request: 30 games per second
  - Authenticated, downloading your own games: 60 games per second

## Path parameters

- `username` string, required

## Query parameters

- `since` integer
- `until` integer
- `max` integer
- `vs` string
- `rated` boolean
- `perfType` 'ultraBullet' | 'bullet' | 'blitz' | 'rapid' | 'classical' | 'correspondence' | 'chess960' | 'crazyhouse' | 'antichess' | 'atomic' | 'horde' | 'kingOfTheHill' | 'racingKings' | 'threeCheck'
- `color` 'white' | 'black'
- `analysed` boolean
- `moves` boolean
- `pgnInJson` boolean
- `tags` boolean
- `clocks` boolean
- `evals` boolean
- `accuracy` boolean
- `opening` boolean
- `division` boolean
- `ongoing` boolean
- `finished` boolean
- `literate` boolean
- `lastFen` boolean
- `withBookmarked` boolean
- `sort` 'dateAsc' | 'dateDesc'

## Headers

- `Accept` 'application/x-chess-pgn' | 'application/x-ndjson'

## Response `200`

The games of the user.

---

[API](https://skmtc.net/lichess/apis/lichess-org-api-reference.md) · [All operations](https://skmtc.net/lichess/apis/lichess-org-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lichess/lichess-org-api-reference/versions/1425db81eb3b/schema)
