Geocodio's Distance API can calculate the driving and straightline (as the crow flies) distance between U.S. and Canadian addresses or coordinates. Geocodio's Distance API can calculate distances from one origin to multiple destinations, or from many origins to many destinations (a "distance matrix").
Distance calculations are currently available via API only. Spreadsheet upload support is planned for the future. If you're interested in spreadsheet support for distance, please let us know!
Depending on the calculation mode you choose, Geocodio returns:
Geocodio offers three distance endpoints. All of Geocodio's distance endpoints support one-to-one, one-to-many, and many-to-many calculations, as well as driving distance, driving time, and straightline distance.
| Endpoint | Use case | Processing | Max calculations |
|---|---|---|---|
| Distance | Real-time, single-origin calculations | Synchronous | 100 per request |
| Distance Matrix | Batch processing with immediate results | Synchronous | 10,000 per request |
| Distance Jobs | Large-scale processing | Async | 50,000 per job |
Use the Distance endpoint when you need instant results for one origin (e.g., showing a customer how far a technician is) when you need to return results to a user in real time. Use Distance Matrix for batch calculations that need to return immediately. Use Distance Jobs when processing large volumes in the background.
You can provide either addresses or coordinates as input. If you provide addresses, Geocodio geocodes them as part of the distance calculation.
You can also add custom identifiers to your coordinates (e.g., 37.7749,-122.4194,warehouse_sf) to make it easier to match results back to your data.
To use the Distance API, you must enable Distance permissions for your API key:
See the Distance API documentation for code examples and detailed endpoint specifications.
Distance calculations use Geocodio's credit system. Distance is a separate product from geocoding, and is not included in geocoding subscriptions (such as Unlimited).
Purchased credits do not expire, and can be used for both geocoding and distance. Volume discounts are available for purchases of 500,000 credits or more. See credit pricing in the Billing section of your account dashboard.
Self-Service pay-as-you-go users receive 2,500 free credits per day, which can be used for distance calculations.
Enterprise Flex subscribers can use their subscription's included credits towards distance calculations.
Unlimited Geocoding subscribers (both Self-Service and Enterprise) must pay for distance calculations, but the geocoding component will be done using your dedicated instance(s), so you won't be charged additionally for it.
Distance is not currently available for on-premises license holders.
| Component | Credits |
|---|---|
| Geocoding (per address) | 1 credit |
| Straightline distance (per calculation) | 1 credit |
| Driving distance (per calculation) | 2 credits |
If you provide coordinates instead of addresses, you do not have to pay for geocoding. Approximate addresses, however, will not be returned. If you need reverse geocoding and distance at the same time, use the geocoding endpoint with distance.
Scenario: 1,000 patients × 50 clinic locations
Straightline distance:
Driving distance:
Geocodio's Distance API supports locations in the United States and Canada. You can calculate distances between:
For Canadian addresses, include "Canada" (spelled out, not abbreviated) in the address or use coordinates.