This section describes how this API works. You may want to try it out with a Free Trial Account.
- HTTP Request
- URL Composition
- Base URL: https://api.cloud.precisely.com
- Travel Matrix API : /v1/matrix/location
- Supported Methods: GET and POST
- Rate Limit (Transactions per second): 100
-
Authentication and Input Fields: Data Integrity Suite's APIs provide multiple authentication methods. Whether you want to pass the API Key and Secret directly as part of the Basic Authentication header or use bearer tokens, you can do either using the same header. The two ways of authentication are:
- Basic Authentication (Using API Key and secret)
- Bearer Token Authentication
For more information about authentication, see How to Authenticate and follow the instructions.
- URL Composition
- Response
- Content-type: application/json
Query Parameters
This API takes these query parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
| coordOrder | String | No | Specifies the coordinate order used in the
request. Use If not specified the
coordinates are expected to be in the in
latitude, longitude
( This
parameter applies to the
|
| originAddresses | String | No | Address of the starting location for the
route. Multiple originAddresses
should be separated by a comma (,). Example:
|
| destinationAddresses | String | No | Address of the destination location for the
route. Multiple
destinationAddresses should
be separated by a comma (,). Example:
|
| origins | String | Yes | origins are the starting
point of your route. Ensure that
origins are routable land
locations. Multiple origins
should be separated by a comma (,). Format: latitude_1,longitude_1,latitude_2,longitude_2 Example: origins=41.349302,2.136480,41.389925,2.136258,41.357961,2.097878 |
| destinations | String | Yes | destinations are the ending
coordinates of your route. Ensure that
destinations are routable
land locations. Multiple
destinations should be
separated by a comma (,). Format: latitude_1,longitude_1, latitude_2,longitude_2 Example: destinations=41.349302,2.136480,41.389925,2.136258,41.357961,2.097878 |
| mode | String | No | Set which driving mode the service should use
to determine the distance and
duration values. For
example, if you use When truck_height = 214 centimeters truck_width = 183 centimeters truck_length = 519 centimeters truck_weight = 5000 kg If you want to specify custom truck
dimensions, use
Default: car Example: mode=car Allowed Values: car truck motorcycle bike walk |
| avoid | String | No | Set this parameter to find alternative routes
that bypass specified objects. Use a comma (,)
to separate multiple values. This is a flexible
filter; if no alternative routes exist, the
service will still provide a route that includes
the objects. For a strict filter, consider using
the exclude parameter. Note:
Format: value_1,value_2 Default: ferry Example: avoid=toll,highway,bbox:34.0635,-118.2547,34.0679,-118.2478 Allowed Values: toll, ferry, highway, service_road, uturn, sharp_turn, left_turn, right_turn, bbox, tunnel, none |
| exclude | String | No | This parameter serves as a mandatory filter,
ensuring the service returns only those routes
that strictly avoid the object(s) indicated.
Multiple values should be separated by a comma
(,). If no routes can be found that exclude the
specified object(s), the service will return a
4xx error. For a less strict filtering approach,
consider using the avoid
parameter. Note:
Format: value_1,value_2 Default: none Example: exclude= highway,toll,uturn Allowed Values: toll, ferry, highway, service_road, uturn, sharp_turn, left_turn, right_turn, none |
| approaches | String | No | A semicolon-separated list indicating the
side of the road from which the route will
approach destinations. When
set to The number of values provided must be equal
to the number of
The values provided for the
Format: approaches_1;approaches_2;approaches_3 Default: unrestricted Example: approaches=unrestricted;curb;;unrestricted Allowed Values: unrestricted, curb |
| option | String | Yes | Use this option to switch to truck-specific
routing or time based routing or if you want to
choose between the fastest and shortest route
types. Example: option=flexible Allowed Values: flexible |
| departure_time | Integer | No | Use this parameter to set a departure time
for your trip using a UNIX timestamp in seconds
precision. The response will return a route
based on typical traffic conditions at the given
start time and week day.
Note: The timestamp must be supplied in the API
as a UTC time (Universal Time Coordinated)
and will be converted to the time zone of
input co-ordinates being sent in origins.
Use an UNIX
timestamp converter to convert
values to and from UNIX timestamps.
Example: departure_time=1759154400 translates to Monday, September 29, 2025 14:00:00 UTC. If the origin coordinate sent in the request is for Kansas USA, the local time used by the API will be Monday, 29 September 2025 09:00:00 since Kansas is 5 hours behind UTC. If the requested origin is for Athens in Greece, then the local time used by the API will be Monday, 29 September 2025 16:00:00 since Greece is 2 hours ahead of UTC. Note: The
departure_time and
local_departure_time
parameters are mutually exclusive. You must
use either departure_time
or local_departure_time. If
neither parameter is specified, then the
traffic conditions at the UTC time of making
the request are considered. |
| local_departure_time | String | No | Use this parameter to set a departure time,
expressed as string representing the weekday and
hour of the local time at the departure point.
The response considers the typical traffic
conditions at the given weekday and hour and
returns a contour which can be reached under
those traffic conditions. Example:
departure_time = Monday
9:00 translates to Monday at
9am local time for all departure points. If
the origin coordinate sent in the request is
for New York USA, the local time used by the
API is 9am. If the requested origin is for
Athens in Greece, then the local time used
by the API is Monday 9am. The following
requests return the same isochrone for New
York at 9 am local time:
Note:
|
| truck_size | String | No | This defines the dimensions of a truck in
centimeters (cm). This parameter is effective
only when the
mode=truck.
Maximum dimensions are as follows: Height = 1000 cm Width = 5000 cm Length = 5000 cm Format: height,width,length Example: truck_size=200,210,600 |
| truck_weight | Integer | No | This parameter defines the weight of the
truck including trailers and shipped goods in
kilograms (kg). This parameter is effective only
when
mode=truck.
Minimum: 1 Maximum: 100000 Example: truck_weight=11770 |
| route_type | String | No | Set the route type that needs to be returned.
Default: fastest Example: route_type=fastest Allowed Values: fastest, shortest |
| cross_border | Boolean | No | Specify if crossing an international border
is expected for operations near border areas.
When set to false, the API will
prohibit routes crossing the borders. When set
to true, the service will
return routes which cross the borders between
countries, if required for the given set
destination and
waypoints. |
| truck_axle_load | Number | No | Specify the total load per axle (including
the weight of trailers and shipped goods) of the
truck, in tonnes. When used, the service will
return routes which are legally allowed to carry
the load specified per axle. Note: This
parameter is effective only when
`mode=truck`.
Example: 5.6 |
| hazmat_type | String | No | Specify the type of hazardous material being
carried and the service will avoid roads which
are not suitable for the type of goods
specified. Multiple values can be separated
using a comma (,) . Note: This parameter is effective only when
mode=truck.Example: hazmat_type=explosives , corrosive Allowed Values: explosives, gas, flammable_liquid, flammable_gas, organic, toxic, radioactive, corrosive, other |
| turn_angle_range | Integer | No | Specify the turn angles that can be taken
safely by the vehicle. The permissible turn
angles are calculated as (0 + turn_angle_range ,
360 - turn_angle_range). Note: This parameter is effective only when
avoid =
sharp_turn.Providing smaller angles might lead to 4xx errors as route engine might not be able find routes satisfying the smaller turn angle criteria for all turns in the route. |
| route_failed_prompt | Boolean | No | A prompt to modify the response in case no
feasible route is available for a given pair of
origin and destination. When set to
true a value of "-1" is
returned for those pairs in which:
However, a value of "0" is returned if both the origin and destination are snapped to the same location.
|
| bearings | String | No | Limits the search to segments with given
bearing in degrees towards true north in
clockwise direction. Each
bearing should be in the
format of degree,range, where
the degree should be a value
between (0, 360) and range
should be a value between (0, 180). Note: The number of
bearings should be
equal to the sum of the number of points
in origins and
destinations. If a
route can approach a destination from
any direction, the bearing for that
point can be specified as "0,180".
Format: degree0,range0;degree1,range1 Default: none Example: bearings=0,180;0,180 |
| emission_class |
String |
No | Specify the emission class to which the
vehicle (engine) belongs to. The service will
use this setting to generate routes that are
permissible for that engine class. Only the
emission classifications in the EU regions are
supported currently. Example: emission_class=euro2 , euro3 Allowed Values: euro0, euro1, euro2, euro3, euro4, euro5, euro6, euro7, euro8, euro9 |
origin,
destination, and
waypoints, or originAddress,
destinationAddress, and
waypointAddresses.Examples
Request
https://api.cloud.precisely.com/v1/matrix/location?mode=car&departure_time=1563254734&origins=41.349302,2.136480,41.389925,2.136258,41.357961,2.097878&destinations=41.349302,2.136480,41.389925,2.136258,41.357961,2.097878&exclude=none&approaches=unrestricted;unrestricted;unrestricted&truck_weight=11770&route_type=fastest&cross_border=false&route_failed_prompt=false&option=flexible&coordOrder=LatLonhttps://api.cloud.precisely.com/v1/matrix/location?option=flexible
{
"coordOrder": "LatLon",
"origins": "41.349302,2.136480|41.389925,2.136258|41.357961,2.097878",
"destinations": "41.349302,2.136480|41.389925,2.136258|41.357961,2.09787",
"mode": "car",
"avoid": "ferry",
"exclude": "none",
"approaches": "unrestricted;unrestricted;unrestricted",
"departure_time": 1563254734,
"route_type": "fastest",
"cross_border": false,
"route_failed_prompt": false
}https://api.cloud.precisely.com/v1/matrix/location?option=flexible
{
"originAddresses": [
{
"address": "675 S Broadway Suite 600, Denver, CO 80209, United States",
"country": "USA"
},
{
"address": "476 S Broadway, Denver, CO 80209, United States",
"country": "USA"
}
],
"destinationAddresses": [
{
"address": "383 S Pearl St, Denver, CO 80209, United States",
"country": "USA"
},
{
"address": "500 S Broadway, Denver, CO 80209, United States",
"country": "USA"
}
],
"mode": "car",
"avoid": "ferry",
"exclude": "none",
"departure_time": 1563254734,
"route_type": "fastest",
"cross_border": false,
"route_failed_prompt": false
}Response
{
"status": "Ok",
"rows": [
{
"elements": [
{
"duration": {
"value": 0
},
"distance": {
"value": 0
}
},
{
"duration": {
"value": 929
},
"distance": {
"value": 7038
}
},
{
"duration": {
"value": 577
},
"distance": {
"value": 7839
}
}
]
},
{
"elements": [
{
"duration": {
"value": 965
},
"distance": {
"value": 6938
}
},
{
"duration": {
"value": 0
},
"distance": {
"value": 0
}
},
{
"duration": {
"value": 912
},
"distance": {
"value": 7671
}
}
]
},
{
"elements": [
{
"duration": {
"value": 692
},
"distance": {
"value": 7654
}
},
{
"duration": {
"value": 936
},
"distance": {
"value": 7798
}
},
{
"duration": {
"value": 0
},
"distance": {
"value": 0
}
}
]
}
]
}{
"status": "Ok",
"rows": [
{
"elements": [
{
"duration": {
"value": 230
},
"distance": {
"value": 1477
}
},
{
"duration": {
"value": 172
},
"distance": {
"value": 875
}
}
]
},
{
"elements": [
{
"duration": {
"value": 135
},
"distance": {
"value": 740
}
},
{
"duration": {
"value": 49
},
"distance": {
"value": 149
}
}
]
}
]
}