
Introduction
Google's Distance Matrix API is everywhere, and its bill is hard to predict. Charges run per origin-destination element, request limits force you to split big jobs, and traffic features change the price tier. The product itself is now labeled "Legacy."
A dispatch system that looks cheap in testing can get expensive fast once it recalculates every few minutes.
This guide explains how Google's pricing works, shows what drives cost at scale, and compares seven alternatives for US logistics, fleet, delivery, and field service teams. It ends with a framework for choosing and migrating. Verify all rates against vendor pages before you budget.
Key Takeaways
- Evaluate Google's Compute Route Matrix in the Routes API; the older Distance Matrix API is Legacy.
- Your bill follows elements, feature tier, volume, and adjacent APIs, not HTTP requests.
- The cheapest per-element rate rarely wins; matrix size, truck support, and billing predictability matter more.
- Model peak load, retries, and migration effort before you switch.
What Is the Google Distance Matrix API and How Does Its Pricing Work?
A distance matrix is a grid of travel times and distances between multiple origins and destinations. Rows are origins, columns are destinations, and each origin-destination pair is one element.
Typical US uses include:
- Nearest-driver matching and delivery ETAs
- Technician dispatch and depot ranking
- Cost matrices that feed route optimization
Legacy vs. Routes API
Distance Matrix became Legacy on March 1, 2025. Google's March 2025 announcement states there is no retirement date yet, and Google promises at least 12 months' notice before decommissioning. Legacy services get no new features.
The replacement is POST https://routes.googleapis.com/distanceMatrix/v2:computeRouteMatrix. It moves parameters into POST bodies and headers and requires field masks.
The billing formula
Origins × destinations = billable elements. A dispatch call with 20 drivers and 30 jobs is 600 elements. Run it every minute and the request count looks tiny while the element count explodes.
Pay-as-you-go rates per 1,000 elements, as of the pricing page's latest update:
| Matrix SKU | Free cap/month | Up to 100K | 100K-500K | 500K-1M | 1M-5M | 5M+ |
|---|---|---|---|---|---|---|
| Essentials | 10,000 | $5 | $4 | $3 | $1.50 | $0.38 |
| Pro | 5,000 | $10 | $8 | $6 | $3 | $0.75 |
| Enterprise | 1,000 | $15 | $12 | $9 | $4.50 | $1.14 |
These are marginal bands, so the lower rate applies only to usage within each band. Subscriptions run $100 (Starter), $275 (Essentials) and $1,200 (Pro) per month. Excess usage bills at standard rates.
Limits to check
| Limit | Legacy | Compute Route Matrix |
|---|---|---|
| Origins/destinations | 25 × 25 | 50 combined (addresses/place IDs) |
| Elements per request | 100 | 625; 100 for transit or traffic-aware optimal |
| Rate | 60,000 elements/min | 3,000 elements/min |
Why Google Distance Matrix Costs Increase at Scale
Model the workload
Estimate monthly elements this way:
- Count matrix refreshes per day.
- Multiply by origins and destinations per refresh.
- Multiply by operating days.
- Add peak-season volume and retries.

Shape matters. Element counts scale with how you build each matrix:
- 1-to-many store lookup for 40 stores: 40 elements
- Many-to-1 dispatch across 60 drivers: 60 elements
- Many-to-many optimization for 200 stops: 40,000 elements from one planning run
In field service, 50 technicians against 120 open jobs is 6,000 elements per refresh. Re-optimizing every 15 minutes across a shift multiplies that fast.
Costs outside the matrix call
Adjacent Google SKUs bill separately, at first-tier rates:
- Geocoding: $5 per 1,000
- Autocomplete requests: $2.83 per 1,000
- Place Details Essentials/Pro: $5/$17 per 1,000
- Compute Routes Essentials/Pro: $5/$10 per 1,000
- Dynamic Maps: $7 per 1,000
Stale caches and failed retries add repeat charges. Google's terms generally prohibit caching, though Routes permits caching latitude/longitude for up to 30 consecutive calendar days.
Feature triggers
Traffic-aware options and location modifiers move requests to Pro. Two-wheeler, toll calculation, and large-vehicle elements move them to Enterprise. Confirm each trigger in Google's current documentation.
Hidden operational costs
- Budget alerts are not caps. Pair them with quotas and restricted API keys.
- Splitting large matrices around endpoint limits means engineering time.
- Billing setup, monitoring, and display restrictions add overhead.
Cost-modeling checklist
- Document monthly origin-destination elements.
- Separate standard from advanced requests.
- Measure peak calls per minute.
- Include geocoding and Places usage.
- Compare against both usage-based and predictable-fee options.
Best Google Distance Matrix Alternatives Compared
Compare on pricing unit, free tier, maximum matrix size, sync and async support, traffic, truck routing, custom constraints, SLA, deployment, and migration effort. Billing units differ (elements, transactions, credits, capacity), so normalize to your own workload.
NextBillion.ai
NextBillion.ai is built for logistics, fleet, last-mile delivery, and field service. Confirm current pricing with the company, since plans depend on fleet size, order volume, deployment, and capabilities.
Features high-volume buyers should evaluate:
- Per-vehicle, per-order, or fixed-monthly pricing alongside pay-per-call
- Matrices up to 5,000 × 5,000 in one request, versus Google's 25 × 25 legacy cap
- Truck-compliant routing with height, weight, axle load, length, and hazmat parameters
- Road Editor App for closures, turn restrictions, and speed overrides
- 50+ constraints in route optimization
- Cloud-agnostic and on-premise deployment, with SOC 2 and ISO/IEC 27001:2013 certification
- Integrations with Samsara, Geotab, and Motive
- 99.9% uptime guarantee on contract
Large responses can take around 100 seconds for many thousands of elements, so test latency against your dispatch needs. One US healthcare customer, EasyHealth, reported 62.5% API cost savings, and Printo reported almost 58% lower matrix spend. Results vary by workload.

Logistics and fleet teams can review NextBillion.ai's distance matrix and route optimization capabilities, or talk with a solution engineer about their workload and test with sample origins and destinations.
HERE and TomTom
Both offer established coverage, traffic-aware routing, and truck capabilities.
- HERE v8: 2,500 free transactions/month; up to 10,000 × 10,000 async; explicit truck mode.
- TomTom v2: async matrices up to 100M cells (enterprise-only above 2,500); truck dimensions, weight, and hazmat.
Both bill in transactions, not always pairs, and large-volume pricing requires contacting sales. Public list price is easy to model; negotiated enterprise pricing may be lower but takes longer to evaluate. Large matrices often carry restrictions, such as historical-traffic-only mode.
Mapbox, Geoapify, and TravelTime
| Provider | Billing | Notes |
|---|---|---|
| Mapbox | Elements; 100K free/month; $2/1K at 100K-500K | 25 coordinates (10 with traffic); no dedicated truck profile |
| Geoapify | Credits; paid plans from $59/month | Truck mode; default 1,000 elements, Batch API 2,000/task |
| TravelTime | Fixed annual licence by hits/minute | Quote-based; no per-call fee; truck support not documented |
Cheaper does not mean equivalent. Traffic models and billing units differ, so run the same workload through each.
OSRM and OpenRouteService
Self-hosting can cut variable API spend and give you control. You then own servers, map updates, monitoring, and uptime.
- OSRM: BSD-licensed; traffic via imported edge-weight updates, not a bundled live feed.
- OpenRouteService: GPL-3.0; heavy-vehicle profile; hosted standard matrix is limited to 500/day. Its hosted graph refresh takes about 1-2 weeks.
These suit batch planning and distance estimation without live traffic. Live ETAs for dispatch likely need a managed provider.
Best fit by use case
| Use case | Best-fit direction |
|---|---|
| High-volume fleet dispatch | NextBillion.ai, HERE, TomTom |
| Truck routing | NextBillion.ai, HERE, TomTom |
| Route optimization | NextBillion.ai |
| Store/location search | Mapbox, Geoapify |
| Traffic-aware ETAs | HERE, TomTom, Google |
| Self-hosted | OSRM, OpenRouteService |
| Predictable monthly cost | NextBillion.ai, TravelTime |
Validate every price and limit before publication or purchase.
How to Choose and Migrate From Google Distance Matrix
Buyer checklist
- What is the largest matrix you need?
- Are traffic-aware ETAs mandatory?
- Do you need truck dimensions, hazmat rules, or toll preferences?
- Is synchronous response time enough?
- Do you need on-premise or cloud-agnostic deployment?
Controlled migration
- Export Google billing and request logs.
- Find the highest-cost workflows.
- Pick a representative origin-destination sample.
- Run parallel calculations with candidates.
- Compare travel times and distances.
- Test failure handling and peak throughput.

Google recommends switching production near the start of a month because the new API uses a different SKU and monthly volume tiers.
Integration work
Plan for these changes during the switch:
- Endpoint and parameter updates
- Response-schema mapping
- Unit and address-to-coordinate conversion
- Retries, caching, and key management
- Observability and fallback behavior
NextBillion.ai's sample migration sends the same origins and destinations via POST and reads results from the rows array.
Payback
Divide total migration cost by expected monthly savings, then add infrastructure or support fees. Migration can pay off through predictability, matrix size, truck support, or data control even when direct API savings are modest.
Frequently Asked Questions
How much does the Google Distance Matrix API cost?
It depends on the endpoint, billable elements, volume, feature tier, and free allowances. Compute Route Matrix starts at $5 per 1,000 elements after the free cap. Check Google's pricing calculator for current USD rates.
Are Google Maps APIs (Distance Matrix, Places, Geocoding) free to use?
Only within monthly per-SKU allowances. Each API bills separately, and billing must be enabled on the project.
Can I get a Google Maps API key for free?
Creating a key costs nothing, but production usage is billable. Eligible new users get $300 for 90 days. Restrict keys by application and API, and monitor quotas.
What is a distance matrix?
It's a table of travel distances and times between multiple origins and destinations. For example, it can match drivers to customers or assign technicians to jobs.
What is the best alternative to Google Distance Matrix API for logistics?
It depends on matrix size, traffic, truck restrictions, deployment, and billing model. High-volume teams should compare managed platforms with predictable-fee options against self-hosted routing.
How can I reduce Google Distance Matrix API costs?
Cut unnecessary refreshes, prune origin-destination pairs, cache where terms permit, and use field masks. Monitor element counts, avoid advanced features you don't need, and compare total cost against alternatives.


