DEV Community

Kashif Aziz
Kashif Aziz

Posted on

Python Wrapper For Indeed Job Search API

Python Wrapper For Indeed Job Search API

Python Wrapper For Indeed Job Search API

Recently, I was looking for a Python wrapper to work with Indeed API. Unable to find one that fulfills my requirements, I wrote a quick and simple Python script that consumes Indeed job search API and stores the search results in a CSV.

In order to run the script and fetch jobs from Indeed job search API, you must have:

  • Indeed Publisher API ID, available for free from here
  • Python 3.x
  • BeautifulSoup and Requests libraries

Usage:

The code for Python wrapper for Indeed Job Search API is available at GitHub. Download it from here.

Open indeedapiwrapper.py, add following parameters to fetch job listings through Indeed Job Search API:

params = {
    'publisher': "",    # publisher ID (Required)
    'q': "",            # Job search query
    'l': "",            # location (city / state)
    'co': "",           # Two letter Country Code
    'sort': "",         # Sort order, date or relevance
    'days': ""          # number of days to fetch jobs, maximum is 7 days
    }   

Note:

  • Publisher Id is required.
  • To search jobs, either provide query string or combination of location and country code.
  • To return relevant jobs, the script requires the presence of either query string or the combination of location and country code. In case query sting is not present and either one of location or country code is missing, the script will use “Karachi” and “pk” as default location and country code.

For example, following search parameters will search for all Python jobs in Karachi, Pakistan.

params = {
    'publisher': "0000000000000000",    # Use valid Id to get results 
    'q': "python",  
    'l': "karachi",  
    'co': "pk",  
    'sort': "date",                # Sort by date
    'days': "3"                    # get jobs for 3 days, including today
    }   

Output:

The list of jobs will be saved in a CSV file “indeedjobs.csv” in the same directory where the script resides.

Resources:

Indeed job search API documentation is available here.

Code for Python wrapper for Indeed Job Search API Download it from here.

Top comments (0)