[][src]Module google_maps::distance_matrix

The Distance Matrix API is a service that provides travel distance and time for a matrix of origins and destinations, based on the recommended route between start and end points.

Get Started

Start coding with our client libraries

Client libraries make developing with the Google Maps web service APIs easier by providing simple, native implementations of common tasks, such as authentication, request throttling and automatic retry. The Distance Matrix API is available in the Java Client, Python Client, Go Client and Node.js Client for Google Maps Services.

Authentication, quotas, pricing, and policies

Activate the API and get an API key

To use the Distance Matrix API, you must first activate the API in the Google Cloud Platform Console and obtain the proper authentication credentials. You need to provide an API key in each request (or a client ID if you have a Premium Plan.

Click the button below to flow through a process where you will:

  1. Create or select a project
  2. Enable the API
  3. Get an API key

Get Started

Learn more about authentication credentials.

Quotas and pricing

Review the usage and billing page for details on the quotas and pricing set for the Distance Matrix API.

Policies

Use of the Distance Matrix API must be in accordance with the API policies.

Learn more

There’s more you can do with the Distance Matrix API, like requesting distance data for different travel modes, requesting distance data in different units (for example, kilometers or miles), and estimating travel time in traffic. See the Distance Matrix API developer guide for more examples and other details.

The Distance Matrix API developer guide is intended for developers who wish to compute travel distance and time between a number of points within maps provided by one of the Google Maps APIs. It provides an introduction to using the API and reference material on the available parameters.

Re-exports

pub use crate::directions::request::avoid::Avoid;
pub use crate::directions::request::departure_time::DepartureTime;
pub use crate::directions::request::location::Location;
pub use crate::directions::request::traffic_model::TrafficModel;
pub use crate::directions::request::transit_mode::TransitMode;
pub use crate::directions::request::transit_route_preference::TransitRoutePreference;
pub use crate::directions::request::unit_system::UnitSystem;
pub use crate::directions::request::waypoint::Waypoint;
pub use crate::directions::response::directions_distance::DirectionsDistance;
pub use crate::directions::response::directions_duration::DirectionsDuration;
pub use crate::directions::response::driving_maneuver::DrivingManeuver;
pub use crate::directions::response::leg::Leg;
pub use crate::directions::response::overview_polyline::OverviewPolyline;
pub use crate::directions::response::polyline::Polyline;
pub use crate::directions::response::route::Route;
pub use crate::directions::response::step::Step;
pub use crate::directions::response::transit_agency::TransitAgency;
pub use crate::directions::response::transit_currency::TransitCurrency;
pub use crate::directions::response::transit_details::TransitDetails;
pub use crate::directions::response::transit_fare::TransitFare;
pub use crate::directions::response::transit_line::TransitLine;
pub use crate::directions::response::transit_stop::TransitStop;
pub use crate::directions::response::transit_time::TransitTime;
pub use crate::directions::response::transit_vehicle::TransitVehicle;
pub use crate::directions::travel_mode::TravelMode;
pub use crate::directions::vehicle_type::VehicleType;
pub use crate::distance_matrix::request::Request as DistanceMatrixRequest;
pub use crate::distance_matrix::response::Response as DistanceMatrixResponse;
pub use crate::distance_matrix::response::status::Status as DistanceMatrixStatus;

Modules

error

Distance Matrix API error types and error messages.

request

Look in this module for documentation on building your Distance Matrix API query. In particular, look at the Request struct for examples of the builder pattern. This module contains the tools (enums, structs, methods) for building your Google Maps Platform request.

response

Resources (enums, structs) for processing the Distance Matrix API response from the Google Maps Platform. Look in here for more information about the data returned from Google's server and how to parse it with your program. The Distance Matrix API shares many enums and struct with the Directions API. If you're not finding what you're looking for in this module, check out the Directions modules also.