Stay organized with collections
Save and categorize content based on your preferences.
Cloud Talent Solution also offers a search API, SearchJobsForAlert,
that's tuned to the needs of "passive job seekers." These are individuals not
necessarily actively looking for a job, but might be inclined to apply for one if the
right circumstances arise. For example, a customer can leverage Cloud Talent Solution
to populate the contents of an email campaign designed to offer periodic updates
of jobs individuals might be interested in.
The results of SearchJobsForAlert may be different to those from searchJobs
and are intended for use in job alert emails and other campaigns that are
targeted towards passive job seekers.
Use the date posted filter when calling SearchJobsForAlert to restrict the
set of jobs being searched to those posted since the last alert was generated. For additional
information on using this feature, see the email alerts implementation guide.
Email alert searches are made in the same way as a regular search:
/** Search jobs for alert. */publicstaticvoidsearchForAlerts(StringcompanyName)throwsIOException,InterruptedException{// Make sure to set the requestMetadata the same as the associated search requestRequestMetadatarequestMetadata=newRequestMetadata()// Make sure to hash your userID.setUserId("HashedUserId")// Make sure to hash the sessionID.setSessionId("HashedSessionID")// Domain of the website where the search is conducted.setDomain("www.google.com");SearchJobsRequestrequest=newSearchJobsRequest().setRequestMetadata(requestMetadata).setSearchMode("JOB_SEARCH");// Set the search mode to a regular searchif(companyName!=null){request.setJobQuery(newJobQuery().setCompanyNames(Arrays.asList(companyName)));}SearchJobsResponseresponse=talentSolutionClient.projects().jobs().searchForAlert(DEFAULT_PROJECT_ID,request).execute();Thread.sleep(1000);System.out.printf("Search jobs for alert results: %s\n",response);}
// searchForAlerts searches for jobs with email alert set which could receive// updates later if search result updates.funcsearchForAlerts(wio.Writer,projectID,companyNamestring)(*talent.SearchJobsResponse,error){ctx:=context.Background()client,err:=google.DefaultClient(ctx,talent.CloudPlatformScope)iferr!=nil{returnnil,fmt.Errorf("google.DefaultClient: %w",err)}// Create the jobs service client.service,err:=talent.New(client)iferr!=nil{returnnil,fmt.Errorf("talent.New: %w",err)}parent:="projects/"+projectIDreq:=&talent.SearchJobsRequest{// Make sure to set the RequestMetadata the same as the associated// search request.RequestMetadata:&talent.RequestMetadata{// Make sure to hash your userID.UserId:"HashedUsrId",// Make sure to hash the sessionID.SessionId:"HashedSessionId",// Domain of the website where the search is conducted.Domain:"www.googlesample.com",},// Set the search mode to a regular search.SearchMode:"JOB_SEARCH",}ifcompanyName!=""{req.JobQuery=&talent.JobQuery{CompanyNames:[]string{companyName},}}resp,err:=service.Projects.Jobs.SearchForAlert(parent,req).Do()iferr!=nil{returnnil,fmt.Errorf("failed to search for jobs with alerts: %w",err)}fmt.Fprintln(w,"Jobs:")for_,j:=rangeresp.MatchingJobs{fmt.Fprintf(w,"\t%q\n",j.Job.Name)}returnresp,nil}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Email alerts (v3)\n\nCloud Talent Solution also offers a search API, [`SearchJobsForAlert`](/talent-solution/job-search/v3/docs/reference/rpc/google.cloud.talent.v3#google.cloud.talent.v3.JobService.SearchJobsForAlert),\nthat's tuned to the needs of \"passive job seekers.\" These are individuals not\nnecessarily actively looking for a job, but might be inclined to apply for one if the\nright circumstances arise. For example, a customer can leverage Cloud Talent Solution\nto populate the contents of an email campaign designed to offer periodic updates\nof jobs individuals might be interested in.\nThe results of `SearchJobsForAlert` may be different to those from `searchJobs`\nand are intended for use in job alert emails and other campaigns that are\ntargeted towards passive job seekers.\nUse the date posted filter when calling `SearchJobsForAlert` to restrict the\nset of jobs being searched to those posted since the last alert was generated. For additional\ninformation on using this feature, see the email alerts [implementation guide](/talent-solution/job-search/v3/docs/email).\n\nEmail alert searches are made in the same way as a regular search: \n\n### Java\n\n\nFor more on installing and creating a Cloud Talent Solution client, see\n[Cloud Talent Solution Client Libraries](/talent-solution/job-search/v3/docs/libraries). \n\n\n /** Search jobs for alert. */\n public static void searchForAlerts(String companyName) throws IOException, InterruptedException {\n // Make sure to set the requestMetadata the same as the associated search request\n RequestMetadata requestMetadata =\n new RequestMetadata()\n // Make sure to hash your userID\n .setUserId(\"HashedUserId\")\n // Make sure to hash the sessionID\n .setSessionId(\"HashedSessionID\")\n // Domain of the website where the search is conducted\n .setDomain(\"www.google.com\");\n\n SearchJobsRequest request =\n new SearchJobsRequest()\n .setRequestMetadata(requestMetadata)\n .setSearchMode(\"JOB_SEARCH\"); // Set the search mode to a regular search\n if (companyName != null) {\n request.setJobQuery(new JobQuery().setCompanyNames(Arrays.asList(companyName)));\n }\n\n SearchJobsResponse response =\n talentSolutionClient\n .projects()\n .jobs()\n .searchForAlert(DEFAULT_PROJECT_ID, request)\n .execute();\n Thread.sleep(1000);\n System.out.printf(\"Search jobs for alert results: %s\\n\", response);\n }\n\n### Python\n\n\nFor more on installing and creating a Cloud Talent Solution client, see\n[Cloud Talent Solution Client Libraries](/talent-solution/job-search/v3/docs/libraries). \n\n def search_for_alerts(client_service, company_name):\n request_metadata = {\n \"user_id\": \"HashedUserId\",\n \"session_id\": \"HashedSessionId\",\n \"domain\": \"www.google.com\",\n }\n request = {\n \"search_mode\": \"JOB_SEARCH\",\n \"request_metadata\": request_metadata,\n }\n if company_name is not None:\n request.update({\"job_query\": {\"company_names\": [company_name]}})\n response = (\n client_service.projects()\n .jobs()\n .searchForAlert(parent=parent, body=request)\n .execute()\n )\n print(response)\n\n### Go\n\n\nFor more on installing and creating a Cloud Talent Solution client, see\n[Cloud Talent Solution Client Libraries](/talent-solution/job-search/v3/docs/libraries). \n\n\n // searchForAlerts searches for jobs with email alert set which could receive\n // updates later if search result updates.\n func searchForAlerts(w io.Writer, projectID, companyName string) (*talent.SearchJobsResponse, error) {\n \tctx := context.Background()\n\n \tclient, err := google.DefaultClient(ctx, talent.CloudPlatformScope)\n \tif err != nil {\n \t\treturn nil, fmt.Errorf(\"google.DefaultClient: %w\", err)\n \t}\n \t// Create the jobs service client.\n \tservice, err := talent.New(client)\n \tif err != nil {\n \t\treturn nil, fmt.Errorf(\"talent.New: %w\", err)\n \t}\n\n \tparent := \"projects/\" + projectID\n \treq := &talent.SearchJobsRequest{\n \t\t// Make sure to set the RequestMetadata the same as the associated\n \t\t// search request.\n \t\tRequestMetadata: &talent.RequestMetadata{\n \t\t\t// Make sure to hash your userID.\n \t\t\tUserId: \"HashedUsrId\",\n \t\t\t// Make sure to hash the sessionID.\n \t\t\tSessionId: \"HashedSessionId\",\n \t\t\t// Domain of the website where the search is conducted.\n \t\t\tDomain: \"www.googlesample.com\",\n \t\t},\n \t\t// Set the search mode to a regular search.\n \t\tSearchMode: \"JOB_SEARCH\",\n \t}\n \tif companyName != \"\" {\n \t\treq.JobQuery = &talent.JobQuery{\n \t\t\tCompanyNames: []string{companyName},\n \t\t}\n \t}\n\n \tresp, err := service.Projects.Jobs.SearchForAlert(parent, req).Do()\n \tif err != nil {\n \t\treturn nil, fmt.Errorf(\"failed to search for jobs with alerts: %w\", err)\n \t}\n\n \tfmt.Fprintln(w, \"Jobs:\")\n \tfor _, j := range resp.MatchingJobs {\n \t\tfmt.Fprintf(w, \"\\t%q\\n\", j.Job.Name)\n \t}\n\n \treturn resp, nil\n }\n\n\u003cbr /\u003e\n\nFor information about searching, see\n[Search Basics](/talent-solution/job-search/v3/docs/search)."]]