# Maps route get

`POST /maps/route` · Rivier · maps

A route through two to 25 points by car (optionally with live traffic), on foot or by bicycle: distance, time, the line (polyline6) and each leg.

- Scope: maps:read
- Mcp: rivier_maps_route
- Graphql: Query.mapsRouteGet
- Sdk: maps.route.get
- Cli: maps route get

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "points": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "lat": {
            "type": "number",
            "minimum": -90,
            "maximum": 90
          },
          "lng": {
            "type": "number",
            "minimum": -180,
            "maximum": 180
          }
        },
        "required": [
          "lat",
          "lng"
        ],
        "additionalProperties": false
      },
      "minItems": 2,
      "maxItems": 25
    },
    "mode": {
      "type": "string",
      "enum": [
        "driving",
        "driving-traffic",
        "walking",
        "cycling"
      ],
      "default": "driving",
      "description": "driving-traffic uses live traffic"
    }
  },
  "required": [
    "points"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/maps/route' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "points": [
    {
      "lat": 0,
      "lng": 0
    }
  ]
}'
```
