Reference Guide#
Introduction#
Welcome to the Street Route service documentation.
Base URL#
https://streetroute.melissadata.net/
Licensing#
The License Key is a software key required to use the web service. You will receive your license key from your Melissa representative. If you don’t have a license key, contact the Melissa sales team by Requesting a Demo or by calling 800-MELISSA ext. 3 (800-635-4772 ext. 3). Without a license key, Street Route will not function.
To set the license key, use the id/CustomerID property in your requests.
Endpoints#
v1/WEB/StreetRoute/getDistance#
Find the distance and general drive time between two points.
Try It Now#
curl -X GET "https://streetroute.melissadata.net/v1/WEB/StreetRoute/getDistance?\
&id={{customerId}}\
&opt=avoid:tunnels,routeType:shortest\
&t=Test\
&units=\
&endLatitude=33.649870\
&endLongitude=-117.582960\
&format=JSON\
&startLatitude=33.637520\
&startLongitude=-117.606920" \
-H "Content-Type:application/json" \
-H "Accept:application/json"
curl -X POST "http://StreetRoute.melissadata.net/V4/WEB/StreetRoute/doStreetRoute" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"CustomerID":{{customerId}},
"Options":"avoid:tunnels,routeType:shortest",
"Records":[{
"EndLatitude":"",
"EndLongitude":"",
"RecordID":"",
"StartLatitude":"",
"StartLongitude":""
},
{
"EndLatitude":"",
"EndLongitude":"",
"RecordID":"",
"StartLatitude":"",
"StartLongitude":""
}],
"TransmissionReference":"Test",
"Units":""
}'
Request Parameters#
Code |
Description |
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Request Level Parameters |
|||||||||||||||
|
The License Key issued by Melissa. |
||||||||||||||
|
|
||||||||||||||
|
Optional. Transmission reference. Serves as a unique request identifier. It is returned as sent. |
||||||||||||||
|
This specifies the returned distance unit scale. Use |
||||||||||||||
Record Level Parameters |
|||||||||||||||
|
The street route starting latitude. |
||||||||||||||
|
The street route ending longitude. |
||||||||||||||
|
The street route starting latitude. |
||||||||||||||
|
The street route starting longitude. |
Code |
Description |
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Request Level Parameters |
|||||||||||||||
|
The License Key issued by Melissa. |
||||||||||||||
|
|
||||||||||||||
|
Optional. Transmission reference. Serves as a unique request identifier. It is returned as sent. |
||||||||||||||
|
This specifies the returned distance unit scale. Use |
||||||||||||||
Record Level Parameters |
|||||||||||||||
|
The street route starting latitude. |
||||||||||||||
|
The street route ending longitude. |
||||||||||||||
|
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. |
||||||||||||||
|
The street route starting latitude. |
||||||||||||||
|
The street route starting longitude. |
Headers#
Content-Type: application/json; charset=utf-8
Accept: application/json
Content-Type: application/json; charset=utf-8
Accept: application/json
Response#
{
"Results": "SR01",
"Units": "mi",
"TransmissionResult": "",
"TravelTime": "00:05:05",
"TotalDrivingDistance": "1.866595",
"TransmissionReference": "Test",
"Version": "1.4.1.0"
}
{
"Version": "1.4.1.0",
"Units": "mi",
"TransmissionReference": "Test",
"TransmissionResult": "",
"TotalRecords": "2",
"Records": [
{
"RecordID": "",
"Results": "SR12",
"TravelTime": "",
"TotalDrivingDistance": ""
},
{
"RecordID": "",
"Results": "SR12",
"TravelTime": "",
"TotalDrivingDistance": ""
}
]
}
See Response Fields for Response field definitions.
v1/WEB/StreetRoute/getDistanceMultipoint#
Find the distance and general drive time between a start point and destination point with one or more waypoints. getDistanceMultipoint is currently available only as a GET request.
Try It Now#
curl -X GET "https://streetroute.melissadata.net/v1/WEB/StreetRoute/getDistanceMultipoint?\
&id={{customerId}}\
&opt=avoid:tunnels\
&t=Test\
&units=mi\
&points=42.211479,-70.999908:42.201926,-71.007090:42.211848, -71.019438:42.214976, -71.0045472" \
-H "Content-Type:application/json" \
-H "Accept:application/json"
Request Parameters#
Code |
Description |
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Request Level Parameters |
|||||||||||||||
|
The License Key issued by Melissa. |
||||||||||||||
|
|
||||||||||||||
|
Optional. Transmission reference. Serves as a unique request identifier. It is returned as sent. |
||||||||||||||
|
This specifies the returned distance unit scale. Use |
||||||||||||||
Record Level Parameters |
|||||||||||||||
|
Required. Points are a series of Latitude,Longitude sets. Each Latitude is separated from its Longitude by the standard comma. Each set is delimited by a colon, for example: |
Headers#
Content-Type: application/json; charset=utf-8
Accept: application/json
Response#
{
"Results": "SR01",
"Units": "mi",
"TransmissionResult": "Test",
"TravelTime": "00:56:19",
"TotalDrivingDistance": "20.513909",
"TransmissionReference": "multipoint_test",
"Version": "1.5.1.0"
}
Options#
List options in the following format, with multiple options delimited with a ,
. These options are case-sensitive and camel case.
optionName:parameter,optionName:parameter
arriveAt#
Specify the arrival time.
Parameter |
Description |
---|---|
|
Specify the arrival date and time in ISO 8601 UTC. |
avoid#
Specify the types of transport obstacles to avoid.
Parameter |
Description |
---|---|
|
Avoids border crossings. |
|
Avoids ferries. |
|
Avoids toll roads. |
|
Avoids tunnels. |
|
Avoids unpaved roads. |
departAt#
Specify the departure time.
Parameter |
Description |
---|---|
|
Specify the departure date and time in ISO 8601 UTC. |
|
Default. Departs immediately. |
routeType#
Specify the type of route.
Parameter |
Description |
---|---|
|
Balances travel time and fuel efficiency. |
|
Optimizes for fastest travel time. |
|
Optimizes for shortest travel distance. |
|
Optimized for challenging, hilly, or winding routes. |
traffic#
Parameter |
Description |
---|---|
|
Disregards current traffic conditions. |
|
Default. Considers current traffic conditions. |
travelMode#
Specify the type of vehicle used for the travel mode.
Parameter |
Description |
---|---|
|
Uses bicycle as the travel mode. |
|
Default. Uses car as the travel mode. |
|
Uses walking as the travel mode. |
vehicleCommercial#
Specifies if the vehicle is commercial.
Parameter |
Description |
---|---|
|
Default. The vehicle is not commercial. |
|
The vehicle is commercial. |
vehicleHeight#
Specifies the vehicle height in meters. There are no height restrictions.
Parameter |
Description |
---|---|
|
Vehicle height in meters. |
|
Default. Vehicle height in meters. |
vehicleLength#
Specifies the vehicle length in meters.
Parameter |
Description |
---|---|
|
Vehicle length in meters. |
|
Default. Vehicle length in meters. |
vehicleMaxSpeed#
Specifies the maximum vehicle speed in km/hr.
Parameter |
Description |
---|---|
|
Vehicle max speed in km/hr. |
|
Default. Vehicle max speed in km/hr. |
vehicleWeight#
Specifies the vehicle weight in kilograms. Minimum value: 1
.
Parameter |
Description |
---|---|
|
Vehicle weight in kg. |
|
Default. Vehicle weight in kg. |
Response Fields#
Service Level Response Fields#
Output Name |
Description |
---|---|
TotalRecords |
Total number of records. |
TransmissionReference |
A pass-through of the input TransmissionReference field. |
TransmissionResults |
Lists error codes from any errors caused by the most recent request as a whole. |
Units |
This is a string value that is the set unit of measurment for the TotalDrivingDistance field. |
Version |
The current service version number. |
Record Level Response Fields#
Output Name |
Description |
---|---|
RecordID |
The number of the record.
Always |
Results |
Comma delimited status, error codes, and change codes for the record. |
Total Driving Distance |
This is a string value with the total driving distance. Refer to the Units field to know what unit of measurement it is. |
Travel Time |
This is a string value of the travel time for the record in the format |
Result Codes#
Melissa products use a result code system to indicate data quality; the status and any errors. These result codes are four-character codes (two letters followed by two numbers), delimited by commas. Result code definitions are shared among Melissa Data products.
Understanding the Code#
To fully understand result codes, you need to know them. Knowing what codes are possible and what they indicate will be key in building an effective application. It is useful to know all the codes, but this does not necessarily mean you will use them all. Just because you have a toolbox, doesn’t mean you will also try to use a screwdriver along with a hammer on a nail.
Code |
Short Description |
Long Description |
---|---|---|
SR - Street Route |
||
|
Distance Calculated |
Route distance was calculated successfully. |
|
Input Error |
Input or syntax error. The distance calculation could not be performed. |
|
Distance Not Calculated |
Route distance could not be calculated. |