DEV Community

Cover image for Build a Job Market Intelligence Tool with SERP API
LEO o
LEO o

Posted on

Build a Job Market Intelligence Tool with SERP API

Looking to switch jobs or start recruiting in a specific field? Understanding the job market — what skills are in demand, what companies are hiring, and what salary ranges you can expect — gives you a huge advantage. But manually checking job boards and aggregating this information takes forever.
In this tutorial, we're going to build an automated job market intelligence tool that scrapes Google search results for job listings using a SERP API, extracts key information, and gives you a structured report on what's out there. It takes about 10 minutes to build, and costs pennies to run.

Why Use a SERP API for This?
You might be wondering: "Why not just use the major job boards' APIs?"
Good question. Here's the thing:
Each job board has its own API, different rate limits, different authentication, and different data formats
You need to integrate with multiple APIs to get comprehensive coverage
APIs often require approval, have quota limits, and can change their pricing or terms unexpectedly
With a SERP API, you can search Google for "your role + location + hiring" and get results from all job boards in one go. It's a single API integration that gives you coverage across the entire market.

Let's Code It
We'll keep this simple — just Python and requests. Here's the complete working code:

import requests
import csv
from typing import List, Dict
from datetime import datetime

class JobMarketIntelligence:
    def __init__(self, api_token: str):
        self.api_token = api_token
        self.endpoint = "https://serpapi.talordata.net/serp/v1/request"

    def search_jobs(self, role: str, location: str) -> List[Dict]:
        """Search Google for current job openings matching your criteria"""
        headers = {
            "Authorization": f"Bearer {self.api_token}",
            "Content-Type": "application/x-www-form-urlencoded"
        }

        query = f"{role} jobs in {location} hiring now"

        data = {
            "engine": "google",
            "q": query,
            "json": "2"
        }

        response = requests.post(self.endpoint, headers=headers, data=data)
        response.raise_for_status()
        results = response.json()

        jobs = []
        for result in results.get("organic_results", []):
            title = result.get("title", "")
            url = result.get("link", "")
            snippet = result.get("snippet", "")
            company = self._extract_company(title, snippet)

            jobs.append({
                "role": role,
                "location": location,
                "title": title,
                "company": company,
                "url": url,
                "snippet": snippet,
                "found_at": datetime.now().isoformat()
            })

        return jobs

    def _extract_company(self, title: str, snippet: str) -> str:
        """Simple company extraction heuristic"""
        words = title.split(" - ")[0].split(" | ")[0]
        if "hiring" in words.lower():
            words = words.lower().split("hiring")[0].strip()
        return words.title()

    def bulk_search(self, roles: List[str], location: str, output_csv: str = "job_market.csv"):
        """Search multiple roles and export to CSV"""
        all_jobs = []

        for role in roles:
            print(f"Searching for {role}...")
            jobs = self.search_jobs(role, location)
            all_jobs.extend(jobs)

        with open(output_csv, 'w', newline='', encoding='utf-8') as f:
            writer = csv.DictWriter(f, fieldnames=[
                "role", "location", "title", "company", "url", "snippet", "found_at"
            ])
            writer.writeheader()
            writer.writerows(all_jobs)

        print(f"\nDone! Found {len(all_jobs)} job listings. Saved to {output_csv}")
        return all_jobs


if __name__ == "__main__":
    API_TOKEN = "YOUR_API_TOKEN_HERE"
    tracker = JobMarketIntelligence(API_TOKEN)

    TARGET_ROLES = [
        "Senior Python Developer",
        "DevOps Engineer",
        "Product Manager"
    ]
    LOCATION = "San Francisco, CA"

    tracker.bulk_search(TARGET_ROLES, LOCATION, "sf_tech_jobs.csv")

Enter fullscreen mode Exit fullscreen mode

How It Works
When you run this script:

  1. It takes your list of roles and location
  2. It searches Google for each role with "jobs in [location] hiring now"
  3. The SERP API handles all the proxy stuff, anti-bot detection, and parsing
  4. You get back clean structured results with titles, links, and snippets
  5. We do some simple extraction to guess the company name
  6. Everything gets exported to a CSV that you can open in Excel or Google Sheets From there, you can analyze:
  • Which companies are hiring for your target roles right now
  • What skills are commonly mentioned in the job descriptions
  • How many openings each company has
  • What the general job market looks like in your location and field

Example Analysis You Can Do
For job seekers:

  • "Which companies are currently hiring for my role?" → Complete list in minutes
  • "What skills are most in demand right now?" → Word frequency analysis on snippets
  • "What's the competition like in my area?" → Count openings vs. known candidates
    For recruiters/companies:

  • "Who else is hiring for this role?" → See competitor recruiting efforts

  • "What roles are getting more openings month over month?" → Weekly tracking reveals trends

  • "What salary ranges are being advertised?" → Extract from snippets

Improving This Project

  1. Better company extraction: Use NER models like spaCy
  2. Track over time: Run weekly, store in database, see changes
  3. Add salary extraction: Regex or LLM to pull salary info
  4. Multiple locations: Search across cities and compare
  5. Interactive dashboard: Add Streamlit for sharing
  6. Alerts: Email when new matching roles appear

Cost Considerations
Usage Requests Cost
10 roles once 10 $0.01
10 roles weekly/month 40 $0.04
20 roles daily 600 $0.60

Incredibly affordable compared to multiple job board APIs or maintaining your own scraper infrastructure.

Wrapping Up
Building a job market intelligence tool with a SERP API is surprisingly simple. Instead of integrating with 5 different job board APIs, you just need one API call per search, and you get results from across the entire web.
The same pattern works for:

  • Real estate listing aggregation
  • Restaurant review aggregation
  • Product price monitoring across retailers
  • App store ranking tracking Google already indexes all this information — you just need to get it out in a structured format. Have you built any interesting aggregation tools with SERP API? Drop a comment below!

Top comments (0)