Search requests can include a commute time filter that restricts returned jobs to those within a specified travel time from a start point. Results include the estimated commute time in seconds for matched jobs.
Specific commute time search
To return jobs within a specific commute time, send a
jobs.search
request and include a CommuteFilter
object in the JobQuery.commuteFilter
field. Cloud Talent Solution uses the job's address
to calculate the commute time to that job. When a detailed address is not
provided Cloud Talent Solution attempts to infer the actual street address of the
job.
Java
To learn how to install and use the client library for CTS, see CTS client libraries. For more information, see the CTS Java API reference documentation.
To authenticate to CTS, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To learn how to install and use the client library for CTS, see CTS client libraries. For more information, see the CTS Java API reference documentation.
To authenticate to CTS, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for CTS, see CTS client libraries. For more information, see the CTS Node.js API reference documentation.
To authenticate to CTS, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To learn how to install and use the client library for CTS, see CTS client libraries. For more information, see the CTS Python API reference documentation.
To authenticate to CTS, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Required fields
commuteMethod
: The method of transportation used to calculate the commute time. Options areDRIVING
,TRANSIT
,WALKING
andCYCLING
transit modes. Walking and cycling routes may not reflect real-world conditions such as construction or include clear walking or cycling paths. These responses includewarnings
in the returned result which you must display to your users.travelDuration
: The maximum travel time in seconds. The maximum allowed value is3600s
(one hour). The format is123s
.startCoordinates
: The latitude and longitude of the location from which to calculate the commute time. This field accepts aLatLng
object.Either
roadTraffic
ordepartureTime
: Commute search results are based on historical and aggregated data rather than live traffic conditions. Users receive the same commute search results no matter what time of day they send a query.roadTraffic
: Specifies the traffic density to use when calculating commute time. TheBUSY_HOUR
/TRAFFIC_FREE
options are the calculated average traffic conditions at morning rush hour and midnight, respectively. This field must not be present ifdepartureTime
is specified.departureTime
: The departure hour to use to calculate traffic impact. Accepts an integer between 0 and 23, representing the hour in the timezone of thestartLocation
. Traffic conditions are calculated from average historical traffic conditions at the specified time of day. This field must not be present ifroadTraffic
is specified.
Optional fields
allowImpreciseAddresses
: "Precise" addresses are defined as either street level addresses or GPS coordinates. IfallowImpreciseAddresses
is set totrue
, jobs with "imprecise" addresses (city, state, or country only) might also be returned. For city level and coarser level addresses, the API uses text matching to return results. If this field is set tofalse
or is not specified, only jobs that include precise addresses are returned.