Sorry, you need to enable JavaScript to visit this website.

Routed Filter (Deprecated)

 

Service version: 2
Last edit: 2019.03.28

Deprecation notice

May 1, 2018:

  • The Routed Filter endpoint has been deprecated.
  • This endpoint will be withdrawn following a 12 month deprecation period.
  • The planned withdrawal date is May 1, 2019.
  • Following withdrawal, requests to this endpoint will receive an HTTP 404 error in response.

On this page

Purpose

The Routed Filter endpoint comes in handy when a list of POIs are already available and their drive distances or drive times need to be calculated from any location with a given heading.

  • To send the POI list you can use a POST/GET request using JSON as a string value for the poiList parameter.
  • POST is recommended for large datasets. See the following GET and POST examples.

HTTPS Method: GET

?poiList=[{"poi":{"name":"Cleaire Advanced Emission Controls"},"address":{"freeformAddress":"7220 Trade St, San Diego, CA 92121"},"position":{"lat":"37.83274","lon":"-122.27631"}}]

HTTPS Method: POST

{
  "poiList":[
    {
      "poi": {
        "name": "University of California San Diego",
      },
      "address": {
        "freeformAddress": "9500 Gilman Dr, San Diego, CA 92037",
      },
      "position": {
        "lat": 32.87349,
        "lon": -117.2378
      }
    },
    {
      "poi":{
        "name":"Cleaire Advanced Emission Controls"
      },
      "address":{
        "freeformAddress":"7220 Trade St, San Diego, CA 92121"
      },
      "position":{
        "lat": 37.83274,
        "lon": -122.27631
      }
    }
  ]
}

Run this endpoint

You can easily run this and other endpoints.

  1. Go to the TomTom API Explorer page.
  2. Click an endpoint.

    1. Click Try it out.
    2. Enter/select all required parameter values and any optional parameter values.
    3. At the bottom of the form, click Execute.
  3. Review the Response.

▲ Return to top

Request data

HTTPS Method: GET

URL format

GET https://<baseURL>/search/<versionNumber>/routedFilter/<position>/<heading>.<ext>?key=<Your_API_Key>[&routingTimeout=<routingTimeout>]

Request Parameters

The following table describes the parameters that can be used in a Request.

  • Required parameters must be used or the call will fail.
  • Optional parameters, which are highlighted with [square brackets], may be used.
  • If there is a default value that will be assumed when an optional parameter is not used, it is shown in the table.
Required parameters
Parameter Description
baseURL
string
Base URL for calling the API:
Value: api.tomtom.com
versionNumber
string
Service version number.
Value: The current value is 2.
position
float
Lat/Lon
Value: Latitude and Longitude coordinates.
Example: 37.553,-122.453
heading
decimal
The direction a person or vehicle is facing, usually similar to its course. Degrees are measured clockwise from the North.
Value: 0, 90, 180, etc. degrees
ext
string
A valid response format:
Values: JSON, JSONP, JS, or XML
poiList
array
List (JSON array) of POIs to filter.

  • The format is shown in the preceding poiList code example.
  • The only required attribute of a POI is position.
    position example: 37.553,-122.453
  • Everything else is optional and will be echoed back when passed in.

Value: A JSON array of POIs.

key
string
An API Key valid for the requested service.
Value: Your valid API Key.
Optional parameters
Parameter Description
[routingTimeout]
integer
Returns results from the routing engine within this limit.
Default value: 4000 milliseconds

▲ Return to top

Response data

Response body

For illustrative purposes the example below is neatly indented and includes all possible Response fields.

  • Actual responses are more compact and the fields present will vary based on the result type and the data available.
  • See the following Response field section for more information.

When requesting JSON output the Response has the following structure:

{
  "summary": {
    "numResults": 1,
    "queryTime": 176
  },
  "results": []
}

Each element of the results[] array is in the following format:

{
  "poi": {
    "name": "Upper Crust Pizza & Pasta"
  },
  "address": {
    "freeformAddress": "2501 Soquel Dr, Santa Cruz, CA 95065"
  },
  "position": {
    "lat": 36.98844,
    "lon": -121.97483
  },
  "route": {
    "routeGeometry": [
      "36.98796, -121.97286",
      "36.98801, -121.97337",
      "36.98803, -121.97364",
      "36.9881, -121.97426",
      "36.98814, -121.97464",
      "36.98816, -121.97475",
      "36.9882, -121.97511",
      "36.98847, -121.97506"
    ],
    "routeInstructions": {
      "list": [
        {
          "Instruction": "Proceed West on Soquel Dr",
          "Point": "36.98796,-121.97286",
          "description": "route maneuver 1",
          "distance": {
            "value": 0,
            "uom": "MI"
          },
          "duration": "P0DT0H0M0S",
          "waitTime": "P0DT0H0M0S",
          "turnAngle": 0,
          "turn": "Proceed",
          "tour": 0
        },
        {
          "Instruction": "Turn right onto Winkle Ave",
          "Point": "36.98820,-121.97511",
          "description": "route maneuver 2",
          "distance": {
            "value": 0.1249,
            "uom": "MI"
          },
          "duration": "P0DT0H0M24S",
          "waitTime": "P0DT0H0M0S",
          "turnAngle": 89.9,
          "turn": "Turn Right",
          "tour": 0
        },
        {
          "Instruction": "Arrive at destination",
          "Point": "36.98847,-121.97506",
          "description": "route maneuver 3",
          "distance": {
            "value": 0.0187,
            "uom": "MI"
          },
          "duration": "P0DT0H0M7S",
          "waitTime": "P0DT0H0M0S",
          "turnAngle": 0,
          "tour": 0,
          "sideOfStreet": "Right"
        }
      ],
      "language": "english"
    },
    "routeSummary": {
      "boundingBox": {
        "topLeftPoint": "36.98846999999999, -121.97511",
        "btmRightPoint": "36.987960000000015, -121.97286000000001"
      },
      "totalDistance": {
        "value": 0.1436,
        "uom": "MI"
      },
      "totalTime": "P0DT0H0M31S",
      "totalTravelTime": "P0DT0H0M31S",
      "totalWaitTime": "P0DT0H0M0S"
    }
  }
}

▲ Return to top

Response fields

The following table describes all of the fields that can appear in a Response. Fields are listed by the Response section they belong to and in the order that they appear in the Response.

Primary fields
Field Description
summary{}
object
Summary information about the search that was performed.
results[]
array
Result list, sorted in descending order by score.
summary{} object
Field Description
numResults
integer
Number of Results in the response.
queryTime
integer
Time spent on resolving the query.
results[] array
Field Description
poi
object
Optional section. Only present if type = = POI.
address
object
Structured address for the Result.
position
object
Position of the Result.
Example: 37.553,-122.453
route
object
A route from the query position that is heading to this Result.
poi{} object
Field Description
name
string
Name of the POI.
address{} object
Field Description
freeformAddress
string
An address line formatted according to:

  • The formatting rules of the Result's country of origin.
  • In the case of countries, its full country name.
route{} object
Field Description
routeGeometry
array
An ordered list of strings each in the form "latitude, longitude", denoting points along the route.
routeInstructions
object
Human readable guidance on how to follow the route.
routeSummary
object
Summary information about the route as a whole.
routeInstructions{} object
Field Description
list
array
An ordered list of human readable guidance instructions.
language
string
The language that the human readable instructions are given in.
routeInstruction{} object
Field Description
Instruction
string
A human readable instruction, e.g., Turn left onto ...
Point
string
The "latitude,longitude" location at which the instructions should be executed.
description
string
A string describing the instruction, currently in the form "route maneuver N" with N being the 1-based index into the list of instructions.
distance
object (MeasuredUnit)
Distance from a preceding maneuver.
duration
string
The expected time to complete this maneuver.
waitTime
string
Time spent waiting at intersections.
turnAngle
double
The angle of the turn in the maneuver. For example:

  • 0.0° is straight ahead.
  • 90.0° is a right angle turn to the right.
  • 270.0° is a right angle turn to the left, and so on.
turn
string
The procedure to complete this maneuver. Typically this is an instruction such as "Turn right".
tour
integer
The number of waypoints passed thus far.
routeSummary{} object
Field Description
boundingBox
object (BoundingBox)
A box that minimally encloses the route.
totalDistance
object (MeasuredUnit)
The sum of the routeInstruction distances.
totalTime
string
The sum of the routeInstruction durations.
totalTravelTime
string
The sum of the routeInstruction durations.
totalWaitTime
string
The sum of the routeInstruction durations, excluding or including the waitTimes.
boundingBox{} object
Field Description
topLeftPoint
string
Top-left "latitude, longitude" coordinate of the bounding box.
btmRightPoint
string
Bottom-right "latitude, longitude" coordinate of the bounding box.
lat/lon
Field Description
lat
float
Latitude.
lon
float
Longitude.
measuredUnit
Field Description
value
double
A distance in the unit uom (unit of measurement).
uom
integer (MI)
Indicates that value is expressed in miles.

▲ Return to top

HTTP Response codes

The following table contains Response codes signifying successful and failed requests to an API server.

Code Meaning & possible causes
200 OK: The search successfully returned zero or more results.
400 Bad Request: One or more parameters were incorrectly specified.
403 Forbidden: Possible causes include,

  • Service requires SSL
  • Not authorized
  • Rate or volume limit exceeded
  • Unknown referer
405 Method Not Allowed: The HTTP method (GET, POST, etc) is not supported for this Request.
404/596 Not Found: The HTTP Request method (GET, POST, etc) or path is incorrect.
5xx Server Error: The service was unable to process your Request. Contact support to resolve the issue.

▲ Return to top

Response headers

The following data table contains Response headers sent back from an API server.

Header Description
Access-Control-Allow-Origin Ensures that clients implementing the CORS security model are able to access the response from this service.
Value: An asterisk "*" that signifies access to the TomTom API using the Access-Control-Allow-Origin (ACAO) header in its Response indicating which origin sites are allowed.
Content-Type Indicates the format of the response, as chosen by the client.
Format: type/subtype; charset=utf-8
Value: type/subtype is one of:

  • application/json
  • text/javascript
  • text/xml

▲ Return to Top

You are here