# Get Game By Id

## Get Game by Id

<mark style="color:blue;">`GET`</mark> `http://localhost:3000/api/games/:id`

This will retrieve a singe game and its associated data, based on the id of the game.

#### Path Parameters

| Name | Type    | Description                                                      |
| ---- | ------- | ---------------------------------------------------------------- |
| id   | integer | Add the id of the game you\`re looking for. Id must be a number. |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{
    "id": 1,
    "name": "First Game Name",
    "cover_art": "this would be some cover art link",
    "screenshots": "['first link', 'second link', 'third link']",
    "critic_rating": 6,
    "total_rating": 60,
    "is_multiplayer": "1",
    "release_date": 1614772499,
    "platform": "PC",
    "genre": "RPG",
    "has_game": false,
    "want_game": true,
    "user_id": 1,
    "createdAt": "2021-06-16T19:41:51.000Z",
    "updatedAt": "2021-06-16T19:41:51.000Z",
    "comments": [
        {
            "body": "this is my first comment",
            "created_at": "2021-06-16T19:41:51.000Z",
            "user": {
                "username": "myusername"
            }
        },
        {
            "body": "this is my fourth comment",
            "created_at": "2021-06-16T19:41:51.000Z",
            "user": {
                "username": "myusername222"
            }
        }
    ],
    "user": {
        "username": "myusername"
    }
}
```

{% endtab %}

{% tab title="404 Could not find a game matching this query." %}

```
{ error: "failed to get Game" }
```

{% endtab %}
{% endtabs %}
