# Geo Distance API
> A fast, fully-local great-circle geospatial toolkit: compute the haversine distance between two coordinates (in km, m, miles or nautical miles), the initial and final compass bearing, the geographic midpoint, the destination point reached from an origin on a bearing at a given distance, and a bounding box around a center for a radius. Pure server-side compute, no third-party upstream, so responses are instant and always available. Ideal for logistics, delivery and fleet apps, store locators, real-estate search, travel and mapping tools.

## 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/geo-api/..."
```

## Pricing
- **Free** (Free) — 9,000 calls/Mo, 3 req/s
- **Basic** ($5/Mo) — 110,000 calls/Mo, 12 req/s
- **Pro** ($17/Mo) — 600,000 calls/Mo, 40 req/s
- **Mega** ($46/Mo) — 3,500,000 calls/Mo, 120 req/s

## Endpoints

### Geo

#### `GET /v1/bbox` — Bounding box

**Parameters:**
- `center` (query, required, string) — Center "lat,lon" Example: `52.520,13.405`
- `radius` (query, required, string) — Radius Example: `10`
- `unit` (query, optional, string) — km, m, mi, nmi Example: `km`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/geo-api/v1/bbox?center=52.520%2C13.405&radius=10&unit=km"
```

**Response:**
```json
{
    "data": {
        "bbox": {
            "max_lat": 52.609932,
            "max_lon": 13.552797,
            "min_lat": 52.430068,
            "min_lon": 13.257203
        },
        "unit": "km",
        "center": {
            "lat": 52.52,
            "lon": 13.405
        },
        "radius": 10
    },
    "meta": {
        "timestamp": "2026-05-30T09:00:25.299Z",
        "request_id": "b2332b35-8075-4362-b88c-1713a705a2bc"
    },
    "status": "ok",
    "message": "Bounding box computed",
    "success": true
}
```

#### `GET /v1/bearing` — Compass bearing

**Parameters:**
- `from` (query, required, string) — Origin "lat,lon" Example: `52.520,13.405`
- `to` (query, required, string) — Destination "lat,lon" Example: `48.857,2.352`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/geo-api/v1/bearing?from=52.520%2C13.405&to=48.857%2C2.352"
```

**Response:**
```json
{
    "data": {
        "to": {
            "lat": 48.857,
            "lon": 2.352
        },
        "from": {
            "lat": 52.52,
            "lon": 13.405
        },
        "compass": "WSW",
        "final_bearing": 238.18,
        "initial_bearing": 246.75
    },
    "meta": {
        "timestamp": "2026-05-30T09:00:25.348Z",
        "request_id": "e1f8c971-1ba0-467d-8843-3fd50fb10d77"
    },
    "status": "ok",
    "message": "Bearing computed",
    "success": true
}
```

#### `GET /v1/destination` — Destination point

**Parameters:**
- `from` (query, required, string) — Origin "lat,lon" Example: `52.520,13.405`
- `bearing` (query, required, string) — Bearing 0-360 Example: `90`
- `distance` (query, required, string) — Distance Example: `100`
- `unit` (query, optional, string) — km, m, mi, nmi Example: `km`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/geo-api/v1/destination?from=52.520%2C13.405&bearing=90&distance=100&unit=km"
```

**Response:**
```json
{
    "data": {
        "from": {
            "lat": 52.52,
            "lon": 13.405
        },
        "unit": "km",
        "bearing": 90,
        "distance": 100,
        "destination": {
            "lat": 52.510796,
            "lon": 14.882761
        }
    },
    "meta": {
        "timestamp": "2026-05-30T09:00:25.429Z",
        "request_id": "e6a91f57-c2ca-4341-a11a-49a697a5fbad"
    },
    "status": "ok",
    "message": "Destination computed",
    "success": true
}
```

#### `GET /v1/distance` — Great-circle distance

**Parameters:**
- `from` (query, required, string) — Origin "lat,lon" Example: `52.520,13.405`
- `to` (query, required, string) — Destination "lat,lon" Example: `48.857,2.352`
- `unit` (query, optional, string) — km, m, mi, nmi Example: `km`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/geo-api/v1/distance?from=52.520%2C13.405&to=48.857%2C2.352&unit=km"
```

**Response:**
```json
{
    "data": {
        "to": {
            "lat": 48.857,
            "lon": 2.352
        },
        "from": {
            "lat": 52.52,
            "lon": 13.405
        },
        "unit": "km",
        "bearing": 246.75,
        "distance": 877.4535
    },
    "meta": {
        "timestamp": "2026-05-30T09:00:25.517Z",
        "request_id": "9e0c1b09-e4a2-42e5-965d-e7aa575c5635"
    },
    "status": "ok",
    "message": "Distance computed",
    "success": true
}
```

#### `GET /v1/midpoint` — Geographic midpoint

**Parameters:**
- `from` (query, required, string) — Origin "lat,lon" Example: `52.520,13.405`
- `to` (query, required, string) — Destination "lat,lon" Example: `48.857,2.352`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/geo-api/v1/midpoint?from=52.520%2C13.405&to=48.857%2C2.352"
```

**Response:**
```json
{
    "data": {
        "to": {
            "lat": 48.857,
            "lon": 2.352
        },
        "from": {
            "lat": 52.52,
            "lon": 13.405
        },
        "midpoint": {
            "lat": 50.819089,
            "lon": 7.66201
        }
    },
    "meta": {
        "timestamp": "2026-05-30T09:00:25.599Z",
        "request_id": "58be2ffd-4604-43fd-80d1-2f7858dee173"
    },
    "status": "ok",
    "message": "Midpoint computed",
    "success": true
}
```


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