Travel Time API Python Client

4.6.1 · active · verified Fri Apr 17

Traveltimepy is the official Python client for the Travel Time API, providing functionality to calculate travel times and distances between locations, search reachable areas, and find routes. It supports various transportation modes (driving, cycling, public transport, walking). The current stable version is 4.6.1, with regular updates to keep pace with API features and Python ecosystem changes.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize the `TravelTimeClient`. It relies on environment variables for API authentication. Replace placeholder values or ensure `TRAVELTIME_APP_ID` and `TRAVELTIME_API_KEY` are configured in your environment.

import os
from traveltimepy import TravelTimeClient

# Initialize the Travel Time API client.
# Ensure TRAVELTIME_APP_ID and TRAVELTIME_API_KEY environment variables are set
# with your credentials obtained from the Travel Time Platform.
client = TravelTimeClient(
    application_id=os.environ.get('TRAVELTIME_APP_ID', 'your_app_id_here'),
    api_key=os.environ.get('TRAVELTIME_API_KEY', 'your_api_key_here')
)

# The 'client' object is now ready to make API calls, 
# e.g., client.time_filter(...), client.time_map(...).
# For detailed examples, refer to the official documentation or GitHub README.

view raw JSON →