# Distance Between Coordinates (`geo.distance`)

Great-circle distance between two latitude/longitude points in kilometres, miles and nautical miles, with the initial bearing.

- **Route:** `POST /v1/run/geo.distance`
- **Price:** $0.0002 per request ($0.20 per 1,000) · `cost_usd` on every response
- **Source:** GetAllAPIs compute (`compute`) · failover: no
- **Measured latency:** p50 0 ms · p95 0 ms · p99 0 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `from_lat` | number | yes |  | Latitude of the start |
| `from_lon` | number | yes |  | Longitude of the start |
| `to_lat` | number | yes |  | Latitude of the destination |
| `to_lon` | number | yes |  | Longitude of the destination |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `kilometers` | Distance in km. |
| `miles` | Distance in statute miles. |
| `nautical_miles` | Distance in nautical miles. |
| `initial_bearing_degrees` | Compass bearing at the start, 0-360. |
| `compass` | Eight-point compass direction. |
| `method` | How it is computed. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/geo.distance \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from_lat":48.8566,"from_lon":2.3522,"to_lat":40.7128,"to_lon":-74.006}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('geo.distance', {'from_lat': 48.8566, 'from_lon': 2.3522, 'to_lat': 40.7128, 'to_lon': -74.006})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run geo.distance '{"from_lat":48.8566,"from_lon":2.3522,"to_lat":40.7128,"to_lon":-74.006}'
```

Quote first (free, validates input): `POST /v1/quote/geo.distance` with the same body.
