# USA Jobs Scraper (`shahidirfan/usa-jobs-scraper`) Actor

Efficiently extract job opportunities from leading USA job boards. This actor is designed for fast and reliable data collection across the American employment market. For the best success rates and to prevent blocking, the use of residential proxies is strongly advised.

- **URL**: https://apify.com/shahidirfan/usa-jobs-scraper.md
- **Developed by:** [Shahid Irfan](https://apify.com/shahidirfan) (community)
- **Categories:** Jobs, Automation, Developer tools
- **Stats:** 63 total users, 6 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## USA Jobs Scraper

Collect federal job listings from USAJobs.gov quickly and reliably. Extract comprehensive records including titles, agencies, salary ranges, application windows, and full job descriptions in one run. Perfect for workforce monitoring, hiring intelligence, and research workflows.

---

### Features

- **Comprehensive job records** - Collect position metadata, agency details, compensation, and application links.
- **Flexible search controls** - Filter by keyword, location, search URL, and recency window.
- **Pagination at scale** - Gather large result sets efficiently with adjustable collection limits.
- **Structured descriptions** - Receive both rich description content and plain-text versions for analysis.
- **Production-ready outputs** - Export clean datasets for analytics, automation, and reporting.

---

### Use Cases

#### Labor Market Intelligence
Track hiring activity across federal agencies and departments to identify growth patterns, role demand, and regional opportunities.

#### Job Board Aggregation
Enrich job platforms with federal opportunities and keep listings updated with structured, machine-readable data.

#### Salary Benchmarking
Analyze compensation ranges by role, agency, and location to build benchmarking dashboards and market reports.

#### Public Sector Research
Build datasets for policy studies, workforce planning, and long-term hiring trend analysis.

#### Career Services
Help candidates discover relevant opportunities with detailed descriptions, open/close dates, and direct application links.

---

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `searchUrl` | String | No | - | USAJobs search URL. If provided, keyword and location can be parsed automatically. |
| `keyword` | String | No | - | Search keyword such as job title or skill. |
| `location` | String | No | - | Location filter such as city, state, or region. |
| `daysBack` | Integer | No | `30` | Recency filter for posted jobs (1-60 days). |
| `includeClosed` | Boolean | No | `false` | Include jobs that are no longer accepting applications. |
| `maxJobs` | Integer | No | `1000` | Maximum number of jobs to collect. |
| `proxyConfiguration` | Object | No | `{"useApifyProxy": false}` | Proxy settings for request routing and reliability. |

---

### Output Data

Each dataset item contains:

| Field | Type | Description |
|-------|------|-------------|
| `source` | String | Source identifier. |
| `controlNumber` | String | USAJobs control number for the listing. |
| `positionId` | String | Position ID from the listing metadata. |
| `positionTitle` | String | Official job title. |
| `organizationName` | String | Hiring organization. |
| `departmentName` | String | Parent department name. |
| `subAgencyName` | String | Sub-agency where available. |
| `locationDisplay` | String | Display-friendly location string. |
| `positionLocations` | Array | Raw location objects from listing metadata. |
| `positionOpenDate` | String | Posting start date. |
| `positionCloseDate` | String | Posting close date. |
| `open_close_dates` | String | Combined open/close date string. |
| `detailUrl` | String | URL of the detailed listing page. |
| `applyUrl` | String | Direct application URL when available. |
| `minimumSalary` | Number | Minimum salary value. |
| `maximumSalary` | Number | Maximum salary value. |
| `salary` | String | Human-readable salary range. |
| `payGrade` | String | Pay grade range. |
| `pay_scale_grade` | String | Alternate pay grade field for compatibility. |
| `workSchedule` | String | Work schedule label. |
| `work_schedule` | String | Alternate work schedule field for compatibility. |
| `appointmentType` | String | Appointment type label. |
| `appointment_type` | String | Alternate appointment field for compatibility. |
| `whoMayApply` | String | Candidate eligibility category. |
| `service` | String | Service type where provided. |
| `promotion_potential` | String | Promotion potential value. |
| `securityClearance` | String | Security clearance information. |
| `security_clearance` | String | Alternate security clearance field for compatibility. |
| `supervisory_status` | String | Supervisory status where available. |
| `telework_eligible` | String | Telework eligibility information. |
| `travel_required` | String | Travel requirement information. |
| `jobCategories` | Array | Job category codes and names. |
| `description_html` | String | Structured description content. |
| `description_text` | String | Plain-text description content. |

---

### Usage Examples

#### Basic Search

```json
{
  "keyword": "data analyst",
  "location": "Washington, DC",
  "maxJobs": 50
}
````

#### Search URL Driven Collection

```json
{
  "searchUrl": "https://www.usajobs.gov/Search/Results?k=cybersecurity&l=Texas",
  "daysBack": 14,
  "maxJobs": 100
}
```

#### Broad Monitoring Run

```json
{
  "keyword": "program manager",
  "daysBack": 30,
  "includeClosed": false,
  "maxJobs": 500
}
```

***

### Sample Output

```json
{
  "source": "usajobs",
  "controlNumber": "826008100",
  "positionId": "ABCD-1234",
  "positionTitle": "IT Specialist (Application Software)",
  "organizationName": "Department of Veterans Affairs",
  "departmentName": "Department of Veterans Affairs",
  "subAgencyName": "Office of Information and Technology",
  "locationDisplay": "Washington, District of Columbia",
  "positionOpenDate": "2026-03-01T00:00:00Z",
  "positionCloseDate": "2026-04-01T23:59:59Z",
  "open_close_dates": "2026-03-01T00:00:00Z - 2026-04-01T23:59:59Z",
  "detailUrl": "https://www.usajobs.gov/job/826008100",
  "applyUrl": "https://www.usajobs.gov/job/826008100/apply",
  "minimumSalary": 112015,
  "maximumSalary": 145617,
  "salary": "$112,015 - $145,617 Per Year",
  "payGrade": "13-13",
  "workSchedule": "Full-time",
  "appointmentType": "Permanent",
  "whoMayApply": "Public",
  "securityClearance": "Not Required",
  "telework_eligible": "Yes",
  "travel_required": "Occasional travel",
  "description_text": "Summary Duties Qualifications Education How To Apply ..."
}
```

***

### Tips for Best Results

#### Start Narrow, Then Expand

- Begin with targeted keywords and one location to validate output quality.
- Expand to broader terms and larger job limits after verification.

#### Tune Recency for Fresh Results

- Use lower `daysBack` values to focus on newly posted opportunities.
- Use higher values when building historical or comparative datasets.

#### Control Volume with `maxJobs`

- Use small limits for quick checks.
- Increase gradually for production collection runs.

#### Use Reliable Proxy Settings

- Enable proxy routing when running larger collections.
- Residential proxy pools typically improve consistency for repeated runs.

***

### Integrations

- **Google Sheets** - Share and analyze collected jobs collaboratively.
- **Airtable** - Build searchable databases for recruiting and research teams.
- **Slack** - Send notifications when new runs finish.
- **Webhooks** - Push results into custom systems automatically.
- **Make** - Build no-code workflows around collection and reporting.
- **Zapier** - Connect results to downstream apps and automations.

#### Export Formats

- **JSON** - Developer-friendly structured data.
- **CSV** - Spreadsheet and BI tool compatibility.
- **Excel** - Reporting and analyst workflows.
- **XML** - Legacy system integration support.

***

### Frequently Asked Questions

#### How many jobs can I collect in one run?

You can collect up to the value set in `maxJobs`, limited by available search results.

#### Can I collect jobs without a keyword?

Yes. You can run with location only, or use a search URL to define filters.

#### Why are some fields empty?

Some listings do not provide every field. Empty values reflect source availability.

#### Can I include closed listings?

Yes. Set `includeClosed` to `true` to include closed positions.

#### Can I automate recurring collection?

Yes. Schedule recurring runs from the Apify Console to track changes over time.

***

### Support

For issues or feature requests, contact support through the Apify Console.

#### Resources

- [Apify Documentation](https://docs.apify.com/)
- [API Reference](https://docs.apify.com/api/v2)
- [Scheduling Runs](https://docs.apify.com/platform/schedules)

***

### Legal Notice

This actor is intended for legitimate data collection. Users are responsible for compliance with applicable laws, platform rules, and usage policies.

# Actor input Schema

## `searchUrl` (type: `string`):

URL from USA Jobs search results (optional - will parse keyword and location)

## `keyword` (type: `string`):

Job title keyword to filter by

## `location` (type: `string`):

Location to filter jobs by (city, state, etc.)

## `daysBack` (type: `integer`):

How many days back to search from today (if no start date provided)

## `includeClosed` (type: `boolean`):

Whether to include closed job positions

## `maxJobs` (type: `integer`):

Maximum number of jobs to scrape

## `proxyConfiguration` (type: `object`):

Proxy configuration for requests

## Actor input object example

```json
{
  "searchUrl": "https://www.usajobs.gov/Search/Results?k=software%20engineer&l=Washington%2C%20DC",
  "keyword": "software engineer",
  "location": "Washington, DC",
  "daysBack": 30,
  "includeClosed": false,
  "maxJobs": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchUrl": "https://www.usajobs.gov/Search/Results?k=software%20engineer&l=Washington%2C%20DC",
    "keyword": "software engineer",
    "location": "Washington, DC",
    "daysBack": 30,
    "includeClosed": false,
    "maxJobs": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("shahidirfan/usa-jobs-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchUrl": "https://www.usajobs.gov/Search/Results?k=software%20engineer&l=Washington%2C%20DC",
    "keyword": "software engineer",
    "location": "Washington, DC",
    "daysBack": 30,
    "includeClosed": False,
    "maxJobs": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("shahidirfan/usa-jobs-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchUrl": "https://www.usajobs.gov/Search/Results?k=software%20engineer&l=Washington%2C%20DC",
  "keyword": "software engineer",
  "location": "Washington, DC",
  "daysBack": 30,
  "includeClosed": false,
  "maxJobs": 20
}' |
apify call shahidirfan/usa-jobs-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=shahidirfan/usa-jobs-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "USA Jobs Scraper",
        "description": "Efficiently extract job opportunities from leading USA job boards. This actor is designed for fast and reliable data collection across the American employment market. For the best success rates and to prevent blocking, the use of residential proxies is strongly advised.",
        "version": "0.0",
        "x-build-id": "f9zOSizAWbWwoqnR5"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/shahidirfan~usa-jobs-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-shahidirfan-usa-jobs-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/shahidirfan~usa-jobs-scraper/runs": {
            "post": {
                "operationId": "runs-sync-shahidirfan-usa-jobs-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/shahidirfan~usa-jobs-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-shahidirfan-usa-jobs-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "searchUrl": {
                        "title": "Search URL",
                        "type": "string",
                        "description": "URL from USA Jobs search results (optional - will parse keyword and location)"
                    },
                    "keyword": {
                        "title": "Keyword",
                        "type": "string",
                        "description": "Job title keyword to filter by"
                    },
                    "location": {
                        "title": "Location",
                        "type": "string",
                        "description": "Location to filter jobs by (city, state, etc.)"
                    },
                    "daysBack": {
                        "title": "Days Back",
                        "minimum": 1,
                        "type": "integer",
                        "description": "How many days back to search from today (if no start date provided)",
                        "default": 30
                    },
                    "includeClosed": {
                        "title": "Include Closed Positions",
                        "type": "boolean",
                        "description": "Whether to include closed job positions",
                        "default": false
                    },
                    "maxJobs": {
                        "title": "Maximum Jobs",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of jobs to scrape",
                        "default": 20
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Proxy configuration for requests",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
