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#

  • GET JSON
  • POST JSON
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#

  • GET JSON
  • POST JSON

Code

Description

Request Level Parameters

id

The License Key issued by Melissa.

opt

Set Options

arriveAt

avoid

departAt

routeType

traffic

travelMode

Vehicle-Specific Parameters

vehicleCommercial

vehicleHeight

vehicleLength

vehicleMaxSpeed

vehicleWeight

t

Optional. Transmission reference. Serves as a unique request identifier. It is returned as sent.

units

This specifies the returned distance unit scale. Use mi for miles and km for kilometers.

Record Level Parameters

endLatitude

The street route starting latitude.

endLongitude

The street route ending longitude.

startLatitude

The street route starting latitude.

startLongitude

The street route starting longitude.

Code

Description

Request Level Parameters

CustomerID

The License Key issued by Melissa.

Options

Set Options

arriveAt

avoid

departAt

routeType

traffic

travelMode

Vehicle-Specific Parameters

vehicleCommercial

vehicleHeight

vehicleLength

vehicleMaxSpeed

vehicleWeight

TransmissionReference

Optional. Transmission reference. Serves as a unique request identifier. It is returned as sent.

Units

This specifies the returned distance unit scale. Use mi for miles and km for kilometers.

Record Level Parameters

EndLatitude

The street route starting latitude.

EndLongitude

The street route ending longitude.

RecordID

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

The street route starting latitude.

StartLongitude

The street route starting longitude.

Headers#

  • GET JSON
  • POST JSON
Content-Type: application/json; charset=utf-8
Accept: application/json
Content-Type: application/json; charset=utf-8
Accept: application/json

Response#

  • GET JSON
  • POST JSON
{
    "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#

  • GET JSON
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#

  • GET JSON

Code

Description

Request Level Parameters

id

The License Key issued by Melissa.

opt

Set Options

arriveAt

avoid

departAt

routeType

traffic

travelMode

Vehicle-Specific Parameters

vehicleCommercial

vehicleHeight

vehicleLength

vehicleMaxSpeed

vehicleWeight

t

Optional. Transmission reference. Serves as a unique request identifier. It is returned as sent.

units

This specifies the returned distance unit scale. Use mi for miles and km for kilometers.

Record Level Parameters

points

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: lat1,long1:lat2,long2:lat3,long3:lat4,long4 calculated the time and distance between starting point 1 and destination 4 with stops 2 and 3 in between.

Headers#

  • GET JSON
Content-Type: application/json; charset=utf-8
Accept: application/json

Response#

  • GET JSON
{
    "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

<yyyy-mm-ddThh:mm:ss.mmmZ>

Specify the arrival date and time in ISO 8601 UTC.

avoid#

Specify the types of transport obstacles to avoid.

Parameter

Description

borderCrossings

Avoids border crossings.

ferries

Avoids ferries.

tollRoads

Avoids toll roads.

tunnels

Avoids tunnels.

unpavedRoads

Avoids unpaved roads.

departAt#

Specify the departure time.

Parameter

Description

<yyyy-mm-ddThh:mm:ss.mmmZ>

Specify the departure date and time in ISO 8601 UTC.

now

Default. Departs immediately.

routeType#

Specify the type of route.

Parameter

Description

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#

Parameter

Description

false

Disregards current traffic conditions.

true

Default. Considers current traffic conditions.

travelMode#

Specify the type of vehicle used for the travel mode.

Parameter

Description

bicycle

Uses bicycle as the travel mode.

car

Default. Uses car as the travel mode.

pedestrian

Uses walking as the travel mode.

vehicleCommercial#

Specifies if the vehicle is commercial.

Parameter

Description

false

Default. The vehicle is not commercial.

true

The vehicle is commercial.

vehicleHeight#

Specifies the vehicle height in meters. There are no height restrictions.

Parameter

Description

<float>

Vehicle height in meters.

0

Default. Vehicle height in meters.

vehicleLength#

Specifies the vehicle length in meters.

Parameter

Description

<float>

Vehicle length in meters.

0

Default. Vehicle length in meters.

vehicleMaxSpeed#

Specifies the maximum vehicle speed in km/hr.

Parameter

Description

<integer>

Vehicle max speed in km/hr.

0

Default. Vehicle max speed in km/hr.

vehicleWeight#

Specifies the vehicle weight in kilograms. Minimum value: 1.

Parameter

Description

<integer>

Vehicle weight in kg.

0

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 1 for a single request, otherwise it serves as an index of the array of records.

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 hh:mm:ss.

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

SR01

Distance Calculated

Route distance was calculated successfully.

SR11

Input Error

Input or syntax error. The distance calculation could not be performed.

SR12

Distance Not Calculated

Route distance could not be calculated.