### GET Request Example Source: https://docs.traveltime.com/api/reference/distance-matrix A sample URL for calculating a travel time matrix using public transport. Replace YOUR_APP_ID and YOUR_APP_KEY with valid credentials before executing. ```http https://api.traveltimeapp.com/v4/time-filter?type=public_transport&arrival_time=2026-07-31T05:00:00Z&search_lat=51.41070&search_lng=-0.15540&locations=51.45974_-0.16531,51.41494_-0.12492,51.41074_-0.21531,51.42942_-0.23343&app_id=YOUR_APP_ID&api_key=YOUR_APP_KEY ``` -------------------------------- ### Example time-filter/fast configuration Source: https://docs.traveltime.com/api/database-plugins/solr Complete configuration example for the fast Protobuf-based time filter. ```xml your_app_id_here your_api_key_here ``` -------------------------------- ### Install TravelTime SDK Source: https://docs.traveltime.com/api/sdks/python Install the core SDK package via pip. ```bash pip install traveltimepy ``` -------------------------------- ### Example time-filter configuration Source: https://docs.traveltime.com/api/database-plugins/solr Complete configuration example for the standard time filter. ```xml your_app_id_here your_api_key_here ``` -------------------------------- ### Install TravelTime SDK Source: https://docs.traveltime.com/api/sdks/nodejs Install the package via npm. ```bash npm i traveltime-api ``` -------------------------------- ### Install Optional Protobuf Dependencies Source: https://docs.traveltime.com/api/sdks/python Install additional dependencies required for TimeFilterFastProto endpoints. ```bash pip install 'traveltimepy[proto]' ``` -------------------------------- ### Install Elasticsearch Plugin Source: https://docs.traveltime.com/api/database-plugins/elasticsearch Command to install the plugin for a specific Elasticsearch version. ```bash elasticsearch-plugin install https://github.com/traveltime-dev/traveltime-elasticsearch-plugin/releases/download/v0.2.28/traveltime-elasticsearch-plugin_v0.2.28_8.1.1.zip ``` -------------------------------- ### Install Travel Time SDK on Windows Source: https://docs.traveltime.com/use-case/job-board/filter-and-rank Commands to set up a virtual environment and install the SDK on Windows systems. ```bash pip install virtualenv virtualenv \Scripts\activate \Scripts\pip.exe install traveltimepy ``` -------------------------------- ### Install Travel Time SDK on Linux/Mac Source: https://docs.traveltime.com/use-case/job-board/filter-and-rank Commands to set up a virtual environment and install the SDK on Unix-based systems. ```bash pip3 install virtualenv virtualenv source /bin/activate /bin/pip install traveltimepy ``` -------------------------------- ### Mapbox API Isochrone Request Source: https://docs.traveltime.com/api/migration-guide/mapbox-isochrone A GET request example for generating a one-hour driving isochrone using the Mapbox API. ```bash curl -X GET "https://api.mapbox.com/isochrone/v1/mapbox/driving/-73.99088,40.72511&contours_minutes=60?access_token={Your_Access_Token}" ``` -------------------------------- ### Install Travel Time R SDK Source: https://docs.traveltime.com/api/sdks/r Use this command to install the package from CRAN. ```R install.packages("traveltimeR") ``` -------------------------------- ### Install Protobuf System Dependencies Source: https://docs.traveltime.com/api/sdks/r System-level dependencies required for the rprotobuf package dependency. ```bash sudo apt-get install protobuf-compiler libprotobuf-dev libprotoc-dev ``` ```bash brew install protobuf ``` -------------------------------- ### TomTom Matrix API Response Example Source: https://docs.traveltime.com/api/migration-guide/tomtom-matrix-routing Example of a 2x2 matrix response from the TomTom API using index-based references. ```json { "data": [ { "originIndex": 0, "destinationIndex": 0, "routeSummary": { "lengthInMeters": 77390, "travelTimeInSeconds": 3844, "trafficDelayInSeconds": 0 } }, { "originIndex": 0, "destinationIndex": 1, "routeSummary": { "lengthInMeters": 117490, "travelTimeInSeconds": 5285, "trafficDelayInSeconds": 0 } }, { "originIndex": 1, "destinationIndex": 0, "routeSummary": { "lengthInMeters": 103982, "travelTimeInSeconds": 4773, "trafficDelayInSeconds": 0 } }, { "originIndex": 1, "destinationIndex": 1, "routeSummary": { "lengthInMeters": 143639, "travelTimeInSeconds": 6195, "trafficDelayInSeconds": 0 } } ], "statistics": { "totalCount": 4, "successes": 4, "failures": 0 } } ``` -------------------------------- ### Travel Time Matrix Request Examples Source: https://docs.traveltime.com/api/start/travel-time-distance-matrix Examples showing the JSON request body structure and the corresponding cURL command for the /v4/time-filter/fast endpoint. ```json { "arrival_searches": { "one_to_many": [ { "id": "Example Search", "departure_location_id": "Origin", "arrival_location_ids": [ "Destination 1", "Destination 2", "Destination 3" ], "transportation": { "type": "driving" }, "travel_time": 10800, "arrival_time_period": "weekday_morning", "properties": [ "travel_time", "distance" ] } ] }, "locations": [ { "id": "Origin", "coords": { "lat": 54.238911, "lng": -0.397567 } }, { "id": "Destination 1", "coords": { "lat": 54.24424722, "lng": -0.407544543 } }, { "id": "Destination 2", "coords": { "lat": 54.35384, "lng": -0.434984 } }, { "id": "Destination 3", "coords": { "lat": 53.99283, "lng": -0.519234 } } ] } ``` ```bash curl -X POST https://api.traveltimeapp.com/v4/time-filter/fast \ -H 'Content-Type: application/json' \ -H 'X-Application-Id: YOUR_APP_ID' \ -H 'X-Api-Key: YOUR_APP_KEY' \ -d '{ "arrival_searches": { "one_to_many": [ { "id": "Example Search", "departure_location_id": "Origin", "arrival_location_ids": [ "Destination 1", "Destination 2", "Destination 3" ], "transportation": { "type": "driving" }, "travel_time": 10800, "arrival_time_period": "weekday_morning", "properties": [ "travel_time", "distance" ] } ] }, "locations": [ { "id": "Origin", "coords": { "lat": 54.238911, "lng": -0.397567 } }, { "id": "Destination 1", "coords": { "lat": 54.24424722, "lng": -0.407544543 } }, { "id": "Destination 2", "coords": { "lat": 54.35384, "lng": -0.434984 } }, { "id": "Destination 3", "coords": { "lat": 53.99283, "lng": -0.519234 } } ] }' ``` -------------------------------- ### Isochrone Request Examples Source: https://docs.traveltime.com/api/start/isochrones Examples of the JSON request body and the corresponding cURL command for the TravelTime time-map endpoint. ```json { "arrival_searches": { "many_to_one":[ { "id": "Example Isochrone", "coords": { "lat": 51.1234, "lng": 0.01234 }, "arrival_time_period": "weekday_morning", "travel_time": 7200, "transportation": { "type": "public_transport" } } ] } } ``` ```bash curl -X POST https://api.traveltimeapp.com/v4/time-map/fast \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-Application-Id: YOUR_APP_ID' \ -H 'X-Api-Key: YOUR_APP_KEY' \ -d '{ "arrival_searches": { "many_to_one":[ { "id": "Example Isochrone", "coords": { "lat": 51.1234, "lng": 0.01234 }, "arrival_time_period": "weekday_morning", "travel_time": 7200, "transportation": { "type": "public_transport" } } ] } }' ``` -------------------------------- ### Install TravelTime Ruby Gem Source: https://docs.traveltime.com/api/sdks/ruby Add the gem to your Gemfile or install it directly via command line. ```ruby gem 'travel_time' ``` ```bash $ bundle install ``` ```bash $ gem install travel_time ``` -------------------------------- ### Check Python Version Source: https://docs.traveltime.com/api/sdks/python Verify that the installed Python version meets the minimum requirement of 3.10. ```bash python --version ``` -------------------------------- ### Route Response Example Source: https://docs.traveltime.com/api/reference/routes A partial JSON response structure returned from a successful route calculation request. ```json { "results": [ { "search_id": "arrival search example", "locations": [ { "id": "Hyde Park", "properties": [ { "travel_time": 1499, "distance": 847, "route": { "departure_time": "2026-07-29T13:00:00Z", "arrival_time": "2026-07-29T14:00:00Z", "parts": [ { "id": 0, "type": "start_end", "mode": "walk", "directions": "Start your journey 57 meters south", "distance": 57, "travel_time": 41, "coords": [ { "lat": 51.508824, "lng": -0.167093 }, { "lat": 51.5083198, "lng": -0.167281 } ], "direction": "south" }, { "id": 1, "type": "road" ``` -------------------------------- ### HERE Isoline Routing API Request Source: https://docs.traveltime.com/api/migration-guide/here-isoline Example of a GET request to the HERE Isoline API to generate a one-hour driving isochrone. ```curl curl -gX GET 'https://isoline.router.hereapi.com/v8/isolines?'\ 'transportMode=car&'\ 'origin=40.72511,-73.99088&'\ 'range[type]=time&'\ 'range[values]=3600&'\ 'apiKey={Your_API_Key}' ``` -------------------------------- ### Client Initialization Source: https://docs.traveltime.com/api/sdks/python How to initialize the synchronous and asynchronous clients with authentication and configuration parameters. ```APIDOC ## Client Initialization ### Description Initialize the TravelTime SDK client to interact with the API. Supports both synchronous and asynchronous modes. ### Parameters - **app_id** (string) - Required - Your application ID. - **api_key** (string) - Required - Your API key. - **timeout** (int) - Optional - Request timeout in seconds (default 300). - **retry_attempts** (int) - Optional - Number of retry attempts for 5xx errors. - **max_rpm** (int) - Optional - Maximum requests per minute. ### Example ```python from traveltimepy import Client, AsyncClient # Synchronous client client = Client( app_id="YOUR_APP_ID", api_key="YOUR_API_KEY", timeout=300, retry_attempts=3, max_rpm=60 ) # Asynchronous client async_client = AsyncClient( app_id="YOUR_APP_ID", api_key="YOUR_API_KEY", timeout=300, retry_attempts=3, max_rpm=60 ) ``` ``` -------------------------------- ### Google Distance Matrix API Request Source: https://docs.traveltime.com/api/migration-guide/google-distance-matrix A GET request example for the Google Distance Matrix API using query parameters for origins, destinations, and travel mode. ```curl curl -X GET "https://maps.googleapis.com/maps/api/distancematrix/json?origins=51.532131%2C-0.293897%7C51.871461%2C-0.435683&destinations=51.749232%2C-1.258321%7C50.899630%2C-1.011401&arrival_time=1740748800&mode=driving&key={Your_API_Key}" ``` -------------------------------- ### Set up Ruby with RVM Source: https://docs.traveltime.com/api/sdks/ruby Commands to install a specific Ruby version, set it as default, and create a dedicated gemset. ```bash rvm install ruby-3.3.8 rvm alias create default ruby-3.3.8 rvm use ruby-3.3.8 rvm gemset create traveltime-sdk ``` -------------------------------- ### Initialize Synchronous and Asynchronous Clients Source: https://docs.traveltime.com/api/sdks/python Configure client instances with authentication credentials, timeouts, retry limits, and request rate constraints. ```python from traveltimepy import Client, AsyncClient # Synchronous client client = Client( app_id="YOUR_APP_ID", api_key="YOUR_API_KEY", timeout=300, # Request timeout in seconds retry_attempts=3, # Number of retry attempts for 5xx errors max_rpm=60, # Maximum requests per minute ) # Asynchronous client async_client = AsyncClient( app_id="YOUR_APP_ID", api_key="YOUR_API_KEY", timeout=300, retry_attempts=3, max_rpm=60 ) ``` -------------------------------- ### Configure TravelTime query parameters Source: https://docs.traveltime.com/api/database-plugins/solr Shows how to pass configuration options as local query parameters or as raw parameters prefixed with 'traveltime_'. Local parameters take precedence if both are provided. ```text ?fq={!traveltime origin=51.53,-0.15 field=coords limit=7200 mode=pt country=uk} ``` ```text ?fq={!traveltime}&traveltime_origin=51.53,-0.15&traveltime_field=coords&traveltime_limit=7200&traveltime_mode=pt&traveltime_country=uk} ``` -------------------------------- ### HERE API Error Response Example Source: https://docs.traveltime.com/api/migration-guide/here-matrix-routing Example of a 400 Bad Request error response from the HERE API. ```json { "title": "invalid HTTP request", "status": 400, "code": "E601101", "cause": "invalid JSON: key must be a string at line 12 column 7", "action": "Check that the request body is in valid JSON format.", "correlationId": "02ba60db-3007-4291-950a-c7de8be12e40" } ``` -------------------------------- ### Configure Custom SDK Parameters Source: https://docs.traveltime.com/api/sdks/java Initializes the TravelTimeSDK with custom credentials, base URI, and OkHttp client settings. ```java TravelTimeCredentials credentials = new TravelTimeCredentials("APP_ID", "API_KEY"); URI baseUri = URI.create("BASE_URI"); OkHttpClient client = new OkHttpClient .Builder() .callTimeout(120, TimeUnit.SECONDS) .build(); TravelTimeSDK sdk = TravelTimeSDK .builder() .baseUri(baseUri) .credentials(credentials) .client(client) .build(); ``` -------------------------------- ### GET /v4/time-filter Source: https://docs.traveltime.com/api/reference/distance-matrix Retrieve a distance matrix using basic parameters via a GET request. ```APIDOC ## GET /v4/time-filter ### Description Create a distance matrix with travel times and distances between locations using basic parameters. ### Method GET ### Endpoint https://api.traveltimeapp.com/v4/time-filter ``` -------------------------------- ### GET /v4/time-filter Source: https://docs.traveltime.com/api/reference/distance-matrix Calculates travel time filters using a GET request with query parameters. ```APIDOC ## GET /v4/time-filter ### Description Calculates travel time filters using query parameters. ### Method GET ### Endpoint /v4/time-filter ``` -------------------------------- ### Bad GET Request Error Source: https://docs.traveltime.com/api/reference/error-response Returned when query parameters in a GET request fail validation. ```json { "http_status": 400, "error_code": 25, "description": "Bad request", "documentation_link": "/api/reference/error-codes", "additional_info": { "travel_time": [ "Bad request: travel_time must be specified and it should be greater than or equal to 60 and less than or equal to 86400" ], "locations": [ "Bad request: locations must be specified. If specifying multiple locations - they should be separated with commas: locations=51.4234_-0.1234,54.6532_-0.1345" ] } } ``` -------------------------------- ### Run unit tests with Maven Source: https://docs.traveltime.com/api/sdks/java Execute the project's unit test suite using the Maven build tool. ```bash mvn test ``` -------------------------------- ### GET /v4/routes Source: https://docs.traveltime.com/api/overview/routes Retrieve A to B routes using simple parameters via a GET request. ```APIDOC ## GET https://api.traveltimeapp.com/v4/routes ### Description Generates A to B routes with turn-by-turn directions using basic parameters. ### Method GET ### Endpoint https://api.traveltimeapp.com/v4/routes ``` -------------------------------- ### Initialize Travel Time SDK Source: https://docs.traveltime.com/use-case/job-board/filter-and-rank Basic instantiation of the TravelTimeSdk using application credentials. ```python from traveltimepy import TravelTimeSdk sdk = TravelTimeSdk(app_id="YOUR_APP_ID", api_key="YOUR_APP_KEY") ``` -------------------------------- ### GET /v4/time-map/fast Source: https://docs.traveltime.com/api/reference/isochrones Calculates isochrones using a GET request with query parameters for faster, simpler requests. ```APIDOC ## GET /v4/time-map/fast ### Description Provides a faster method to calculate isochrones using query parameters. ### Method GET ### Endpoint /v4/time-map/fast ``` -------------------------------- ### Configure Public Transport transportation mode Source: https://docs.traveltime.com/api/sdks/nodejs Example configuration for the 'pt' transportation mode with walking time constraints. ```typescript transportation: { mode: 'pt', details: { walkingTimeToStation: 1800 } }, ``` -------------------------------- ### Configure Driving and Public Transport transportation mode Source: https://docs.traveltime.com/api/sdks/nodejs Example configuration for the 'driving+pt' transportation mode including parking and driving time constraints. ```typescript transportation: { mode: 'driving+pt', details: { walkingTimeToStation: 1800, drivingTimeToStation: 1800, parkingTime: 900 } }, ``` -------------------------------- ### Authenticate with TravelTime SDK Source: https://docs.traveltime.com/api/sdks/java Initialize the SDK by providing your application ID and key. ```java TravelTimeCredentials credentials = new TravelTimeCredentials("YOUR_APP_ID", "YOUR_APP_KEY"); TravelTimeSDK sdk = new TravelTimeSDK(credentials); ``` -------------------------------- ### TomTom API Error Response Example Source: https://docs.traveltime.com/api/migration-guide/tomtom-reachable-range Example of a 400 Bad Request error response from the TomTom API. ```json { "formatVersion": "0.0.1", "detailedError": { "message": "Invalid value for timeBudgetInSec: 3600s", "code": "BAD_INPUT" } } ``` -------------------------------- ### Export API credentials Source: https://docs.traveltime.com/api/sdks/java Set the required environment variables for authentication before running tests. ```bash export APP_ID="..." export API_KEY="..." ``` -------------------------------- ### Google API Error Response Example Source: https://docs.traveltime.com/api/migration-guide/google-distance-matrix Example of a 400 error response from the Google Distance Matrix API. ```json { "destination_addresses": [], "origin_addresses": [], "rows": [], "status": "INVALID_REQUEST" } ``` -------------------------------- ### Activate RVM Gemset Source: https://docs.traveltime.com/api/sdks/ruby Command to switch to the project-specific gemset. ```bash rvm use default@traveltime-sdk ``` -------------------------------- ### HERE Isoline Routing API Response Example Source: https://docs.traveltime.com/api/migration-guide/here-isoline Example of a one-hour driving isochrone response from the HERE API, featuring encoded polyline geometry. ```json { "departure": { "time": "2025-05-01T07:31:54-04:00", "place": { "type": "place", "location": { "lat": 40.7251271, "lng": -73.9908676 }, "originalLocation": { "lat": 40.7251099, "lng": -73.99088 } } }, "isolines": [ { "range": { "type": "time", "value": 3600 }, "polygons": [ { "outer": "BGsshxtC5xt-uEA64S2rFgjQ-lgBq3K2rFgjQAy61C0rFgjQgmgBq3K0uV0uV2rFgjQA-rgC0rFgjQgmgBq3K0uV0uV2rFgjQ1rFgjQ9lgBq3KAq3Ko9qBq9qBgmgBq3Kq3K-lgB-lgBq3K2rFgjQA0uV1rFgjQ9lgBq3K1rFgjQA0uVzrFgjQ_lgBq3KzrFgjQ0rFgjQgjQ0rF0uVAgjQ2rFq3K-lgBgmgBs3K-lgB-lgBgjQ2rF0uVAgjQ1rFq3[...]K_lgBp3Kp3KzrF_iQAzuV0rF_iQq3Kp3K2rF_iQA53gE2rF_iQ-iQ1rF2uVA-iQ61C2rFwhIAmtN" } ] } ] } ``` -------------------------------- ### TravelTimeSdk Initialization Source: https://docs.traveltime.com/use-case/temporary-work/shift-notification Initializes the TravelTime SDK client with your credentials. ```APIDOC ## TravelTimeSdk(app_id, api_key, ...) ### Description Initializes the SDK client required to authenticate and interact with the TravelTime API. ### Parameters - **app_id** (str) - Required - Application Id - **api_key** (str) - Required - Api Key - **limit_per_host** (int) - Optional - Number of simultaneous connections to one host. - **rate_limit** (int) - Optional - Number of searches which can be made in a time window. - **time_window** (int) - Optional - Duration, in seconds, of the time period in which to limit the rate. - **retry_attempts** (int) - Optional - Number of retries for failed requests. - **host** (str) - Optional - TravelTime host, default value is api.traveltimeapp.com. - **timeout** (int) - Optional - Maximum session time until timeout. Default value is 300 (5 minutes). ``` -------------------------------- ### GET Request for Time Filter Source: https://docs.traveltime.com/api/reference/time-filter A sample GET request URL for calculating travel times. Replace YOUR_APP_ID and YOUR_APP_KEY with valid credentials before use. ```http https://api.traveltimeapp.com/v4/time-filter?type=public_transport&arrival_time=2026-07-29T13:00:00Z&search_lat=51.41070&search_lng=-0.15540&locations=51.45974_-0.16531,51.41494_-0.12492,51.41074_-0.21531,51.42942_-0.23343&app_id=YOUR_APP_ID&api_key=YOUR_APP_KEY ``` -------------------------------- ### mapInfo Source: https://docs.traveltime.com/api/sdks/nodejs Get information about currently supported countries. ```APIDOC ## mapInfo ### Description Get information about currently supported countries. ### Method SDK Method ``` -------------------------------- ### Calculate Routes with Ruby Source: https://docs.traveltime.com/api/sdks/ruby Perform routing between specified locations using departure and arrival searches. Requires the 'time' library for ISO8601 timestamp generation. ```ruby require 'time' locations = [{ id: 'London center', coords: { lat: 51.508930, lng: -0.131387 } }, { id: 'Hyde Park', coords: { lat: 51.508824, lng: -0.167093 } }, { id: 'ZSL London Zoo', coords: { lat: 51.536067, lng: -0.153596 } }] departure_search = { id: 'forward search example', departure_location_id: 'London center', arrival_location_ids: ['Hyde Park', 'ZSL London Zoo'], transportation: { type: 'bus' }, departure_time: Time.now.iso8601, travel_time: 1800, properties: ['travel_time'], range: { enabled: true, max_results: 3, width: 600 } } arrival_search = { id: 'backward search example', departure_location_ids: ['Hyde Park', 'ZSL London Zoo'], arrival_location_id: 'London center', transportation: { type: 'public_transport' }, arrival_time: Time.now.iso8601, travel_time: 1800, properties: ['travel_time', 'distance', 'fares', 'route'] } response = client.routes( locations: locations, departure_searches: [departure_search], arrival_searches: [arrival_search] ) puts response.body ``` -------------------------------- ### map_info Source: https://docs.traveltime.com/api/sdks/r Get information about currently supported countries. ```APIDOC ## map_info ### Description Get information about currently supported countries. ```