---
title: "Route Report"
method: POST
path: "/route_report"
tags: ["Routing"]
---

# Route Report

`POST /route_report`

## Query parameters

- `key` string, 32 character alphanumeric string, required

## Request body

- object
  - `original_shape` string, required — Takes a route geometry as input and returns the route details. Accepts polyline and polyline6 encoded geometry as input. **Note**: Route geometries generated from sources other than [NextBillion.ai](http://NextBillion.ai) services, are not supported in this version.
  - `original_shape_type` 'polyline' | 'polyline6', required — Specify the encoding type of route geometry provided in original_shape input. Please note that an error is returned when this parameter is not specified while an input is added to original_shape parameter.

## Response `200`

- object
  - `status` string — A string indicating the state of the response. On normal responses, the value will be Ok. Indicative HTTP error codes are returned for different errors. See the [**API Errors Codes**](https://app.reapi.com/ws/hmx8aL45B5jjrJa8/p/vNNilNksLVz675pI/s/ealJmVGjTQv4x5Wi/edit/path/VYzo7gOlRsQQZo0U#api-error-codes) section below for more information.
  - `geometry` string[] — An array of objects returning encoded geometry of the routes. Each object represents an individual route in the input.
  - `mileage` object[] — Returns the details of route segments in each state or country that the route passes through. Each object represents an individual route in the input request.
    - `summary` object — Returns a summary of distances that the route covers in different states and countries.
      - `state` object — A break up of state-wise distances that the route covers specified in key:value pair format.
      - `country` object — A break up of country-wise distances that the route covers in key:value pair format.
    - `segment` object — Returns the details of road segments that the route covers in different states and countries.
      - `state` object[] — An array of objects containing state-wise break up of the route segments. Each object returns the segment details of a different state.
        - `offset` integer — Represents the index value of the vertex of current segment's starting point in route geometry. First vertex in the route geometry has an offset of 0.
        - `length` integer — Represents a sequence of ‘n’ consecutive vertices in the route geometry starting from the offset, forming a continuous section of route with a distance indicated in distancefield.
        - `distance` number — Represents the real distance of this segment, in meters.
        - `value` string — Returns the name of the state in which the segment lies.
      - `country` object[] — An array of objects containing country-wise break up of the route segments. Each object returns the segment details of a different country.
        - `offset` integer — Represents the index value of the vertex of current segment's starting point in route geometry. First vertex in the route geometry has an offset of 0.
        - `length` integer — Represents a sequence of ‘n’ consecutive vertices in the route geometry starting from the offset, forming a continuous section of route with a distance indicated in distancefield.
        - `distance` number — Represents the total distance of this segment, in meters.
        - `value` string — Returns the name of the country in which the segment lies.
  - `road_summary` object[] — An array of objects returning a summary of the route with information about tolls, bridges, tunnels, segments, maximum speeds and more. Each array represents an individual route in the input request.
    - `summary` object — Returns an overview of the route with information about trip distance, duration and road class details among others.
      - `has_toll` boolean — A boolean value indicating if there are any tolls in the given route.
      - `has_bridge` boolean — A boolean value indicating if there are any bridges in the given route.
      - `has_tunnel` boolean — A boolean value indicating if there are any tunnels in the given route.
      - `has_roundabout` boolean — A boolean value indicating if there are any roundabouts in the given route.
      - `duration` number — Returns the total duration of the route, in seconds.
      - `distance` number — Returns the total distance of the route , in meters.
      - `toll_distance` number — Returns the total distance travelled on toll roads. This field is present in the response only when the has_toll property is true.
      - `road_class` object — An object with details about the different types of road classes that the route goes through. Distance traversed on a given road class is also returned. The contents of this object follow the key:value pair format.
    - `segment` object — Returns the segment-wise road class and max speed information of the route.
      - `road_class` object[] — An array of objects returning the details of road segments belonging to different road classes that the route goes through. Each object refers to a unique road class.
        - `offset` integer — Represents the index value of the vertex of current segment's starting point in route geometry. First vertex in the route geometry has an offset of 0.
        - `length` integer — Represents a sequence of ‘n’ consecutive vertices in the route geometry starting from the offset, forming a continuous section of route with a distance indicated in distancefield.
        - `distance` integer — Returns the total distance of this segment, in meters.
        - `value` string — Returns the road class name to which the segment belongs.
      - `max_speed` object[] — An array of objects returning the maximum speed of different segments that the route goes through.
        - `offset` integer — Represents the index value of the vertex of current segment's starting point in route geometry. First vertex in the route geometry has an offset of 0.
        - `length` integer — Represents a sequence of ‘n’ consecutive vertices in the route geometry starting from the offset, forming a continuous section of route where the maximum speed is same and is indicated in value.
        - `distance` integer — Returns the total distance of this segment, in meters.
        - `value` integer — Denotes the maximum speed of this segment, in kilometers per hour. - A value of “-1” indicates that the speed is unlimited for this road segment. - A value of “0” indicates that there is no information about the maximum speed for this road segment.
  - `msg` string — Displays the error message in case of a failed request or operation. Please note that this parameter is not returned in the response in case of a successful request.

---

[API](https://skmtc.net/nextbillion-ai/apis/one-spec-service.md) · [All operations](https://skmtc.net/nextbillion-ai/apis/one-spec-service/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nextbillion-ai/one-spec-service/versions/b647f1808dda/schema)
