# Routing API
> Driving routes with distance, duration and geometry, distance/duration matrices for up to 25 points, and nearest-road snapping — on the global OpenStreetMap road network. Coordinates are simple lat,lon pairs.

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

## Pricing
- **Free** (Free) — 2,500 calls/Mo, 2 req/s
- **Basic** ($15/Mo) — 40,000 calls/Mo, 8 req/s
- **Pro** ($45/Mo) — 175,000 calls/Mo, 20 req/s
- **Mega** ($129/Mo) — 700,000 calls/Mo, 50 req/s

## Endpoints

### Routing

#### `GET /v1/matrix` — Distance/duration matrix

**Parameters:**
- `points` (query, required, string) — 2-25 lat,lon pairs (; separated) Example: `52.517,13.388;52.520,13.405;52.529,13.397`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/routing-api/v1/matrix?points=52.517%2C13.388%3B52.520%2C13.405%3B52.529%2C13.397"
```

**Response:**
```json
{
    "data": {
        "count": 3,
        "profile": "driving",
        "distances_m": [
            [
                0,
                1732.7,
                2067.4
            ],
            [
                1258.2,
                0,
                1600.6
            ],
            [
                1888.7,
                1792.2,
                0
            ]
        ],
        "durations_s": [
            [
                0,
                209.1,
                296.7
            ],
            [
                127,
                0,
                264.6
            ],
            [
                262.6,
                312.6,
                0
            ]
        ]
    },
    "meta": {
        "timestamp": "2026-05-30T01:47:48.065Z",
        "request_id": "9d5e3421-65bb-4355-a56c-5974ec40a7c1"
    },
    "status": "ok",
    "message": "Matrix retrieved successfully",
    "success": true
}
```

#### `GET /v1/nearest` — Snap to nearest road

**Parameters:**
- `point` (query, required, string) — lat,lon Example: `52.517,13.388`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/routing-api/v1/nearest?point=52.517%2C13.388"
```

**Response:**
```json
{
    "data": {
        "name": "Unter den Linden",
        "location": [
            13.387983,
            52.517094
        ],
        "distance_m": 11
    },
    "meta": {
        "timestamp": "2026-05-30T01:47:48.501Z",
        "request_id": "860a1367-e49d-43ab-88fb-959d7c9ff83a"
    },
    "status": "ok",
    "message": "Nearest road retrieved successfully",
    "success": true
}
```

#### `GET /v1/route` — Driving route between points

**Parameters:**
- `from` (query, required, string) — Start lat,lon Example: `52.517,13.388`
- `to` (query, required, string) — End lat,lon Example: `52.529,13.397`
- `waypoints` (query, optional, string) — Intermediate lat,lon;... 
- `steps` (query, optional, string) — Include turn-by-turn (true) Example: `false`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/routing-api/v1/route?from=52.517%2C13.388&to=52.529%2C13.397&steps=false"
```

**Response:**
```json
{
    "data": {
        "profile": "driving",
        "geometry": {
            "type": "LineString",
            "coordinates": [
                [
                    13.387983,
                    52.517094
                ],
                [
                    13.38576,
                    52.516951
                ],
                [
                    13.385206,
                    52.520105
                ],
                [
                    13.388021,
                    52.521765
                ],
                [
                    13.387228,
                    52.527168
                ],
                [
                    13.393668,
                    52.528491
                ],
                [
                    13.396829,
                    52.52926
                ]
            ]
        },
        "waypoints": [
            {
                "name": "Unter den Linden",
                "location": [
                    13.387983,
                    52.517094
                ]
            },
            {
                "name": "Torstraße",
                "location": [
                    13.396829,
                    52.52926
                ]
            }
        ],
        "distance_m": 2067,
        "duration_s": 297
    },
    "meta": {
        "timestamp": "2026-05-30T01:47:48.888Z",
        "request_id": "e9d58381-5190-4a43-8a06-a8f9700931eb"
    },
    "status": "ok",
    "message": "Route retrieved successfully",
    "success
…(truncated, see openapi.json for full schema)
```


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