> For the complete documentation index, see [llms.txt](https://docs.matchplay.events/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.matchplay.events/games-api.md).

# Games API

## Get rounds

```http
GET /api/tournaments/{tournamentId}/rounds
```

Rounds are collections of games played at the same time. They are also used in pingolf tournaments to represent a golf hole.

## Get games

```http
GET /api/games
```

Games are multi-player games in direct play tournaments.

**Query params**

| Name                   | Description                                                                                                                                          |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `page` (integer)       | Which page of results to get                                                                                                                         |
| `tournaments` (string) | Comma-separated list of tournament ids to get games for. You must provide either `tournaments` or `series`. You may provide up to 25 tournament ids. |
| `series` (string)      | Comma-separated list of tournament ids to get games for. You must provide either `tournaments` or `series`. You may provide up to 5 series ids.      |
| `ids` (string)         | Comma-separated list of game ids to fetch. You may provide up to 50 game ids.                                                                        |
| `status` (string)      | Game status to filter on. Value may be `started` or `completed`                                                                                      |
| `round` (integer)      | Round id of round to filter on.                                                                                                                      |
| `player` (integer)     | Player id of player to filter on.                                                                                                                    |
| `arena` (integer)      | Arena id of arena to filter on.                                                                                                                      |
| `bank` (integer)       | Bank id of bank to filter on.                                                                                                                        |

## Get single player games

```http
GET /api/tournaments/{tournamentId}/single-player-games
```

Single player games are used in best game and pingolf tournaments.

**Query params**

| Name                 | Description                                                                   |
| -------------------- | ----------------------------------------------------------------------------- |
| `page` (integer)     | Which page of results to get                                                  |
| `limit` (integer)    | Number of games to get. Default is `25`, max is `500`.                        |
| `ids` (string)       | Comma-separated list of game ids to fetch. You may provide up to 50 game ids. |
| `status` (string)    | Game status to filter on. Value may be `pending`,  `started` or `completed`   |
| `bestGame` (boolean) | Whether to only fetch games that are marked as a "best game"                  |
| `voided` (boolean)   | Set to `true` to included voided games                                        |
| `round` (integer)    | Round id of round to filter on.                                               |
| `player` (integer)   | Player id of player to filter on.                                             |
| `arena` (integer)    | Arena id of arena to filter on.                                               |

## Get cards

```http
GET /api/tournaments/{tournamentId}/cards
```

Cards are used in card-based best game tournaments.

**Query params**

| Name                 | Description                                                                 |
| -------------------- | --------------------------------------------------------------------------- |
| `page` (integer)     | Which page of results to get                                                |
| `limit` (integer)    | Number of games to get. Default is `25`, max is `500`.                      |
| `status` (string)    | Game status to filter on. Value may be `pending`,  `started` or `completed` |
| `bestGame` (boolean) | Whether to only fetch games that are marked as a "best game"                |
| `voided` (boolean)   | Set to `true` to included voided games                                      |
| `player` (integer)   | Player id of player to filter on.                                           |
