# JobQuery

- [JSON representation](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#SCHEMA_REPRESENTATION)
- [LocationFilter](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#LocationFilter)
  - [JSON representation](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#LocationFilter.SCHEMA_REPRESENTATION)
- [TelecommutePreference](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#TelecommutePreference)
- [CommuteFilter](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CommuteFilter)
  - [JSON representation](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CommuteFilter.SCHEMA_REPRESENTATION)
- [CommuteMethod](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CommuteMethod)
- [RoadTraffic](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#RoadTraffic)
- [TimeOfDay](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#TimeOfDay)
  - [JSON representation](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#TimeOfDay.SCHEMA_REPRESENTATION)
- [CompensationFilter](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CompensationFilter)
  - [JSON representation](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CompensationFilter.SCHEMA_REPRESENTATION)
- [FilterType](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#FilterType)
- [TimestampRange](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#TimestampRange)
  - [JSON representation](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#TimestampRange.SCHEMA_REPRESENTATION)

The query required to perform a search query.

| JSON representation |
|---|
| ``` { "query": string, "queryLanguageCode": string, "companies": [ string ], "locationFilters": [ { object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#LocationFilter`) } ], "jobCategories": [ enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#JobCategory`) ], "commuteFilter": { object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CommuteFilter`) }, "companyDisplayNames": [ string ], "compensationFilter": { object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CompensationFilter`) }, "customAttributeFilter": string, "disableSpellCheck": boolean, "employmentTypes": [ enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#EmploymentType`) ], "languageCodes": [ string ], "publishTimeRange": { object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#TimestampRange`) }, "excludedJobs": [ string ] } ``` |

| Fields ||
|---|---|
| `query` | `string` The query string that matches against the job title, description, and location fields. The maximum number of allowed characters is 255. |
| `queryLanguageCode` | `string` The language code of `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#FIELDS.query`. For example, "en-US". This field helps to better interpret the query. If a value isn't specified, the query language code is automatically detected, which may not be accurate. Language code should be in BCP-47 format, such as "en-US" or "sr-Latn". For more information, see [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). |
| `companies[]` | `string` This filter specifies the company entities to search against. If a value isn't specified, jobs are searched for against all companies. If multiple values are specified, jobs are searched against the companies specified. The format is "projects/{projectId}/tenants/{tenantId}/companies/{company_id}". For example, "projects/foo/tenants/bar/companies/baz". At most 20 company filters are allowed. |
| `locationFilters[]` | ``object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#LocationFilter`)`` The location filter specifies geo-regions containing the jobs to search against. See `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#LocationFilter` for more information. If a location value isn't specified, jobs fitting the other search criteria are retrieved regardless of where they're located. If multiple values are specified, jobs are retrieved from any of the specified locations. If different values are specified for the `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#LocationFilter.FIELDS.distance_in_miles` parameter, the maximum provided distance is used for all locations. At most 5 location filters are allowed. |
| `jobCategories[]` | ``enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#JobCategory`)`` The category filter specifies the categories of jobs to search against. See `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#JobCategory` for more information. If a value isn't specified, jobs from any category are searched against. If multiple values are specified, jobs from any of the specified categories are searched against. |
| `commuteFilter` | ``object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CommuteFilter`)`` Allows filtering jobs by commute time with different travel methods (for example, driving or public transit). Note: This only works when you specify a `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CommuteMethod`. In this case, `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#FIELDS.location_filters` is ignored. Currently we don't support sorting by commute time. |
| `companyDisplayNames[]` | `string` This filter specifies the company `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.companies#Company.FIELDS.display_name` of the jobs to search against. The company name must match the value exactly. Alternatively, the value being searched for can be wrapped in different match operators. `SUBSTRING_MATCH([value])` The company name must contain a case insensitive substring match of the value. Using this function may increase latency. Sample Value: `SUBSTRING_MATCH(google)` `MULTI_WORD_TOKEN_MATCH([value])` The value will be treated as a multi word token and the company name must contain a case insensitive match of the value. Using this function may increase latency. Sample Value: `MULTI_WORD_TOKEN_MATCH(google)` If a value isn't specified, jobs within the search results are associated with any company. If multiple values are specified, jobs within the search results may be associated with any of the specified companies. At most 20 company display name filters are allowed. |
| `compensationFilter` | ``object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CompensationFilter`)`` This search filter is applied only to `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#Job.FIELDS.compensation_info`. For example, if the filter is specified as "Hourly job with per-hour compensation \> $15", only jobs meeting these criteria are searched. If a filter isn't defined, all open jobs are searched. |
| `customAttributeFilter` | `string` This filter specifies a structured syntax to match against the `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#Job.FIELDS.custom_attributes` marked as `filterable`. The syntax for this expression is a subset of SQL syntax. Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the left of the operator is a custom field key and the right of the operator is a number or a quoted string. You must escape backslash (\\) and quote (") characters. Supported functions are `LOWER([field_name])` to perform a case insensitive match and `EMPTY([field_name])` to filter on the existence of a key. Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 comparisons or functions are allowed in the expression. The expression must be \< 10000 bytes in length. Sample Query: `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND driving_years > 10` |
| `disableSpellCheck` | `boolean` This flag controls the spell-check feature. If false, the service attempts to correct a misspelled query, for example, "enginee" is corrected to "engineer". Defaults to false: a spell check is performed. |
| `employmentTypes[]` | ``enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#EmploymentType`)`` The employment type filter specifies the employment type of jobs to search against, such as `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#EmploymentType.ENUM_VALUES.FULL_TIME`. If a value isn't specified, jobs in the search results includes any employment type. If multiple values are specified, jobs in the search results include any of the specified employment types. |
| `languageCodes[]` | `string` This filter specifies the locale of jobs to search against, for example, "en-US". If a value isn't specified, the search results can contain jobs in any locale. Language codes should be in BCP-47 format, such as "en-US" or "sr-Latn". For more information, see [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). At most 10 language code filters are allowed. |
| `publishTimeRange` | ``object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#TimestampRange`)`` Jobs published within a range specified by this filter are searched against. |
| `excludedJobs[]` | `string` This filter specifies a list of job names to be excluded during search. At most 400 excluded job names are allowed. |

## LocationFilter

Geographic region of the search.

| JSON representation |
|---|
| ``` { "address": string, "regionCode": string, "latLng": { object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/Location#LatLng`) }, "distanceInMiles": number, "telecommutePreference": enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#TelecommutePreference`) } ``` |

| Fields ||
|---|---|
| `address` | `string` The address name, such as "Mountain View" or "Bay Area". |
| `regionCode` | `string` CLDR region code of the country/region. This field may be used in two ways: 1) If telecommute preference is not set, this field is used address ambiguity of the user-input address. For example, "Liverpool" may refer to "Liverpool, NY, US" or "Liverpool, UK". This region code biases the address resolution toward a specific country or territory. If this field is not set, address resolution is biased toward the United States by default. 2) If telecommute preference is set to TELECOMMUTE_ALLOWED, the telecommute location filter will be limited to the region specified in this field. If this field is not set, the telecommute job locations will not be See <https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/territory_information.html> for details. Example: "CH" for Switzerland. |
| `latLng` | ``object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/Location#LatLng`)`` The latitude and longitude of the geographic center to search from. This field is ignored if `address` is provided. |
| `distanceInMiles` | `number` The distanceInMiles is applied when the location being searched for is identified as a city or smaller. This field is ignored if the location being searched for is a state or larger. |
| `telecommutePreference` | ``enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#TelecommutePreference`)`` Allows the client to return jobs without a set location, specifically, telecommuting jobs (telecommuting is considered by the service as a special location). `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#Job.FIELDS.posting_region` indicates if a job permits telecommuting. If this field is set to `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#TelecommutePreference.ENUM_VALUES.TELECOMMUTE_ALLOWED`, telecommuting jobs are searched, and `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#LocationFilter.FIELDS.address` and `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#LocationFilter.FIELDS.lat_lng` are ignored. If not set or set to `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#TelecommutePreference.ENUM_VALUES.TELECOMMUTE_EXCLUDED`, the telecommute status of the jobs is ignored. Jobs that have `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#PostingRegion.ENUM_VALUES.TELECOMMUTE` and have additional `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#Job.FIELDS.addresses` may still be matched based on other location filters using `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#LocationFilter.FIELDS.address` or `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#LocationFilter.FIELDS.lat_lng`. This filter can be used by itself to search exclusively for telecommuting jobs, or it can be combined with another location filter to search for a combination of job locations, such as "Mountain View" or "telecommuting" jobs. However, when used in combination with other location filters, telecommuting jobs can be treated as less relevant than other jobs in the search response. This field is only used for job search requests. |

## TelecommutePreference

Specify whether to include telecommute jobs.

| Enums ||
|---|---|
| `TELECOMMUTE_PREFERENCE_UNSPECIFIED` | Default value if the telecommute preference isn't specified. |
| `TELECOMMUTE_EXCLUDED` | Deprecated: Ignore telecommute status of jobs. Use TELECOMMUTE_JOBS_EXCLUDED if want to exclude telecommute jobs. > [!WARNING] > This item is deprecated! |
| `TELECOMMUTE_ALLOWED` | Allow telecommute jobs. |
| `TELECOMMUTE_JOBS_EXCLUDED` | Exclude telecommute jobs. |

## CommuteFilter

Parameters needed for commute search.

| JSON representation |
|---|
| ``` { "commuteMethod": enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CommuteMethod`), "startCoordinates": { object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/Location#LatLng`) }, "travelDuration": string, "allowImpreciseAddresses": boolean, // Union field `traffic_option` can be only one of the following: "roadTraffic": enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#RoadTraffic`), "departureTime": { object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#TimeOfDay`) } // End of list of possible types for union field `traffic_option`. } ``` |

| Fields ||
|---|---|
| `commuteMethod` | ``enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CommuteMethod`)`` Required. The method of transportation to calculate the commute time for. |
| `startCoordinates` | ``object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/Location#LatLng`)`` Required. The latitude and longitude of the location to calculate the commute time from. |
| `travelDuration` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` Required. The maximum travel time in seconds. The maximum allowed value is `3600s` (one hour). Format is `123s`. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |
| `allowImpreciseAddresses` | `boolean` If `true`, jobs without street level addresses may also be returned. For city level addresses, the city center is used. For state and coarser level addresses, text matching is used. If this field is set to `false` or isn't specified, only jobs that include street level addresses will be returned by commute search. |
| Union field `traffic_option`. Traffic factor to take into account while searching by commute. `traffic_option` can be only one of the following: ||
| `roadTraffic` | ``enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#RoadTraffic`)`` Specifies the traffic density to use when calculating commute time. |
| `departureTime` | ``object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#TimeOfDay`)`` The departure time used to calculate traffic impact, represented as `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#TimeOfDay` in local time zone. Currently traffic model is restricted to hour level resolution. |

## CommuteMethod

Method for commute. Walking, biking and wheelchair accessible transit is still in the Preview stage.

| Enums ||
|---|---|
| `COMMUTE_METHOD_UNSPECIFIED` | Commute method isn't specified. |
| `DRIVING` | Commute time is calculated based on driving time. |
| `TRANSIT` | Commute time is calculated based on public transit including bus, metro, subway, and so on. |
| `WALKING` | Commute time is calculated based on walking time. |
| `CYCLING` | Commute time is calculated based on biking time. |
| `TRANSIT_ACCESSIBLE` | Commute time is calculated based on public transit that is wheelchair accessible. |

## RoadTraffic

The traffic density to use when calculating commute time.

| Enums ||
|---|---|
| `ROAD_TRAFFIC_UNSPECIFIED` | Road traffic situation isn't specified. |
| `TRAFFIC_FREE` | Optimal commute time without considering any traffic impact. |
| `BUSY_HOUR` | Commute time calculation takes in account the peak traffic impact. |

## TimeOfDay

Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are `google.type.Date` and `google.protobuf.Timestamp`.

| JSON representation |
|---|
| ``` { "hours": integer, "minutes": integer, "seconds": integer, "nanos": integer } ``` |

| Fields ||
|---|---|
| `hours` | `integer` Hours of a day in 24 hour format. Must be greater than or equal to 0 and typically must be less than or equal to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time. |
| `minutes` | `integer` Minutes of an hour. Must be greater than or equal to 0 and less than or equal to 59. |
| `seconds` | `integer` Seconds of a minute. Must be greater than or equal to 0 and typically must be less than or equal to 59. An API may allow the value 60 if it allows leap-seconds. |
| `nanos` | `integer` Fractions of seconds, in nanoseconds. Must be greater than or equal to 0 and less than or equal to 999,999,999. |

## CompensationFilter

Filter on job compensation type and amount.

| JSON representation |
|---|
| ``` { "type": enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#FilterType`), "units": [ enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#CompensationUnit`) ], "range": { object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#CompensationRange`) }, "includeJobsWithUnspecifiedCompensationRange": boolean } ``` |

| Fields ||
|---|---|
| `type` | ``enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#FilterType`)`` Required. Type of filter. |
| `units[]` | ``enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#CompensationUnit`)`` Required. Specify desired `base compensation entry's` `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#CompensationUnit`. |
| `range` | ``object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#CompensationRange`)`` Compensation range. |
| `includeJobsWithUnspecifiedCompensationRange` | `boolean` If set to true, jobs with unspecified compensation range fields are included. |

## FilterType

Specify the type of filtering.

| Enums ||
|---|---|
| `FILTER_TYPE_UNSPECIFIED` | Filter type unspecified. Position holder, INVALID, should never be used. |
| `UNIT_ONLY` | Filter by `base compensation entry's` unit. A job is a match if and only if the job contains a base CompensationEntry and the base CompensationEntry's unit matches provided `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CompensationFilter.FIELDS.units`. Populate one or more `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CompensationFilter.FIELDS.units`. See `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#CompensationEntry` for definition of base compensation entry. |
| `UNIT_AND_AMOUNT` | Filter by `base compensation entry's` unit and amount / range. A job is a match if and only if the job contains a base CompensationEntry, and the base entry's unit matches provided `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#CompensationUnit` and amount or range overlaps with provided `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#CompensationRange`. See `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants.jobs#CompensationEntry` for definition of base compensation entry. Set exactly one `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CompensationFilter.FIELDS.units` and populate `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CompensationFilter.FIELDS.range`. |
| `ANNUALIZED_BASE_AMOUNT` | Filter by annualized base compensation amount and `base compensation entry's` unit. Populate `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CompensationFilter.FIELDS.range` and zero or more `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CompensationFilter.FIELDS.units`. |
| `ANNUALIZED_TOTAL_AMOUNT` | Filter by annualized total compensation amount and `base compensation entry's` unit . Populate `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CompensationFilter.FIELDS.range` and zero or more `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/JobQuery#CompensationFilter.FIELDS.units`. |

## TimestampRange

Message representing a period of time between two timestamps.

| JSON representation |
|---|
| ``` { "startTime": string, "endTime": string } ``` |

| Fields ||
|---|---|
| `startTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Begin of the period (inclusive). A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `endTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` End of the period (exclusive). A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |