science This product or feature is in the pre-GA Experimental launch stage (pre-GA). Pre-GA products and features might have limited support, and changes to pre-GA products and features might not be compatible with other pre-GA versions. Pre-GA Offerings are covered by the Google Maps Platform Service Specific Terms. For more information, see the launch stage descriptions.
Stay organized with collections
Save and categorize content based on your preferences.
Specifies the assumptions to use when calculating time in traffic. This setting affects the value returned in the duration field in the response, which contains the predicted time in traffic based on historical averages.
Enums
TRAFFIC_MODEL_UNSPECIFIED
Unused. If specified, will default to BEST_GUESS.
BEST_GUESS
Indicates that the returned duration should be the best estimate of travel time given what is known about both historical traffic conditions and live traffic. Live traffic becomes more important the closer the departureTime is to now.
PESSIMISTIC
Indicates that the returned duration should be longer than the actual travel time on most days, though occasional days with particularly bad traffic conditions may exceed this value.
OPTIMISTIC
Indicates that the returned duration should be shorter than the actual travel time on most days, though occasional days with particularly good traffic conditions may be faster than this value.