## IP geolocation database (`geoip`)

The IP geolocation database in use (provider > built-in), node rollout progress and address lookup.

Authentication: Admin only · Docs: https://www.gocdn888.com/en/docs/api/geoip

### GET `/api/v2/geoip`

Get IP geolocation database status · Authentication: Admin only

```sh
curl "https://panel.example.com/api/v2/geoip" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

### GET `/api/v2/geoip/lookup`

Look up an IP's geolocation · Authentication: Admin only

Query parameters:

| Field | Type | Required | Description |
|---|---|---|---|
| `ip` | string | Yes | IPv4 or IPv6 address. |

```sh
curl "https://panel.example.com/api/v2/geoip/lookup" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

IP geolocation database object:

| Field | Type | Required | Description |
|---|---|---|---|
| `active` | GeoipActive |  | The database currently delivered to nodes and the state of each source; empty sha256 means not resolved yet (nodes use the built-in database from their package). |
| `country` | string |  | Country/region code (ISO 3166-1 alpha-2), empty if unknown. |
| `coverage` | GeoipCoverage |  | Coverage comparison of the free and commercial tiers, carried by the license; a side without statistics is omitted (the page shows a dash), whether or not the commercial tier is enabled. |
| `found` | boolean |  | The address is in the database (at least one field has a value). |
| `ip` | string |  | The queried address. |
| `isp` | string |  | ISP code, empty if unknown. |
| `nodes` | GeoipNodes |  | Node rollout progress (by the database each node reports in its heartbeat). |
| `prov` | string |  | Province code (mainland China only), empty if unknown. |
| `region_enabled` | boolean |  | Always true. Province/carrier is open to the free edition too; the field is kept for older frontends. |
| `source` | string |  | Source of the database in use: provider (from the provider), builtin (built-in). Values: ["provider","builtin"] |
| `tier` | string |  | Tier currently delivered to nodes: biz (provider-delivered commercial database) or free (built-in). Values: ["free","biz"] |
| `version` | string |  | Version of the database in use. |
