I am trying to get the time it takes to get from place A to place B, using several mode of transportation: four-wheel, two-wheel, bicycle, and walk. I am stumbled upon the google distance matrix API and I think it solve my problem, but it's missing the two-wheeler option. Does anybody know how to get the information for the two wheel? or if you have other alternatives I would kindly appreciate it.
P.S. I assume the driving mode they mention in the reference API docs (https://developers.google.com/maps/documentation/distance-matrix/distance-matrix) is used for four wheeler
Use Routes API instead of Distance Matrix API
According to the documentation you provided, specifically at https://developers.google.com/maps/documentation/distance-matrix/distance-matrix#mode, a two-wheeled vehicle type is not available for computing travel time between locations for Distance Matrix API.
However, the Routes API allows computing directions between two locations using the
computeRoutesmethod and supports the two-wheeled vehicle type. Reference: https://developers.google.com/maps/documentation/routes/route_two_wheel#specify_the_two-wheeler_travel_mode.Please note though that two-wheeled vehicle type is currently available to limited countries and regions. You can view the list of the supported countries and regions here: https://developers.google.com/maps/documentation/routes/coverage-two-wheeled.
Here's a sample Routes API request that returns the duration, distance, and polyline direction between two locations in India using the
"travelMode":"TWO_WHEELER":Which returns the following response: