# Geohash API
> Work with geohashes through a fast, fully-local API. Encode a latitude/longitude pair into a geohash at any precision (1–12), decode a geohash back to its centre coordinates with the exact bounding box and error margins, list the eight neighbouring geohash cells (north, north-east, east and so on), or get the bounding box, centre and dimensions of a cell. Geohashes turn coordinates into short sortable strings that are perfect for spatial indexing, proximity grouping and map tiling. Pure server-side computation with no third-party upstream, so responses are instant and the service is always available. Ideal for geospatial indexing and search, proximity and nearby queries, map tiles and clustering, IoT and fleet tracking, and location bucketing in databases.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/geohash-api/..."
```

## Pricing
- **Free** (Free) — 8,000 calls/Mo, 3 req/s
- **Basic** ($2/Mo) — 150,000 calls/Mo, 12 req/s
- **Pro** ($6/Mo) — 1,200,000 calls/Mo, 40 req/s
- **Mega** ($16/Mo) — 9,000,000 calls/Mo, 120 req/s

## Endpoints

### Geohash

#### `GET /v1/bbox` — Bounding box of a cell

**Parameters:**
- `geohash` (query, required, string) — A geohash string Example: `u33dc0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/geohash-api/v1/bbox?geohash=u33dc0"
```

#### `GET /v1/decode` — Geohash to coordinates + bbox

**Parameters:**
- `geohash` (query, required, string) — A geohash string Example: `u4pruydqqvj`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/geohash-api/v1/decode?geohash=u4pruydqqvj"
```

#### `GET /v1/encode` — Coordinates to geohash

**Parameters:**
- `lat` (query, required, string) — Latitude -90..90 Example: `52.52`
- `lon` (query, required, string) — Longitude -180..180 Example: `13.405`
- `precision` (query, optional, string) — Length 1-12 (default 9) Example: `8`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/geohash-api/v1/encode?lat=52.52&lon=13.405&precision=8"
```

#### `GET /v1/neighbors` — The 8 neighbouring cells

**Parameters:**
- `geohash` (query, required, string) — A geohash string Example: `u33dc0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/geohash-api/v1/neighbors?geohash=u33dc0"
```


---
Marketplace page: https://www.oanor.com/api/geohash-api
OpenAPI spec: https://www.oanor.com/api/geohash-api/openapi.json
