search icon
Overview
Developer Tools
Travel Time Matrix API
Isochrone API
H3 API
Geohash API
v4/geohash/fast
Endpoint Reference
v4/geohash
Endpoint Reference
Distance Map API
Routes API
Geocoding API
Additional API Reference
Error Handling
ArcGIS plugin
Alteryx plugin
TravelTime.comchevronDocs

Filter and Rank for Job Boards

Use Case

  • Allow users to search for jobs using commute time
  • Incorporate travel times into the filtering and ranking of search results
  • Enrich each result with the individual user's travel time

Value

  • Increase conversions by showing more relevant search results
  • Capture user commute preferences to build a richer profile for relevant notifications and alerts

Customer Case study

Stepstone logo
  • tick icon10% increase in conversions
  • tick icon3-in-4 users adopting commute time search
  • tick iconIntuitive commute time and routing insights
Read customer storychevron icon
Chris Burles

Chris Burles

Director of Product Management at The Stepstone Group

“TravelTime has enriched our user experience and increased conversions by 10%.“

Typical flow

job boards flow chart

Sending requests

Request typePOST
Hostapi.traveltimeapp.com
Endpoint/v4/time-filter/fast
AuthenticationApplication-Id
Api-Key

You can find your Application-Id and Api-Key by logging into your TravelTime account.

Or if you don't already have an account, then sign up for free access below.

Request body


{
  "locations": [
    {
      "id": "User Home",
      "coords": {
        "lat": 54.2389,
        "lng": -0.3975
      }
    },
    {
      "id": "Job 1",
      "coords": {
        "lat": 54.2442,
        "lng": -0.4075
      }
    },
    {
      "id": "Job 2",
      "coords": {
        "lat": 54.2483,
        "lng": -0.4349
      }
    },
    {
      "id": "Job 3",
      "coords": {
        "lat": 53.9923,
        "lng": -0.3134
      }
    },
    .
    .
    .
    {
      "id": "Job 100,000",
      "coords": {
        "lat": 53.9923,
        "lng": -0.4134
      }
    }
  ],
  "arrival_searches": {
    "one_to_many": [
      {
        "id": "Commute Search",
        "departure_location_id": "User Home",
        "arrival_location_ids": [
          "Job 1",
          "Job 2",
          "Job 3",
          .
          .
          .
          "Job 100,000"
        ],
        "transportation": {
          "type": "public_transport"
        },
        "travel_time": 10800,
        "arrival_time_period": "weekday_morning",
        "properties": [
          "travel_time"
        ]
      }
    ]
  }
}
          
Parameters:

locations - an array containing the IDs and lat-long coordinates of the user's search location and all of the job listings. This can include up to 100,000 listings, but could be pre-filtered using other search parameters if desired

one_to_many - travel times are calculated departing from the user's search location and arriving at each job location

arrival_time_period - weekday_morning reflects the typical travel times for a morning commute

travel_time - used to filter the reachable jobs based on the user's chosen commute time (up to 3 hours)

transportation - taken from the user's chosen transport mode, typically Driving / Public_Transport / Walking / Cycling

properties - the data point(s) to be calculated for each listing - typically just travel_time, but distance can also be used if required

Response body


{
  "results": [
    {
      "search_id": "Commute Search",
      "locations": [
        {
          "id": "Job 1",
          "properties": {
            "travel_time": 554
          }
        },
        {
          "id": "Job 2",
          "properties": {
            "travel_time": 1968
          }
        },
        .
        .
        .
        {
          "id": "Job 100,000",
          "properties": {
            "travel_time": 5868
          }
        }
      ],
      "unreachable": [
        "Job 3"
      ]
    }
  ]
}
          

locations - Reachable jobs based on the user's commute search parameters

unreachable - Unreachable jobs outside of the user's commute search parameters

SDKs

NodeJS
Python

Installation

npm

npm i traveltime-api

This package comes with TypeScript support.

Usage

Client Initialization

Before starting, the package needs to be configured with your account's application ID and Key, which can be found in the TravelTime Developer Portal Dashboard. To create an instance - you will need to create new TravelTimeClient class object with credentials you got from dashboard.

import { TravelTimeClient } from 'traveltime-api';

const travelTimeClient = new TravelTimeClient({
  apiKey: 'YOUR_APP_KEY',
  applicationId: 'YOUR_APP_ID',
});

Time Filter Fast Function


travelTimeClient.timeFilterFast({
  "locations": [
    {
      "id": "User Home",
      "coords": {
        "lat": 54.2389,
        "lng": -0.3975
      }
    },
    {
      "id": "Job 1",
      "coords": {
        "lat": 54.2442,
        "lng": -0.4075
      }
    },
    {
      "id": "Job 2",
      "coords": {
        "lat": 54.2483,
        "lng": -0.4349
      }
    },
    {
      "id": "Job 3",
      "coords": {
        "lat": 53.9923,
        "lng": -0.3134
      }
    },
    .
    .
    .
    {
      "id": "Job 100,000",
      "coords": {
        "lat": 53.9923,
        "lng": -0.4134
      }
    }
  ],
  "arrival_searches": {
    "one_to_many": [
      {
        "id": "Commute Search",
        "departure_location_id": "User Home",
        "arrival_location_ids": [
          "Job 1",
          "Job 2",
          "Job 3",
          .
          .
          .
          "Job 100,000"
        ],
        "transportation": {
          "type": "public_transport"
        },
        "travel_time": 10800,
        "arrival_time_period": "weekday_morning",
        "properties": [
          "travel_time"
        ]
      }
    ]
  }
}).then((data) => console.log(data))
  .catch((e) => console.error(e));
          

Installation

Install Travel Time Python SDK in a virtualenv using pip. virtualenv is a tool to create isolated Python environments.

virtualenv allows to install Travel Time Python SDK without needing system install permissions, and without clashing with the installed system dependencies.

Linux/Mac

pip3 install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install traveltimepy

Windows

pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install traveltimepy

Sdk set up

In order to authenticate with Travel Time API, you will have to supply the Application Id and Api Key.

Takes:

  • app_id: str - Application Id
  • api_key: str - Api Key
  • limit_per_host: int - Number of simultaneous connections to one host.
  • rate_limit: int - Number of searches which can be made in a time window.
  • time_window: int - Duration, in seconds, of the time period in which to limit the rate.
  • retry_attempts: int - Number of retries for failed requests.
  • host: str - TravelTime host, default value is api.traveltimeapp.com.
  • timeout: int - Maximum session time until timeout. Default value is 300 (5 minutes).

from traveltimepy import TravelTimeSdk

sdk = TravelTimeSdk(app_id="YOUR_APP_ID", api_key="YOUR_APP_KEY")

Time Filter Fast Function


import asyncio

from traveltimepy import Location, Coordinates, Transportation, TravelTimeSdk

async def main():
    sdk = TravelTimeSdk("YOUR_APP_ID", "YOUR_APP_KEY")
    
    locations = [
        Location(id="User Home", coords=Coordinates(lat=54.2389, lng=-0.3975)),
        Location(id="Job 1", coords=Coordinates(lat=54.2442, lng=-0.4075)),
        Location(id="Job 2", coords=Coordinates(lat=54.2483, lng=-0.4349)),
        Location(id="Job 3", coords=Coordinates(lat=53.9923, lng=-0.3134)),
        .
        .
        .
        Location(id="Job 100,000", coords=Coordinates(lat=53.9923, lng=-0.4134))
    ]

    
    results = await sdk.time_filter_fast_async(
        locations=locations,
        search_ids={
            "User Home": [
                "Job 1",
                "Job 2",
                .
                .
                .
                "Job 100,000"
            ],
        },
        transportation=Transportation(type="public_transport"),
        travel_time=10800,
        one_to_many=True
    )
    
    print(results)
    
asyncio.run(main())
              

FAQs

What is the performance like?
chevron

The Travel Time Matrix Fast endpoint can calculate 100,000 travel times in under 150ms.

How accurate is your data?
chevron
Our dedicated Data Team ensures our data is always fully up to date, and our Public Transport timetables are updated at least once a week. We build our Driving models from the ground up to replicate the drive times from Google Maps as closely as possible, and you can run benchmarks to compare our results to other providers using our Github Comparison Tool.
How reliable is the service?
chevron
Our APIs never drop below 99.99% uptime - view the details on our live status page.
Where do you have coverage?
chevron
We support driving, walking and cycling in 235 countries globally, with public transport data in over 110 countries. We publish exactly what public transport data we have in our interactive Coverage Tool.
How much will this cost?
chevron

We never charge based on usage. Instead we offer unlimited usage licences for a fixed monthly fee. The only thing you need to decide is the maximum Requests Per Minute (RPM) you need.

Can I test out the endpoint for myself?
chevron
You can test the full functionality of the Travel Time Matrix Fast endpoint in our API Playground. Once you've signed up for a TravelTime account, you can also use your API key for an unlimited 2 week trial.