---
title: "Job Search Agent: Match Postings to a CV with Live Data"
description: "Build an AI job search agent in Python: Indeed postings, Glassdoor pay and ratings, ranked by CV skill match locally. About 12 credits a run."
url: https://perceptlayer.com/blog/job-search-agent-live-postings
---

[Blog](https://perceptlayer.com/blog) / [AI agents](https://perceptlayer.com/blog/category/ai-agents)

# Job Search Agent: Match Postings to a CV with Live Data

12 Jul 2026 Updated 12 Aug 2026 Perceptlayer 9 min read

An AI job search agent needs two things: live postings and a way to score them against your CV. Pull postings from the Indeed jobs endpoint, add Glassdoor pay and ratings for the top companies, and do the CV matching on your own machine so the CV never reaches an API. The script below does that in about 12 credits per run.

## Key takeaways

-   One `GET /v1/indeed/jobs` call returns postings with `title`, `company.name`, `description_html`, `date_published` and `apply_url`; it costs 1 credit.
-   The CV is read from a local file and matched against posting text in Python. Only a job title, a location and company names go to the API.
-   Glassdoor `companies-search` and `salaries` add a rating and, where a row is found, a total-pay median per shortlisted company, at 1 credit each.
-   A run with 5 shortlisted companies costs 1 + 1 + (5 × 2) = 12 credits, so a daily run for 30 days is 360 credits. The 100 free credits on signup cover the first 8 runs.

## How does the agent work?

The agent is a short pipeline, not a chat loop. It reads a local CV, searches Indeed for your target title, scores each posting by how many of the skills it mentions you already have, and then enriches only the best few with Glassdoor data. Ranking is plain Python, which keeps it cheap and repeatable.

An LLM is optional. You can add one at the end to write a summary of the shortlist, but the matching doesn't need it, and leaving it out is what keeps the CV local by construction. We'll come back to that trade-off below.

| Step | Where it runs | Calls | Credits |
| --- | --- | --- | --- |
| Read `cv.txt`, extract skills | Your machine | 0 | 0 |
| Search postings | `GET /v1/indeed/jobs` | 1 | 1 |
| Baseline pay for the title | `GET /v1/glassdoor/salaries` | 1 | 1 |
| Match and rank postings | Your machine | 0 | 0 |
| Company rating, per company | `GET /v1/glassdoor/companies-search` | up to 5 | up to 5 |
| Company pay, per company | `GET /v1/glassdoor/salaries` with `employer_id` | up to 5 | up to 5 |

## What do you need before you start?

You need Python 3, the `requests` library, and an API key. Keys start with `sk_live_` and go in the `X-API-Key` header; the [authentication docs](https://docs.perceptlayer.com/authentication) cover the details. A free account gets 100 credits after email verification, and [signing up](https://perceptlayer.com/signup) takes no credit card.

Create a working folder with three files: `cv.txt` (your CV as plain text), `profile.json` (what you're searching for) and `job_agent.py` (below). Export the key in your shell:

```bash
export API_KEY=sk_live_your_key_here
pip install requests
```

The profile holds only search parameters, nothing personal:

```json
{
  "title": "software engineer",
  "location": "Berlin",
  "country": "DE",
  "job_type": "full_time"
}
```

## Step 1: How do you extract skills from a CV locally?

Match the CV against a skills vocabulary you control. Open the file, lowercase it, and keep every vocabulary term that appears as a whole word. No network call is involved, and the result is a plain Python set you can print and check.

A vocabulary is less clever than a language model, but it's predictable. If a skill isn't found, you add it to the list and rerun. The same vocabulary is used on the posting side, so the two sets are comparable.

```python
import json
import os
import re
import time
from html.parser import HTMLParser

import requests

BASE = "https://api.perceptlayer.com"

SKILLS = [
    "python", "javascript", "typescript", "golang", "rust", "java", "sql",
    "postgresql", "mysql", "redis", "kafka", "docker", "kubernetes",
    "terraform", "aws", "gcp", "azure", "react", "node.js", "fastapi",
    "django", "graphql", "ci/cd", "machine learning", "pytorch",
]

def has_term(term, text):
    pattern = r"(?<![a-z0-9])" + re.escape(term) + r"(?![a-z0-9])"
    return re.search(pattern, text) is not None

def skills_in(text):
    text = text.lower()
    return {s for s in SKILLS if has_term(s, text)}

def load_cv_skills(path="cv.txt"):
    with open(path, encoding="utf-8") as f:
        return skills_in(f.read())
```

The lookaround in `has_term`, built with Python's [`re` module](https://docs.python.org/3/library/re.html), treats a term as a whole word only when no letter or digit sits directly beside it, so `java` doesn't match inside `javascript` and `node.js` and `ci/cd` are matched whole. A plain `\b` would also work for those two; the lookaround earns its place if you add a term that starts or ends in a symbol, such as `c++`. The vocabulary lists `golang` rather than `go` on purpose: `go` is also an ordinary English verb, and the recorded posting below carries a bare `Go` attribute on a product-manager role, which would count as a skill the role doesn't ask for.

## Step 2: How do you fetch live Indeed postings?

Call [`GET /v1/indeed/jobs`](https://perceptlayer.com/apis/indeed/jobs) with `query` (required) plus `location`, `country`, `job_type`, `sort` and `limit`. The code passes `sort="date"` (the allowed values are `relevance` and `date`), but it doesn't rely on the API's ordering, because the script ranks postings itself in Step 3. One call costs 1 credit, and the [Indeed API page](https://perceptlayer.com/apis/indeed) has a playground for trying parameters first.

The helper below uses a [`requests` session](https://requests.readthedocs.io/en/latest/user/advanced/) and also handles the two cases worth handling. On 429 and 503 it waits for the `Retry-After` seconds and tries again. On any other error it raises with the error `code` from the JSON body, and the failed call costs nothing.

```python
session = requests.Session()
session.headers["X-API-Key"] = os.environ["API_KEY"]
credits_spent = 0

def call(path, **params):
    global credits_spent
    for _ in range(3):
        r = session.get(f"{BASE}{path}", params=params, timeout=30)
        if r.status_code in (429, 503):
            time.sleep(int(r.headers.get("Retry-After", "5")))
            continue
        if not r.ok:
            err = r.json().get("error", {})
            raise RuntimeError(f"{r.status_code} {err.get('code')}: {err.get('message')}")
        credits_spent += int(r.headers.get("X-Credits-Used", 0))
        return r.json()["data"]
    raise RuntimeError(f"gave up on {path} after 3 attempts")

def fetch_postings(profile):
    data = call(
        "/v1/indeed/jobs",
        query=profile["title"],
        location=profile["location"],
        country=profile["country"],
        job_type=profile["job_type"],
        sort="date",
        limit=30,
    )
    return data["jobs"]
```

A recorded response from this endpoint (a Berlin search for software engineers) looks like this, trimmed:

```json
{
  "success": true,
  "data": {
    "jobs": [
      {
        "id": "805a70464f904dce",
        "title": "Senior Product Manager (Enterprise)",
        "company": { "name": "n8n", "profile_url": "/cmp/N8n" },
        "location": { "city": "Berlin", "country": "DE", "formatted": "Berlin", "is_remote": true },
        "description_html": "<div><p><b>The AI orchestration of your wildest imagination.</b></p>…",
        "attributes": ["Collaboration with Sales", "Go"],
        "date_published": "2026-08-12 05:00:00",
        "apply_url": "https://jobs.ashbyhq.com/n8n/…"
      }
    ],
    "pagination": { "next_cursor": "…", "has_more": true },
    "metadata": { "total_results": 20, "timestamp": "2026-10-21T13:25:37.233649Z" }
  }
}
```

Two details matter for the agent. The posting text is HTML in `description_html`, so it needs stripping before matching. And `pagination.has_more` with `next_cursor` tells you more postings exist; for the cursor loop pattern, see [paginating a web data API in Python](https://perceptlayer.com/blog/paginate-web-data-api-python). The [Indeed Jobs API article](https://perceptlayer.com/blog/indeed-jobs-api-json) covers the endpoint in more depth.

## Step 3: How do you score postings against the CV?

Score each posting by coverage: of the vocabulary skills a posting mentions, what fraction does your CV have? A posting that mentions five skills and matches four scores 0.8. Postings that mention no vocabulary skills are dropped, because there's nothing to compare. Missing skills are kept, so the output shows what to learn or leave out.

Coverage beats a raw count here. A long posting that lists twenty technologies would otherwise outrank a focused one you fit better.

```python
class TextExtractor(HTMLParser):
    def __init__(self):
        super().__init__()
        self.parts = []

    def handle_data(self, data):
        self.parts.append(data)

def html_to_text(html):
    parser = TextExtractor()
    parser.feed(html or "")
    return " ".join(parser.parts)

def score_postings(jobs, cv_skills):
    scored = []
    for job in jobs:
        text = f"{job['title']} {' '.join(job.get('attributes', []))} {html_to_text(job.get('description_html'))}"
        wanted = skills_in(text)
        if not wanted:
            continue
        matched = wanted & cv_skills
        scored.append({
            "id": job["id"],
            "title": job["title"],
            "company": job["company"]["name"],
            "remote": job["location"].get("is_remote", False),
            "published": job["date_published"],
            "apply_url": job["apply_url"],
            "score": round(len(matched) / len(wanted), 2),
            "matched": sorted(matched),
            "missing": sorted(wanted - cv_skills),
        })
    scored.sort(key=lambda j: (j["score"], j["published"]), reverse=True)
    return scored
```

Ties break on `date_published`, so between two equal fits the newer posting comes first. Everything in this step runs on your machine against text you already downloaded.

## Step 4: How do you add Glassdoor pay and ratings?

Use two Glassdoor endpoints. [`companies-search`](https://perceptlayer.com/apis/glassdoor/companies-search) takes a company name and returns candidates with an `id`, `rating`, `review_count` and `salary_count`. [`salaries`](https://perceptlayer.com/apis/glassdoor/salaries) takes a `job_title` and an optional `employer_id`, and returns pay percentiles. Each call costs 1 credit, so enrich only the shortlist.

A recorded `companies-search` response for the query `Stripe`, trimmed:

```json
{
  "success": true,
  "data": {
    "query": "Stripe",
    "companies": [
      { "id": 671932, "name": "Stripe", "rating": 3.8, "review_count": 1619, "salary_count": 4702, "job_count": 3 },
      { "id": 5554043, "name": "Stripe OLT", "rating": 4, "review_count": 24, "salary_count": 38, "job_count": 0 }
    ],
    "page": 1,
    "total_pages": 5,
    "has_more": true
  }
}
```

The search returns near-matches ("Stripe OLT" next to "Stripe"), so the code accepts only an exact, case-insensitive name match and otherwise skips the company. A wrong company is worse than a missing one.

The recorded `salaries` response, called with only `job_title=software engineer`, has a `salaries` list with one row per employer, each carrying `total_pay` percentiles ( `p10` to `p90`), `currency` and `pay_period`. It also has an `estimate` block with `total_pay` percentiles for the title across the whole country ( `location` was `United States` in our recording). We recorded the unfiltered call only. The call with `employer_id` isn't in a recording, so the code makes no assumption about what it returns: it reads every field defensively with `.get` and uses a row only if the row's `employer.id` equals the company id from the search. If no such row comes back, `company_pay` returns the rating and review count with `p50` set to `None`, and the output shows a dash for pay. The title-level `estimate` is a separate call, made once by `title_baseline`.

```python
def title_baseline(title):
    data = call("/v1/glassdoor/salaries", job_title=title)
    est = data.get("estimate") or {}
    return {
        "currency": est.get("currency"),
        "location": est.get("location"),
        "p50": (est.get("total_pay") or {}).get("p50"),
    }

def company_pay(name, title):
    found = call("/v1/glassdoor/companies-search", query=name)["companies"]
    match = next((c for c in found if c["name"].lower() == name.lower()), None)
    if match is None:
        return None
    data = call("/v1/glassdoor/salaries", job_title=title, employer_id=match["id"])
    rows = data.get("salaries") or []
    row = next(
        (s for s in rows if (s.get("employer") or {}).get("id") == match["id"]),
        None,
    )
    total = (row or {}).get("total_pay") or {}
    return {
        "rating": match.get("rating"),
        "reviews": match.get("review_count"),
        "currency": (row or {}).get("currency"),
        "p50": total.get("p50"),
    }
```

One caveat for non-US searches: the recorded baseline is in USD for the United States, while a Berlin posting is likely paid in euros. The agent keeps the `currency` next to every figure and never converts. Treat a USD median as context for a Berlin posting, not a salary offer.

## Step 5: How do you put it together and run it?

The `main` function loads the profile and the CV skills, fetches and ranks postings, then enriches the top five distinct companies. The company cache means a firm with three open roles is looked up once. The script prints a table and writes the full result to `results.json`, including `apply_url` for each posting.

```python
def main():
    with open("profile.json", encoding="utf-8") as f:
        profile = json.load(f)
    cv_skills = load_cv_skills()
    print("CV skills found:", ", ".join(sorted(cv_skills)))

    ranked = score_postings(fetch_postings(profile), cv_skills)
    baseline = title_baseline(profile["title"])

    pay_cache = {}
    for job in ranked[:5]:
        name = job["company"]
        if name not in pay_cache:
            pay_cache[name] = company_pay(name, profile["title"])
        job["glassdoor"] = pay_cache[name]

    with open("results.json", "w", encoding="utf-8") as f:
        json.dump({"baseline": baseline, "postings": ranked}, f, indent=2)

    for job in ranked[:10]:
        g = job.get("glassdoor") or {}
        pay = f"{g.get('p50'):,.0f} {g.get('currency')}" if g.get("p50") else "-"
        print(f"{job['score']:.2f}  {job['title'][:38]:38}  {job['company'][:18]:18}  {g.get('rating', '-')}  {pay}")
    print(f"credits spent: {credits_spent}")

if __name__ == "__main__":
    main()
```

Run `python job_agent.py`. The output is one line per posting: match score, title, company, Glassdoor rating and median total pay where found, then the credits spent. The `credits spent` figure comes from summing the `X-Credits-Used` header on each response, so it matches what the call actually cost.

The loop makes at most 12 calls, one after another. Free accounts get 1 request a second, so if you hit a rate-limit error, add a short `time.sleep` between calls; the [rate limits docs](https://docs.perceptlayer.com/rate-limits) explain how limits are counted. If you later parallelise the company lookups, see [concurrent API requests under rate limits](https://perceptlayer.com/blog/concurrent-api-requests-python-rate-limit).

## What does the agent cost to run?

A run costs 1 credit for the Indeed search, 1 for the title baseline, and 2 credits per shortlisted company, so five companies is 1 + 1 + (5 × 2) = 12 credits. Failed calls cost nothing. A daily run for a month is 30 × 12 = 360 credits. The 100 free credits cover the first 8 daily runs; after that, the Starter pack's 10,000 credits cover a year of them (12 × 360 = 4,320).

| Setup | Calls per run | Credits per run | Credits per 30 days |
| --- | --- | --- | --- |
| Search and baseline only | 2 | 2 | 60 |
| Shortlist of 5 companies | 12 | 12 | 360 |
| Shortlist of 10 companies | 22 | 22 | 660 |

Every response carries `X-Credits-Remaining`, so you can print the balance at the end of a run if you want a running total. The [credits docs](https://docs.perceptlayer.com/credits) describe how debits work, and [pricing](https://perceptlayer.com/pricing) lists what credits cost if you outgrow the free tier. One honest caveat: requests have no idempotency key, so a timeout can hide a call that succeeded and was billed. The script doesn't retry timeouts, which keeps a flaky network from doubling a debit.

## Does the CV really stay local?

Yes, as written. The CV is read with `open()`, matched in-process and never put in a request. The API sees four things: a job title, a location and country, a job type, and company names pulled from public postings. All four are search terms, not documents.

That boundary holds only while the matching stays in Python. Hand the CV to a hosted LLM to "improve the match" and the text leaves your machine, so decide that deliberately. If you want a model to write the shortlist summary, send it `results.json` (postings, scores, skill names), not `cv.txt`. A local model avoids the question entirely.

Your search terms also say something: a title plus a city reveals where you want to work. That's the whole disclosure, and it's the same one a job board search makes.

## When should you use an LLM or MCP instead?

Use a script when the steps are fixed, as they are here. Use an agent loop when the next call depends on what came back, for example "search again with a broader title if fewer than ten postings match". The same endpoints are available as tools over MCP at `https://perceptlayer.com/mcp`, with `search_endpoints`, `get_endpoint` and `call_endpoint`.

The [AI agents docs](https://docs.perceptlayer.com/ai-agents) show how to add the server, and [MCP vs function calling](https://perceptlayer.com/blog/mcp-vs-function-calling-web-data) compares the two ways to wire tools. The [Model Context Protocol site](https://modelcontextprotocol.io) has the protocol itself. For agent spend limits, see [capping web data spend](https://perceptlayer.com/blog/ai-agent-web-data-costs).

Whichever you choose, the same privacy rule applies: the model sees what you put in its context. Keep the CV out of that context and the agent stays as local as this script. The [LangChain custom tool tutorial](https://perceptlayer.com/blog/langchain-custom-tool-web-data) shows the tool-wrapping pattern if you go that way.

To try the first call before running anything, open the [Indeed API page](https://perceptlayer.com/apis/indeed), run `/v1/indeed/jobs` in the playground with your title and city, then [get a free API key](https://perceptlayer.com/signup) and run the script.

## APIs in this post

-   [Indeed **1 credit per call** · 9 endpoints](https://perceptlayer.com/apis/indeed)
-   [Glassdoor **1 credit per call** · 13 endpoints](https://perceptlayer.com/apis/glassdoor)

## Frequently asked questions

### Can I use Glassdoor's job listings instead of Indeed's?

Yes. The `GET /v1/glassdoor/jobs-search` endpoint takes a `keyword` and an optional `cursor`, and costs 1 credit. Indeed's endpoint adds `location`, `country`, `job_type` and `sort` filters, which is why this tutorial uses it for postings and keeps Glassdoor for pay and ratings. See the [Glassdoor API page](https://perceptlayer.com/apis/glassdoor).

### How many credits does one search cost?

One Indeed search is 1 credit, and each Glassdoor call is 1 credit. The tutorial's default run, with five shortlisted companies, is 12 credits. A free account gets 100 credits once, on signup, so that's 8 runs with 4 credits to spare. Failed calls return `X-Credits-Used: 0`.

### What happens when I run out of credits mid-run?

The next call returns `insufficient_credits` with HTTP 402 and nothing more is debited; the service is prepaid, with no automatic top-up. The `call` helper in this tutorial raises with that code. The [errors docs](https://docs.perceptlayer.com/errors) list every code and what to do about each.

### Is the salary data an offer estimate?

No. The `salaries` endpoint returns percentiles ( `p10` to `p90`) with a currency and pay period on each row, as found at the time of the call. A median for a title or company is context for a negotiation, not a prediction of what a specific employer will offer you.

### Can I run this on a schedule?

Yes. The script has no interactive steps, so cron or a CI scheduler can run it. Add a check that skips postings whose `id` appeared in the previous `results.json`, so a daily run only surfaces new matches. Mind the request rate: free accounts get 1 request a second.

ai agents job search indeed glassdoor python

## More from the blog

1.  [AI agents](https://perceptlayer.com/blog/category/ai-agents) 9 Oct 2026 Updated 10 Nov 2026 Perceptlayer 7 min read
    
    ## [CrewAI Tools: Build a Custom Tool for Live Web Data](https://perceptlayer.com/blog/crewai-custom-tool-web-data)
    
    Build a CrewAI custom tool (a BaseTool subclass) that searches Google for live results, cap it at 5 calls a run, or load MCP tools instead. Tested code.
    
2.  [AI agents](https://perceptlayer.com/blog/category/ai-agents) 5 Oct 2026 Perceptlayer 8 min read
    
    ## [Build a Market Research Agent with Search and Trends Data](https://perceptlayer.com/blog/market-research-agent-search-trends)
    
    Wire Google Search, Trends and News into one Python agent, cap it at 8 credits per question, and see a recorded Trends response.
    
3.  [AI agents](https://perceptlayer.com/blog/category/ai-agents) 11 Sept 2026 Perceptlayer 8 min read
    
    ## [Build a Price Tracking Agent in Python with Live Data](https://perceptlayer.com/blog/price-tracking-agent-python)
    
    A Python price tracker that checks Google Shopping and eBay once per product per run, stores history in SQLite, flags drops and costs 2 credits a product.
