Unlock Job Search Potential with Indeed Cognitive Actions

In today's competitive job market, developers can enhance their applications by integrating real-time job search capabilities using the Indeed Cognitive Actions. The Indeed API provides a robust set of actions that enable you to retrieve job postings based on various criteria, including company identifiers and location-specific queries. These pre-built actions facilitate seamless access to job information, saving developers time while offering advanced features to end-users.
Prerequisites
To get started with Indeed Cognitive Actions, you'll need:
- An API key for the Cognitive Actions platform to authenticate your requests.
- Basic knowledge of JSON and RESTful APIs to understand the structure of requests and responses.
Authentication typically involves passing your API key as a bearer token in the request headers.
Cognitive Actions Overview
Search Jobs by Company
Description:
This action retrieves real-time job postings from Indeed for a specified company. It allows filtering by essential details such as job description, title, publication date, and region.
Category: Search Operations
Input:
- companyId (required): The unique identifier for the company (default: "Ubisoft").
- start (optional): The starting index for pagination (default: 1).
- region (optional): The region code to filter results (default: empty).
Example Input:
{
"start": 1,
"region": "us",
"companyId": "Ubisoft"
}
Output:
The action returns a payload containing the job postings, the total count of postings, and a final URL for more details.
Example Output:
{
"hits": [],
"count": 0,
"indeed_final_url": "https://www.indeed.com/cmp/Ubisoft/jobs?clearPrefilter=1&start=1"
}
Conceptual Usage Example (Python):
import requests
import json
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute"
action_id = "2a2c7a33-bb82-4dc3-a6e1-da818911570a"
payload = {
"start": 1,
"region": "us",
"companyId": "Ubisoft"
}
headers = {
"Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
"Content-Type": "application/json"
}
try:
response = requests.post(
COGNITIVE_ACTIONS_EXECUTE_URL,
headers=headers,
json={"action_id": action_id, "inputs": payload}
)
response.raise_for_status()
result = response.json()
print("Action executed successfully:")
print(json.dumps(result, indent=2))
except requests.exceptions.RequestException as e:
print(f"Error executing action {action_id}: {e}")
if e.response is not None:
print(f"Response status: {e.response.status_code}")
try:
print(f"Response body: {e.response.json()}")
except json.JSONDecodeError:
print(f"Response body: {e.response.text}")
Search Jobs by Query and Location
Description:
This action retrieves job postings based on specific search criteria, including query terms, location, job type, and additional filters like publication date and search radius.
Category: Search Operations
Input:
- query (required): The search term to find relevant job postings (default: "manager").
- location (optional): The location for the job search (default: "chicago").
- radius (optional): The search radius in kilometers (default: 50).
- sort (optional): Criteria for sorting results (default: empty).
- daysOld (optional): Maximum age of the records in days.
- jobType (optional): Type of job contract.
- pageNumber (optional): Page number for paginated results.
- countryCode (optional): Country code for filtering.
Example Input:
{
"sort": "date",
"query": "manager",
"radius": 50,
"daysOld": "1",
"jobType": "permanent",
"location": "chicago",
"pageNumber": 1,
"countryCode": "us"
}
Output:
The response includes job postings, the total count, and a URL for the Indeed job search results.
Example Output:
{
"hits": [],
"count": 0,
"next_page_id": null,
"indeed_final_url": "https://www.indeed.com/jobs?q=manager&l=chicago&fromage=1&radius=50&sort=date&sc=0kf%3Ajt%28permanent%29%3B"
}
Conceptual Usage Example (Python):
import requests
import json
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute"
action_id = "98690799-1b16-43d4-ae9d-0618f1c78e89"
payload = {
"sort": "date",
"query": "manager",
"radius": 50,
"daysOld": "1",
"jobType": "permanent",
"location": "chicago",
"pageNumber": 1,
"countryCode": "us"
}
headers = {
"Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
"Content-Type": "application/json"
}
try:
response = requests.post(
COGNITIVE_ACTIONS_EXECUTE_URL,
headers=headers,
json={"action_id": action_id, "inputs": payload}
)
response.raise_for_status()
result = response.json()
print("Action executed successfully:")
print(json.dumps(result, indent=2))
except requests.exceptions.RequestException as e:
print(f"Error executing action {action_id}: {e}")
if e.response is not None:
print(f"Response status: {e.response.status_code}")
try:
print(f"Response body: {e.response.json()}")
except json.JSONDecodeError:
print(f"Response body: {e.response.text}")
Search Companies By Name
Description:
This action facilitates searching for companies by name, providing quick access to job information from Indeed, including job titles, descriptions, and publication dates.
Category: Company Information
Input:
- companyName (required): The name of the company to search for (default: "Microsoft").
- locality (optional): The geographic region for filtering (default: empty).
Example Input:
{
"locality": "us",
"companyName": "Microsoft"
}
Output:
The response contains a list of companies matching the search criteria, including their details and Indeed URLs.
Example Output:
{
"hits": [
{
"id": "Microsoft",
"link": "/company/Microsoft?locality=us",
"name": "Microsoft",
"rank": 1,
"locality": "us",
"indeed_absolute_url": "https://www.indeed.com/cmp/Microsoft",
"indeed_relative_url": "/cmp/Microsoft"
}
],
"count": 1,
"indeed_final_url": "https://www.indeed.com/companies/search?from=discovery-cmp-search&q=Microsoft"
}
Conceptual Usage Example (Python):
import requests
import json
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute"
action_id = "d3f596ae-fa70-4486-a80b-0cf5f778bce4"
payload = {
"locality": "us",
"companyName": "Microsoft"
}
headers = {
"Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
"Content-Type": "application/json"
}
try:
response = requests.post(
COGNITIVE_ACTIONS_EXECUTE_URL,
headers=headers,
json={"action_id": action_id, "inputs": payload}
)
response.raise_for_status()
result = response.json()
print("Action executed successfully:")
print(json.dumps(result, indent=2))
except requests.exceptions.RequestException as e:
print(f"Error executing action {action_id}: {e}")
if e.response is not None:
print(f"Response status: {e.response.status_code}")
try:
print(f"Response body: {e.response.json()}")
except json.JSONDecodeError:
print(f"Response body: {e.response.text}")
Conclusion
Integrating Indeed Cognitive Actions into your applications can significantly enhance the job search experience for users. With capabilities to search for jobs by company, query and location, or even companies by name, these actions facilitate real-time access to valuable job market information. Start exploring these Cognitive Actions today and unlock the potential for your applications to deliver meaningful job opportunities to your users!