> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opengame.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Country

> The country a player connects from, as a two-letter ISO code. A game never gets the player's region, city or address.

The country a player connects from, as a two-letter ISO code. A game never gets the region, city or address.

[Authentication](https://docs.opengame.io/api-reference/authentication.md) covers each credential, and [errors](https://docs.opengame.io/api-reference/errors.md) covers the JSON error body.

## Read the player's country

`GET https://api.opengame.gg/v1/geo`

**Authentication:** None.

Read from the connection where it reaches OpenGame. Country only: never region, city or address. Not cached and not rate limited. A browser can read it only from a live game host or a live private preview.

### Request

```bash cURL theme={"system"}
curl --request GET \
  --url 'https://api.opengame.gg/v1/geo'
```

### Response 200

An ISO country code, or null.

```json theme={"system"}
{
  "country": "GB"
}
```

| Field | Required | Type |
| - | - | - |
| `country` | yes | string or null |

### Errors

| Status | Meaning |
| - | - |
| 403 | `preview_unavailable`: the private preview has ended or previews are off. `host_not_live`: this build is no longer served. Neither includes CORS headers. A non-GET from a preview gets `unavailable_in_preview`. |
| 405 | `method_not_allowed`. `Allow` lists `GET` and `OPTIONS`. |
| 500 | `internal_error`, only when OpenGame's own storage fails. Sent without CORS headers. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.