Architectural Overview: End-to-End Job Scraping Pipeline with Python & PostgreSQL
Data engineering teams building labor market intelligence platforms, job aggregators, or enterprise HR analytics systems require persistent, structured storage. While ad-hoc CSV downloads are sufficient for one-off analyses, production data products demand an automated, repeatable pipeline that extracts job listings from ZipRecruiter, validates the schema, and streams records into a relational database like PostgreSQL.
By coupling the serverless ZipRecruiter Scraper with Python’s official apify-client and psycopg2, you can decouple scraping infrastructure from data storage. Apify manages anti-bot bypasses, IP rotation, and headless browser sessions in the cloud, while your local or cloud Python worker handles data cleaning, relational mapping, and idempotent database upserts.
Setting Up ApifyClient & Initializing the Cloud Scraper
To begin, install the required Python libraries:
pip install apify-client psycopg2-binary
Authentication is managed via your Apify API token, which can be retrieved from the Apify Console settings. Pass your token through an environment variable (APIFY_TOKEN) to avoid hardcoding secrets.
When launching a scrape run, configure the input dictionary with target role keywords, item limits, and residential proxy options:
run_input = {
"searchKeyword": "Cloud Architect remote",
"maxItems": 100,
"proxyConfiguration": {
"useApifyProxy": True,
"apifyProxyGroups": ["RESIDENTIAL"]
}
}
Designing the PostgreSQL Relational Schema for Job Market Data
A well-structured relational schema must enforce uniqueness on job postings while optimizing indexing for high-frequency queries across companies, locations, and salaries. Execute the following DDL statements in your PostgreSQL instance:
CREATE TABLE IF NOT EXISTS ziprecruiter_jobs (
record_id VARCHAR(64) PRIMARY KEY,
title VARCHAR(255) NOT NULL,
company VARCHAR(255),
location VARCHAR(255),
job_type VARCHAR(64),
salary_min NUMERIC(12, 2),
salary_max NUMERIC(12, 2),
salary_currency VARCHAR(3) DEFAULT 'USD',
url TEXT,
description TEXT,
published_date TIMESTAMPTZ,
scraped_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- Query performance indexes
CREATE INDEX IF NOT EXISTS idx_jobs_company ON ziprecruiter_jobs(company);
CREATE INDEX IF NOT EXISTS idx_jobs_location ON ziprecruiter_jobs(location);
CREATE INDEX IF NOT EXISTS idx_jobs_salary_min ON ziprecruiter_jobs(salary_min);
CREATE INDEX IF NOT EXISTS idx_jobs_published ON ziprecruiter_jobs(published_date);
The record_id column serves as the primary key, enabling idempotent upsert operations that update existing postings without creating duplicate rows.
Production Python Implementation: Streaming Extraction & Idempotent Upserts
The Python script below executes the cloud scrape, fetches the dataset items, and uses psycopg2.extras.execute_values to perform high-throughput bulk upserts into PostgreSQL:
import os
import psycopg2
from psycopg2.extras import execute_values
from apify_client import ApifyClient
# 1. Initialize Apify Client
client = ApifyClient(os.getenv("APIFY_TOKEN", "YOUR_APIFY_TOKEN"))
# 2. Database Connection Parameters
DB_CONFIG = {
"dbname": "job_market_db",
"user": "postgres",
"password": "your_secure_password",
"host": "localhost",
"port": 5432
}
def ingest_ziprecruiter_to_postgres():
print("Triggering ZipRecruiter Scraper run on Apify Cloud...")
run_input = {
"searchKeyword": "DevOps Engineer AWS",
"maxItems": 100,
"proxyConfiguration": {
"useApifyProxy": True,
"apifyProxyGroups": ["RESIDENTIAL"]
}
}
run = client.actor("madeingermany/ziprecruiter-scraper").call(run_input=run_input)
dataset_id = run["defaultDatasetId"]
print(f"Run completed successfully. Dataset ID: {dataset_id}")
# Fetch dataset items
items = client.dataset(dataset_id).list_items().items
print(f"Fetched {len(items)} records from Apify Dataset. Preparing SQL bulk upsert...")
# Prepare records tuple
rows_to_insert = []
for item in items:
rows_to_insert.append((
item.get("recordId"),
item.get("title") or "Untitled Position",
item.get("company"),
item.get("location"),
item.get("jobType"),
item.get("salaryMin"),
item.get("salaryMax"),
item.get("salaryCurrency") or "USD",
item.get("url"),
item.get("description"),
item.get("publishedDate")
))
upsert_query = """
INSERT INTO ziprecruiter_jobs (
record_id, title, company, location, job_type,
salary_min, salary_max, salary_currency, url, description, published_date
) VALUES %s
ON CONFLICT (record_id) DO UPDATE SET
title = EXCLUDED.title,
company = EXCLUDED.company,
location = EXCLUDED.location,
salary_min = EXCLUDED.salary_min,
salary_max = EXCLUDED.salary_max,
updated_at = NOW();
"""
conn = psycopg2.connect(**DB_CONFIG)
with conn.cursor() as cursor:
execute_values(cursor, upsert_query, rows_to_insert)
conn.commit()
conn.close()
print(f"Successfully upserted {len(rows_to_insert)} records into PostgreSQL table 'ziprecruiter_jobs'.")
if __name__ == "__main__":
ingest_ziprecruiter_to_postgres()
Enterprise Orchestration, Rate Limiting & $5 Monthly Starter Tier Economics
When deploying this pipeline to production environments, consider the following best practices:
- Scheduled Orchestration: Run the ingestion script via Apache Airflow, Prefect, or Apify’s built-in cron scheduler to ingest daily job differentials.
- Batch Chunking: For runs scraping 1,000+ items, fetch records in batches of 250 using
offsetandlimitto prevent memory bottlenecks. - Database Connection Pooling: In serverless environments (e.g., AWS Lambda), utilize a connection pooler like PgBouncer to manage database connections efficiently.
The ZipRecruiter Scraper operates on a transparent Pay-Per-Event billing model:
- Run Initiation:
$0.00005per execution. - Pay-Per-Result:
$0.002per extracted job record.
Apify includes a complimentary $5 free monthly credit on the $0 starter tier for every developer account. This allows you to execute recurring data pipelines and ingest up to 2,500 complete job postings into PostgreSQL every single month completely free. As your data needs grow, scaling to tens of thousands of postings remains cost-effective at just $2.00 per 1,000 records, providing an enterprise-grade data foundation with zero fixed subscription fees.
Expected Output Schema & Sample Records
Below is an authentic sample of data returned by the scraper. Records are formatted into clean JSON or exportable CSV spreadsheets.
Authentic Sample Output Data
ZipRecruiter| recordId | title | company | location | jobType | salaryMin | salaryMax | salaryCurrency | url | description | publishedDate | scrapedAt |
|---|---|---|---|---|---|---|---|---|---|---|---|
| rec_zip_918241 | Senior Cloud Infrastructure Engineer | Scale Dynamics | Austin, TX (Hybrid) | Full-Time | 145000 | 185000 | USD | https://www.ziprecruiter.com/jobs/senior-cloud-infrastructure-engineer-4819a | Lead multi-region Kubernetes deployments, Terraform infrastructure-as-code pipelines, and AWS cloud security architectures. | 2026-10-28T09:15:00Z | 2026-10-29T12:00:00Z |
| rec_zip_918242 | Data Analytics & ML Ops Lead | Vanguard AI Labs | Remote - US & Canada | Full-Time, Contract | 160000 | 210000 | USD | https://www.ziprecruiter.com/jobs/data-analytics-ml-ops-lead-5928b | Architect scalable data pipelines, feature stores, and automated model evaluation systems using Python, Snowflake, and PyTorch. | 2026-10-28T10:45:00Z | 2026-10-29T12:00:00Z |
[
{
"recordId": "rec_zip_918241",
"title": "Senior Cloud Infrastructure Engineer",
"company": "Scale Dynamics",
"location": "Austin, TX (Hybrid)",
"jobType": [
"Full-Time"
],
"salaryMin": 145000,
"salaryMax": 185000,
"salaryCurrency": "USD",
"url": "https://www.ziprecruiter.com/jobs/senior-cloud-infrastructure-engineer-4819a",
"description": "Lead multi-region Kubernetes deployments, Terraform infrastructure-as-code pipelines, and AWS cloud security architectures.",
"publishedDate": "2026-10-28T09:15:00Z",
"scrapedAt": "2026-10-29T12:00:00Z"
},
{
"recordId": "rec_zip_918242",
"title": "Data Analytics & ML Ops Lead",
"company": "Vanguard AI Labs",
"location": "Remote - US & Canada",
"jobType": [
"Full-Time",
"Contract"
],
"salaryMin": 160000,
"salaryMax": 210000,
"salaryCurrency": "USD",
"url": "https://www.ziprecruiter.com/jobs/data-analytics-ml-ops-lead-5928b",
"description": "Architect scalable data pipelines, feature stores, and automated model evaluation systems using Python, Snowflake, and PyTorch.",
"publishedDate": "2026-10-28T10:45:00Z",
"scrapedAt": "2026-10-29T12:00:00Z"
}
]Required Inputs & Configuration Parameters
Configure only the fields supported by the verified scraper. You can test extractions directly in your browser or run them programmatically via Python, Node.js, or REST API.
Supported Input Parameters
| Parameter | Type | Required | Default | Description & Example |
|---|---|---|---|---|
| searchKeyword | string | Optional | market intelligence | Job title, technical skill, role keyword, or target query on ZipRecruiter e.g. software engineer remote |
| startUrls | array | Optional | — | Direct ZipRecruiter search or category filter URLs e.g. ["https://www.ziprecruiter.com/jobs-search?search=software+engineer&location=remote"] |
| maxItems | number | Optional | 100 | Maximum number of job listings to extract |
Start Scraping for Free with $5 Monthly Cloud Credits
You don't need a credit card or a paid subscription to extract your data. Every user gets $5 in complimentary cloud credits every month—enough to scrape thousands of verified records without spending a penny.
How Far Your $5 Free Monthly Credits Go
Every user receives $5.00 in free cloud credits every month. Because this cloud scraper charges only fractions of a cent per result instead of an expensive monthly software subscription, your free $5 allowance lets you extract thousands of fresh job leads completely free.
$5.00
Renewed every month for free~2,499
Full job leads for $0.00$0.00
Cloud proxies & anti-bot includedReal Projects You Can Run Completely Free
| Project Goal | Target Volume | Traditional Scraper Cost | Your Cost with Free Credits |
|---|---|---|---|
| Initial Test & Column Verification | 50 job leads | $49/mo minimum | $0.00 (100% Covered) |
| Targeted Local Market List | 500 job leads | $99/mo subscription | $0.00 (100% Covered) |
| Full Monthly Workflow Batch | 1,500+ job leads | $199/mo + proxy fees | $0.00 (100% Covered) |
Ready to collect your first dataset?
Launch the pre-built tool now with your $5 free monthly credits. No card required.
Prerequisites
- ✓Apify account with active balance ($5 free monthly credits included on $0 starter tier)
- ✓Python 3.10+ installed with apify-client and psycopg2 or asyncpg
- ✓Active PostgreSQL 14+ instance with write privileges
Observed Limitations
- •Network latency when streaming large dataset batches requires pagination or chunking
- •Database write throughput should use bulk insert/upsert operations (ON CONFLICT DO UPDATE)
Frequently Asked Questions
How do I authenticate with the Apify Python SDK?
Does the scraper support automated database upserts?
How many records can I ingest into PostgreSQL for free each month?
Extract Live Data with ZipRecruiter Scraper - Jobs by Keyword or URL + Employer Leads
Extract structured data from ZipRecruiter directly into Excel, CSV, or JSON in minutes. Runs automatically in the cloud with built-in anti-bot bypass and residential proxy rotation. No coding or browser setup required.
100% free to test • $5 free monthly credits included • No credit card required to start
Related Scraping Playbooks
View all guides →Extracting Direct Employer ATS Application Links (Workday, Greenhouse, Lever) via ZipRecruiter
Learn how to scrape ZipRecruiter job links and resolve redirect chains to extract canonical corporate ATS URLs across Workday, Greenhouse, Lever, and Taleo.
Scraping Remote Tech Jobs on ZipRecruiter: Filtering by Salary, Tech Stack & Benefits
Build an automated scraper to extract remote software engineering and tech jobs on ZipRecruiter, filter by programming languages, and isolate high-paying roles.
Building an Algorithmic Sports Analytics Pipeline with Python & REST APIs
Architect an end-to-end sports analytics pipeline. Automate data extraction with Apify, transform metrics with pandas, and persist models in SQLite.