Distance Matrix API
Travel Time & Distance Between Many Points
Calculate travel times and distances between multiple locations efficiently. Essential for logistics optimization, service area analysis, and location-based decision making.
Distance Matrix
Calculate distances between multiple origins and destinations in a single request
Time Matrix
Get accurate travel time estimates for all origin-destination pairs
Parallel Computations
Process hundreds of location pairs simultaneously with optimized algorithms
Fast Computation
Millisecond response times even for large matrices with many locations
Multiple Modes
Calculate matrices for driving, walking, cycling, and transit modes
Cost Analysis
Include distance and time data for transportation cost calculations
Technical Specifications
Matrix TypesDistance & Time Response TimeMillisecond responses Max Locations100x100 matrix Parallel ProcessingOptimized algorithms Supported ModesDrive, Walk, Cycle, Transit Mode FlexibilityPer-request configuration Free Tier100,000 calculations/month Ready to Get Started?
Start building with MapAtlas today. Sign up for free and get instant access to all our mapping APIs with generous free tier limits.
Building with AI? Call this API directly from your agent.
Cursor, Copilot, Cline, and autonomous agents can use this endpoint via the public OpenAPI 3.1 spec or the MapAtlas MCP server. Auto-discovery, no glue code.
Matrix API: common questions
Everything you need to know about bulk distance and travel time calculations.
What is the Matrix API used for?
The Matrix API calculates travel times and distances between every combination of origins and destinations in a single request. Typical use cases include finding the nearest driver or technician to a job, solving vehicle routing problems, estimating delivery time windows for customers, and calculating service area coverage for facility planning.
What is the difference between the Matrix API and the Directions API?
The Directions API returns a single detailed route between two points, including turn instructions and geometry. The Matrix API returns a table of distances and durations for multiple origin-destination pairs without route geometry. If you need to compare many locations efficiently, the Matrix API is faster and more cost-effective than making individual Directions calls.
What is the maximum matrix size?
The API supports matrices up to 100 origins by 100 destinations in a single request, giving up to 10,000 origin-destination pairs per call. Matrices do not need to be square: you can send 1 origin by 100 destinations for a nearest-location lookup, or 50 by 50 for a full fleet-to-customer assignment.
Which travel modes does the Matrix API support?
The Matrix API supports driving, walking, cycling, and public transit. The travel mode is set per request. All pairs in a single request use the same mode. If you need mixed-mode results, send separate requests for each mode and merge the responses in your application.
Does the Matrix API use real-time traffic data?
By default the Matrix API uses free-flow road speeds representative of typical travel conditions. Real-time traffic-adjusted durations are available on eligible plans. Set the departure_time parameter to a future timestamp to receive time-of-day travel estimates based on historical traffic patterns.
How do I use the Matrix API for nearest-location lookups?
Send your single query location as the origin and your list of candidate locations as destinations. The API returns the travel time and distance from the query point to every candidate in one call. Sort the response by duration to find the nearest option. This is significantly more efficient than calling the Directions API in a loop for each candidate.