Method: projects.jobs.searchForAlert

Searches for jobs using the provided SearchJobsRequest.

This API call is intended for the use case of targeting passive job seekers (for example, job seekers who have signed up to receive email alerts about potential job opportunities), and has different algorithmic adjustments that are targeted to passive job seekers.

This call constrains the visibility of jobs present in the database, and only returns jobs the caller has permission to search against.

HTTP request

POST https://jobs.googleapis.com/v3p1beta1/{parent=projects/*}/jobs:searchForAlert

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. The resource name of the project to search within.

The format is "projects/{project_id}", for example, "projects/api-test-project".

Request body

The request body contains data with the following structure:

JSON representation
{
  "searchMode": enum (SearchMode),
  "requestMetadata": {
    object (RequestMetadata)
  },
  "jobQuery": {
    object (JobQuery)
  },
  "enableBroadening": boolean,
  "requirePreciseResultSize": boolean,
  "histogramFacets": {
    object (HistogramFacets)
  },
  "histogramQueries": [
    {
      object (HistogramQuery)
    }
  ],
  "jobView": enum (JobView),
  "offset": number,
  "pageSize": number,
  "pageToken": string,
  "orderBy": string,
  "diversificationLevel": enum (DiversificationLevel),
  "customRankingInfo": {
    object (CustomRankingInfo)
  },
  "disableKeywordMatch": boolean
}
Fields
searchMode

enum (SearchMode)

Optional. Mode of a search.

Defaults to SearchMode.JOB_SEARCH.

requestMetadata

object (RequestMetadata)

Required. The meta information collected about the job searcher, used to improve the search quality of the service. The identifiers (such as userId) are provided by users, and must be unique and consistent.

jobQuery

object (JobQuery)

Optional. Query used to search against jobs, such as keyword, location filters, etc.

enableBroadening

boolean

Optional. Controls whether to broaden the search when it produces sparse results. Broadened queries append results to the end of the matching results list.

Defaults to false.

requirePreciseResultSize

boolean

Optional. Controls if the search job request requires the return of a precise count of the first 300 results. Setting this to true ensures consistency in the number of results per page. Best practice is to set this value to true if a client allows users to jump directly to a non-sequential search results page.

Enabling this flag may adversely impact performance.

Defaults to false.

histogramFacets

object (HistogramFacets)

Optional. Histogram requests for jobs matching JobQuery.

histogramQueries[]

object (HistogramQuery)

Optional. Expression based histogram requests for jobs matching JobQuery.

jobView

enum (JobView)

Optional. The desired job attributes returned for jobs in the search response. Defaults to [JobView.SMALL][] if no value is specified.

offset

number

Optional. An integer that specifies the current offset (that is, starting result location, amongst the jobs deemed by the API as relevant) in search results. This field is only considered if pageToken is unset.

For example, 0 means to return results starting from the first matching job, and 10 means to return from the 11th job. This can be used for pagination, (for example, pageSize = 10 and offset = 10 means to return from the second page).

pageSize

number

Optional. A limit on the number of jobs returned in the search results. Increasing this value above the default value of 10 can increase search response time. The value can be between 1 and 100.

pageToken

string

Optional. The token specifying the current offset within search results. See SearchJobsResponse.next_page_token for an explanation of how to obtain the next set of query results.

orderBy

string

Optional. The criteria determining how search results are sorted. Default is "relevance desc".

Supported options are:

  • "relevance desc": By relevance descending, as determined by the API algorithms. Relevance thresholding of query results is only available with this ordering.
  • "postingPublishTime desc": By Job.posting_publish_time descending.
  • "postingUpdateTime desc": By Job.posting_update_time descending.
  • "title": By Job.title ascending.
  • "title desc": By Job.title descending.
  • "annualized_base_compensation": By job's CompensationInfo.annualized_base_compensation_range ascending. Jobs whose annualized base compensation is unspecified are put at the end of search results.
  • "annualized_base_compensation desc": By job's CompensationInfo.annualized_base_compensation_range descending. Jobs whose annualized base compensation is unspecified are put at the end of search results.
  • "annualized_total_compensation": By job's CompensationInfo.annualized_total_compensation_range ascending. Jobs whose annualized base compensation is unspecified are put at the end of search results.
  • "annualized_total_compensation desc": By job's CompensationInfo.annualized_total_compensation_range descending. Jobs whose annualized base compensation is unspecified are put at the end of search results.
  • "custom_ranking desc": By the relevance score adjusted to the [SearchJobsRequest.custom_ranking_info.ranking_expression][] with weight factor assigned by [SearchJobsRequest.custom_ranking_info.importance_level][] in descending order.
  • Location sorting: Use the special syntax to order jobs by distance:
    "distance_from('Hawaii')": Order by distance from Hawaii.
    "distance_from(19.89, 155.5)": Order by distance from a coordinate.
    "distance_from('Hawaii'), distance_from('Puerto Rico')": Order by multiple locations. See details below.
    "distance_from('Hawaii'), distance_from(19.89, 155.5)": Order by multiple locations. See details below.
    The string can have a maximum of 256 characters. When multiple distance centers are provided, a job that is close to any of the distance centers would have a high rank. When a job has multiple locations, the job location closest to one of the distance centers will be used. Jobs that don't have locations will be ranked at the bottom. Distance is calculated with a precision of 11.3 meters (37.4 feet). Diversification strategy is still applied unless explicitly disabled in diversificationLevel.

diversificationLevel

enum (DiversificationLevel)

Optional. Controls whether highly similar jobs are returned next to each other in the search results. Jobs are identified as highly similar based on their titles, job categories, and locations. Highly similar results are clustered so that only one representative job of the cluster is displayed to the job seeker higher up in the results, with the other jobs being displayed lower down in the results.

Defaults to DiversificationLevel.SIMPLE if no value is specified.

customRankingInfo

object (CustomRankingInfo)

Optional. Controls over how job documents get ranked on top of existing relevance score (determined by API algorithm).

disableKeywordMatch

boolean

Optional. Controls whether to disable exact keyword match on [Job.job_title][], Job.description, Job.company_display_name, [Job.locations][0], Job.qualifications. When disable keyword match is turned off, a keyword match returns jobs that do not match given category filters when there are matching keywords. For example, the query "program manager," a result is returned even if the job posting has the title "software developer," which does not fall into "program manager" ontology, but does have "program manager" appearing in its description.

For queries like "cloud" that does not contain title or location specific ontology, jobs with "cloud" keyword matches are returned regardless of this flag's value.

Please use [Company.keyword_searchable_custom_fields][] or [Company.keyword_searchable_custom_attributes][] if company specific globally matched custom field/attribute string values is needed. Enabling keyword match improves recall of subsequent search requests.

Defaults to false.

Response body

If successful, the response body contains an instance of SearchJobsResponse.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/jobs
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

Try it!