---
title: "Get distance in batch"
method: POST
path: "/getDistance"
tags: ["Distance Retriever"]
---

# Get distance in batch

`POST /getDistance`

Submit a batch request to find the distance and general drive time between two points.

## Headers

- `Accept` 'application/json' | '*/*', required
- `Content-Type` 'application/json' | 'application/xml', required

## Request body

- object
  - `CustomerID` string, required — Required. The [License Key](https://docs.melissa.com/melissa/license/license-information.html) issued by Melissa.
  - `Options` string — [Options](https://docs.melissa.com/cloud-api/street-route/street-route-reference-guide.html#options) - List options in the following format, with multiple options delimited with a `,`. For example: `optionName:parameter,optionName:parameter`. These options are case-sensitive and camel case. - `arriveAt:< yyyy-mm-ddThh:mm:ss.mmmZ >` - Specify the arrival time ISO 8601 UTC. - `avoid:< borderCrossings | ferries | tollRoads | tunnels | unpavedRoads >` - Specify the types of transport obstacles to avoid. - `departAt:< yyyy-mm-ddThh:mm:ss.mmmZ | now >` - Specify the departure date and time in ISO 8601 UTC. Default is `now` - departs immediately. - `routeType:< eco | fastest | shortest | thrilling >` - Specify the type of route. - `eco` - Balances travel time and fuel efficiency. - `fastest` - Optimizes for fastest travel time. - `shortest` - Optimizes for shortest travel distance. - `thrilling` - Optimized for challenging, hilly, or winding routes. - `traffic:< false | true >` - Considers current traffic conditions. Default is `true`. - `travelMode:< bicycle | car | pedestrian >` - Specify the type of vehicle used for the travel mode. Default is `car`. - `vehicleCommercial:< false | true >` - Indicates if the vehicle is a commercial vehicle. Default is `false`. - `vehicleHeight:< [float] | 0 >` - Specifies the vehicle height in meters. There are no height restrictions. Default is `0`. - `vehicleLength:< [float] | 0 >` - Specifies the vehicle length in meters. Default is `0`. - `vehicleMaxSpeed:< [integer] | 0 >` - Specifies the maximum vehicle speed in km/hr. Default is `0`. - `vehicleWeight:< [integer] | 0 >` - Specifies the vehicle weight in kilograms. Minimum value is `1`.
  - `TransmissionReference` string — Transmission Reference - Serves as a unique request identifier. It is returned as sent.
  - `Units` 'mi' | 'km' — Units - This specifies the returned distance unit scale. Use `mi` for miles and `km` for kilometers.
  - `Records` object[], required — Array of request records.
    - `EndLatitude` string, float, required — Required. The street route ending latitude.
    - `EndLongitude` string, float, required — Required. The street route ending longitude.
    - `RecordID` string — This is a string value containing a unique identifier for the current record. Use this to match the record submitted with the record returned. It will return what is inputted.
    - `StartLatitude` string, float, required — Required. The street route starting latitude.
    - `StartLongitude` string, float, required — Required. The street route starting longitude.

## Response `200`

Default response from a POST request

- POSTResponse — Street Route POST Response
  - `Version` string — The current service version number.
  - `Units` string — This is a string value that is the set unit of measurement for the TotalDrivingDistance field.
  - `TransmissionReference` string — A pass-through of the input TransmissionReference field.
  - `TransmissionResults` string — Lists error codes from any errors caused by the most recent request as a whole. For more information, see [Street Route Result Codes](https://docs.melissa.com/cloud-api/street-route/result-codes.html).
  - `TotalRecords` string — Total number of records.
  - `Records` object[] — Array of output records.
    - `RecordID` string — The number of the record. Always `1` for a single request, otherwise it serves as an index of the array of records.
    - `Results` string — Comma delimited status, error codes, and change codes for the record. For more information, see [Street Route Result Codes](https://docs.melissa.com/cloud-api/street-route/result-codes.html).
    - `TravelTime` string — This is a string value of the travel time for the record in the format `hh:mm:ss`.
    - `TotalDrivingDistance` string — This is a string value with the total driving distance. Refer to the Units field to know what unit of measurement it is.

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/melissa/apis/street-route.md) · [All operations](https://skmtc.net/melissa/apis/street-route/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/melissa/street-route/revisions/5c7395095ce3/schema)
