# Get a published game by slug

`GET /v1/public/store/games/{slug}`

URL: https://docs.spacerun.co/docs/platform/reference/public-store/getPublicStoreGame

- **Operation ID:** `getPublicStoreGame`
- **Tags:** Public store
- **Base URL:** `http://localhost:8787`

Cached for 60s (`Cache-Control: public, max-age=60`). Unpublished games are reported as not found.

**Workflow:** [Integration guide](https://docs.spacerun.co/docs/platform/guides/support-and-public-api).

**Authentication:** none (public).

## Authentication

- **Auth:** none (public endpoint, no token required).

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `slug` | path | `string` | yes | Pattern: `^[a-z0-9][a-z0-9-]{0,127}$` |

## Responses

### 200

Game.

- Header `x-request-id`: Request identifier; quote it when reporting an error.
Content type: `application/json`

Schema: `object (StorePublicGame)`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | yes | - |
| `slug` | `string` | yes | - |
| `title` | `string` | yes | - |
| `summary` | `string \| null` | yes | - |
| `description` | `string \| null` | yes | - |
| `game_type` | `string` | yes | One of: `"app"`, `"game"`, `"launcher"` |
| `status` | `string` | yes | One of: `"draft"`, `"published"`, `"hidden"` |
| `release_date` | `string \| null` | yes | Date, YYYY-MM-DD. |
| `controller_support` | `string` | yes | One of: `"none"`, `"partial"`, `"full"` |
| `website` | `string \| null` | yes | - |
| `required_age` | `integer` | yes | - |
| `legal_notice` | `string \| null` | yes | - |
| `license_required` | `boolean` | yes | - |
| `content_description` | `string \| null` | yes | - |
| `metadata` | `object` | yes | - |
| `created_at` | `string` | yes | ISO 8601 timestamp. |
| `updated_at` | `string` | yes | ISO 8601 timestamp. |
| `genre_ids` | `integer[]` | yes | - |
| `developer_ids` | `integer[]` | yes | - |
| `publisher_ids` | `integer[]` | yes | - |
| `media` | `(object (StoreGameMedia))[]` | yes | - |
| `media[].id` | `string<uuid>` | yes | - |
| `media[].kind` | `string` | yes | One of: `"header"`, `"main_capsule"`, `"small_capsule"`, `"hero_capsule"`, `"library_capsule"`, `"library_hero"` |
| `media[].width` | `integer \| null` | yes | - |
| `media[].height` | `integer \| null` | yes | - |
| `media[].updated_at` | `string` | yes | ISO 8601 timestamp. |
| `media[].url` | `string` | yes | Public asset URL (cache-busted with `?t=`). |
| `screenshots` | `(object (StoreGameScreenshot))[]` | yes | - |
| `screenshots[].id` | `string<uuid>` | yes | - |
| `screenshots[].width` | `integer \| null` | yes | - |
| `screenshots[].height` | `integer \| null` | yes | - |
| `screenshots[].updated_at` | `string` | yes | ISO 8601 timestamp. |
| `screenshots[].url` | `string` | yes | - |
| `screenshots[].thumbnail_url` | `string` | yes | - |

## Errors

### 400

Request validation failed.

- Header `x-request-id`: Request identifier; quote it when reporting an error.
Content type: `application/json`

Schema: `object (ValidationErrorBody)`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | `boolean` | yes | One of: `false` |
| `error` | `object` | yes | - |
| `error.name` | `string` | yes | One of: `"ZodError"` |
| `error.issues` | `object[]` | yes | - |
| `error.issues[].code` | `string` | yes | - |
| `error.issues[].path` | `(string \| number)[]` | yes | - |
| `error.issues[].message` | `string` | yes | - |

**Request validation**

```json
{
  "success": false,
  "error": {
    "name": "ZodError",
    "issues": [
      {
        "code": "custom",
        "path": [
          "field"
        ],
        "message": "Invalid value"
      }
    ]
  }
}
```

### 404

`game_not_found`.

- Header `x-request-id`: Request identifier; quote it when reporting an error.
Content type: `application/json`

Schema: `object (ErrorBody)`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes | Stable machine-readable error code, e.g. `forbidden`, `not_found`. |
| `details` | `any` | no | Optional structured context. For 403 it is `{ perm }`. |

**Error response**

```json
{
  "error": "game_not_found"
}
```

### 500

Unexpected server error (`internal`). No details are returned.

- Header `x-request-id`: Request identifier; quote it when reporting an error.
Content type: `application/json`

Schema: `object (ErrorBody)`, fields as described above.

**Error response**

```json
{
  "error": "internal"
}
```

## Examples

### curl

```bash
curl -X GET 'http://localhost:8787/v1/public/store/games/example-game'
```

### TypeScript

```ts
const response = await fetch("http://localhost:8787/v1/public/store/games/example-game", {
  method: "GET",
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const data = response.status === 204 || response.status === 205
  ? undefined
  : response.headers.get("content-type")?.includes("json")
    ? await response.json()
    : await response.text();
```
