The APIs for taxi services

Supercharge your taxi & ride-hailing platform with accurate, real-time Distance & ETA calculations

Solution

A comprehensive approach for taxi services involves integrating the Distance Matrix API and the Geocoding API into a single, unified solution. This way, all your needs are covered in one place, letting you focus on delivering exceptional experiences to both drivers and passengers and prosperity of your business.
With Distance Matrix API, you can take real-time traffic conditions into account and quickly calculate the shortest, most convenient routes—minimizing driver downtime and delays. The system scales seamlessly and can handle a high volume of requests, even in the largest cities.

At the same time, our Geocoding API accurately determines the client’s location, even when the provided address is incomplete. We ensure global coverage and exceptional accuracy that surpasses industry standards. By choosing our integrated approach, you receive full support for the most efficient operation of your taxi service.

Our taxi-service API clients

meru
uklon
ontaxi
gogo cab

How can taxi services benefit from the APIs?

drive time calculator
Accurate time & distance calculations
Easily calculate trip durations, distances and ETAs ensuring reliable predictions for both drivers and passengers.
driver
Smart driver assignment
Quickly identify and dispatch the closest available driver to the customer’s location, streamlining operations and boosting response times.
map
Multi-destination routing & optimization
Determine the fastest or shortest routes between two or more pickup and drop-off points.
driving time calculator with traffic
Large-scale matrix support
Handle up to 5000x5000 for complex, high-volume route calculations.
Register now if you have similar needs, and get access to all the Distancematrix.ai APIs

How this could work for you

A quick example of obtaining the code, using it effectively, and applying it to your workflow

1. Get your API key

Sign up at to obtain an API key. This key will grant you access to both our Distance Matrix and Geocoding APIs.

# Example:  Assign your API key to a variable in your code export

export DISTANCE_MATRIX_API_KEY="YOUR_API_KEY"
2. Convert addresses into coordinates

Use the Geocoding API to transform passenger and driver addresses into latitude/longitude coordinates—essential for precise routing and ETA calculations.

import os
import requests

api_key = os.environ.get("DISTANCE_MATRIX_API_KEY")

geocode_url = "https://api.distancematrix.ai/maps/api/geocode/json"

def geocode_address(address):
    params = {
        'address': address,
        'key': api_key
    }
    
    response = requests.get(geocode_url, params=params).json()
    location = response['results'][0]['geometry']['location']
    
    return location['lat'], location['lng']

# Example: Convert a passenger's address into coordinates
passenger_lat, passenger_lng = geocode_address("1600 Amphitheatre Parkway, Mountain View, CA")
3. Calculate travel times & distances

Once you have coordinates, use the Distance Matrix API to find travel times and distances. The API factors in real-time traffic and other conditions for accurate results.

distance_url = "https://api.distancematrix.ai/maps/api/distancematrix/json"

def get_time_distance(origins, destinations):
    # origins and destinations should be lists of "lat,lng" strings
    params = {
        'origins': '|'.join(origins),
        'destinations': '|'.join(destinations),
        'key': api_key
    }
    
    response = requests.get(distance_url, params=params).json()
    return response

# Example: Check travel times between multiple drivers and one passenger
driver_coords = [
    "37.422,-122.084",  # Driver 1
    "37.7749,-122.4194" # Driver 2
]

passenger_coord = [f"{passenger_lat},{passenger_lng}"]

matrix_data = get_time_distance(driver_coords, passenger_coord)
4. Determine the closest driver using returned data

The Distance Matrix API provides durations and distances for each origin-destination pair. By running a comparison locally, you can identify the driver who can arrive the fastest and estimate the ETA. While this isn’t a built-in feature of the API itself, it’s straightforward to implement using the matrix data.

5. Integrate with your workflow

Display ETAs in your customer app, use coordinates to show live driver positions on a map, and feed distance/duration data into your fare calculation logic. The APIs are flexible and easy to integrate into your existing systems.

Why us?

quick response
Easy as 1-2-3 integration
Our clear, well-structured documentation and code snippets make integration fast and straightforward, enabling you to swiftly enhance your operational capabilities and service efficiency.
real-time traffic
Transparent pricing & flexible plans
No hidden fees, no complicated tiers. Enjoy optimized pricing structures, straightforward per-request costs and volume discounts. Start free, pay as you go.
global coverage
We work wherever you work
Unlike many services operating only in Europe or America, we provide consistent quality worldwide. Verified by our customers from 100+ different countries.
Client's review
"Without accurate travel information, Mobility as a Service would not be useful."
Pim van der Toolen
Product Owner at TURNN
No prepayment is needed.
Start for free and get instant
access to all Distancematrix.ai
products and features