# USAJOBS Government Jobs Scraper (`datapilot/usajobs-government-jobs-scraper`) Actor

filtering. Returns job ID, title, agency, deadline, job link, and scrape timestamp.Fetches recent USAJOBS job announcements by date range and agency, with optional keyword

- **URL**: https://apify.com/datapilot/usajobs-government-jobs-scraper.md
- **Developed by:** [Data Pilot](https://apify.com/datapilot) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 scraped results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

🏛️ **USAJOBS Government Jobs** Scraper is a powerful Apify Actor designed to discover, track, and collect public **USAJOBS Government Jobs** announcements directly from the official USAJOBS Historic Job Announcements API. This tool provides comprehensive **USAJOBS Government Jobs** intelligence including job title, hiring agency, application deadline, and direct listing link for any date range, agency, or keyword. Whether you're building a federal job board, tracking hiring trends, or conducting workforce research, the USAJOBS Government Jobs Scraper delivers actionable **USAJOBS Government Jobs** insights efficiently.

With direct USAJOBS API integration, continuation-token pagination, keyword and agency filtering, and reliable Apify Dataset delivery, the USAJOBS Government Jobs Scraper ensures comprehensive **USAJOBS Government Jobs** coverage across any federal hiring window. It focuses on key **USAJOBS Government Jobs** signals including title, agency, and deadline, making it an essential tool for federal employment research and workforce intelligence.

***

### 📋 Table of Contents

- [Features](#-features)
- [Data Source](#-data-source)
- [How It Works](#-how-it-works)
- [Input](#-input)
- [Output](#-output)
- [Technical Stack](#-technical-stack)
- [Data Fields](#-data-fields-explained)
- [Use Cases](#-use-cases)
- [Quick Start](#-quick-start)
- [Configuration](#-configuration)
- [Performance](#-performance)
- [Important Notes](#-important-notes)
- [License & Legal](#-license--legal)

***

### 🔥 Features

- **USAJOBS API Integration** – Direct integration with the official USAJOBS Historic Job Announcements API for accurate **USAJOBS Government Jobs** data.
- **Date Range Filtering** – Automatically scopes the search window using a configurable `daysBack` parameter.
- **Agency Filtering** – Narrow **USAJOBS Government Jobs** results to a specific hiring agency by code.
- **Keyword Title Filtering** – Filter announcements by matching keyword directly against the position title.
- **Continuation-Token Pagination** – Automatically pages through the full result set using the API's continuation token system.
- **Configurable Result Cap** – Control exactly how many **USAJOBS Government Jobs** records to collect via `maxResults`.
- **Incremental Dataset Push** – Pushes each page's matched **USAJOBS Government Jobs** records to Apify Dataset immediately.
- **Retry Logic with Backoff** – Automatically retries failed requests with increasing delay between attempts.
- **Residential Proxy Support** – Optional Apify residential proxy for reliable **USAJOBS Government Jobs** access.
- **Detailed Logging** – Comprehensive per-page progress and total-match logging for every **USAJOBS Government Jobs** run.
- **Graceful Error Handling** – Stops cleanly and logs the error if a request ultimately fails after retries.

***

### 📊 Data Source

#### **USAJOBS Historic Job Announcements API**

- **Authority**: Official U.S. Office of Personnel Management (OPM) USAJOBS platform
- **Endpoint**: `data.usajobs.gov/api/historicjoa`
- **Coverage**: All U.S. federal job announcements posted within the queried date range
- **Data**: Job title, hiring agency, position close date, and control number
- **Access**: Public JSON API
- **Update Frequency**: Reflects USAJOBS' current listings at time of run

***

### ⚙️ How It Works

The USAJOBS Government Jobs Scraper accepts an optional keyword, agency code, and lookback window, then queries the USAJOBS Historic Job Announcements API for all postings opened within that date range. Each returned announcement is normalized into a clean record with job ID, title, agency, deadline, and a direct link built from the position's control number. If a keyword is supplied, only announcements whose title contains that keyword are kept. The Actor pages through the full result set automatically using the API's continuation token, pushing each matched batch of **USAJOBS Government Jobs** records to the Apify Dataset as it goes.

**Key Processing Steps:**

1. **Input Parsing** – Accept keyword, agency code, days-back window, and result cap
2. **Proxy Setup** – Configure Apify residential proxy if enabled
3. **Date Range Calculation** – Compute the start and end dates for the **USAJOBS Government Jobs** search
4. **Session Init** – Create a Chrome-impersonated HTTP session for reliable API access
5. **Page Loop** – Request successive pages of announcements using the continuation token
6. **Keyword Filtering** – Skip any announcement whose title doesn't match the supplied keyword
7. **Record Normalization** – Build a clean record with job ID, title, agency, deadline, and link
8. **Incremental Push** – Push each page's matched **USAJOBS Government Jobs** records immediately
9. **Result Capping** – Stop once `maxResults` is reached
10. **Continuation Token Extraction** – Parse the next page token from the API's `next` link
11. **Rate Limiting** – Apply a short delay between page requests
12. **Summary Logging** – Report the total number of job announcements harvested

**Key Benefits:**

- Pull **USAJOBS Government Jobs** announcements for any date range without manual searching
- Filter federal job postings by agency or keyword to focus on relevant roles
- Track new federal hiring activity over time
- Feed job boards, workforce dashboards, or recruiting research pipelines
- Automate recurring **USAJOBS Government Jobs** checks as new announcements are posted

***

### 📥 Input

The Actor accepts the following input parameters:

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `keyword` | string | `""` | Filter **USAJOBS Government Jobs** results by matching this keyword against the position title. |
| `agency` | string | `""` | Filter results to a specific hiring agency code. |
| `daysBack` | integer | `30` | Number of days back from today to search for open positions. |
| `maxResults` | integer | `100` | Maximum number of **USAJOBS Government Jobs** records to collect. |
| `proxyConfiguration` | object | `{"useApifyProxy": true}` | Apify Proxy configuration. |

**Example Input:**

```json
{
  "keyword": "data scientist",
  "agency": "",
  "daysBack": 30,
  "maxResults": 150
}
```

**Search All Agencies for a Keyword:**

```json
{
  "keyword": "cybersecurity"
}
```

**Search a Specific Agency Without a Keyword:**

```json
{
  "agency": "TR00",
  "daysBack": 60
}
```

***

### 📤 Output

The Actor pushes **USAJOBS Government Jobs** records with the following structure:

| Field | Type | Description |
|-------|------|-------------|
| `job_id` | string | USAJOBS control number uniquely identifying the announcement |
| `title` | string | Position title as posted |
| `agency` | string | Name of the hiring federal agency |
| `deadline` | string | Position close date |
| `link` | string | Direct URL to the full **USAJOBS Government Jobs** listing page |
| `scraped_at` | string | ISO 8601 timestamp of when the record was scraped |

**Example USAJOBS Government Jobs Record:**

```json
{
  "job_id": "789456123",
  "title": "Data Scientist",
  "agency": "Department of the Treasury",
  "deadline": "2026-09-15",
  "link": "https://www.usajobs.gov/job/789456123",
  "scraped_at": "2026-08-17T09:00:00.000Z"
}
```

***

### 🧰 Technical Stack

- **API:** USAJOBS Historic Job Announcements API (JSON format)
- **HTTP Client:** `curl_cffi` with Chrome TLS fingerprint impersonation for reliable **USAJOBS Government Jobs** access
- **Pagination:** Continuation-token-based pagination parsed from the API's `next` link
- **Date Handling:** `datetime`/`date` with timezone-aware UTC timestamps
- **Async:** `asyncio` with executor-run blocking requests for non-blocking page fetching
- **Proxy:** Apify Proxy, optional via `useApifyProxy`
- **Logging:** Apify Actor logging system
- **Platform:** Apify Actor serverless environment

***

### 📊 Data Fields Explained

#### **Identification**

- **job\_id / link**: The unique USAJOBS control number and direct link to the full **USAJOBS Government Jobs** listing

#### **Position Details**

- **title**: The official position title as posted on USAJOBS
- **agency**: The federal agency hiring for this position

#### **Timing**

- **deadline**: The position's application close date
- **scraped\_at**: When this **USAJOBS Government Jobs** record was collected

***

### 🎯 Use Cases

- **Federal Job Boards** – Power a job board or newsletter with fresh **USAJOBS Government Jobs** listings
- **Workforce Research** – Study federal hiring trends by agency or role type over time
- **Career Coaching** – Help job seekers discover relevant federal opportunities matching their keywords
- **Recruiting Intelligence** – Track which agencies are actively hiring for specific skill sets
- **Academic Research** – Analyze public-sector employment patterns at scale
- **Policy Analysis** – Monitor federal hiring activity as an economic or staffing indicator
- **Alert Systems** – Build recurring keyword-based alerts for new federal job postings
- **Talent Sourcing** – Identify open roles at target agencies for outreach or partnerships

***

### 🚀 Quick Start

#### **1. Prepare Input**

Go to Apify Console and enter:

```json
{
  "keyword": "software engineer",
  "daysBack": 30,
  "maxResults": 100
}
```

#### **2. Run the Actor**

Click **Start**. The Actor will:

- Query USAJOBS for announcements opened within the date range
- Filter titles by keyword and agency, if provided
- Page through all matching results automatically
- Push each batch of **USAJOBS Government Jobs** records to the Dataset

#### **3. Monitor Progress**

Console shows:

```
🔍 Fetching USAJOBS from 2026-07-18 to 2026-08-17, filtering titles for 'software engineer'
📊 Matched 25/100 (scanned page of 500, 3200 total announcements in date range)
📊 Matched 61/100 (scanned page of 500, 3200 total announcements in date range)
🎉 Complete! Successfully harvested 100 job announcements.
```

#### **4. View & Download Results**

- **Results Tab**: All **USAJOBS Government Jobs** records
- **Export**: JSON, CSV, Excel, or HTML
- **Filter**: By agency, title, or deadline
- **API Access**: Available via the Apify API

***

### ⚙️ Configuration

Keyword search, default window:

```json
{
  "keyword": "nurse"
}
```

Agency-specific search with longer window:

```json
{
  "agency": "VA00",
  "daysBack": 90,
  "maxResults": 200
}
```

No filters, most recent postings:

```json
{
  "daysBack": 7,
  "maxResults": 50
}
```

***

### 📈 Performance

#### **Processing Speed**

- One request per page of results, with automatic retry on connection failures
- 0.3 second delay between page requests to reduce blocking
- Stops automatically once `maxResults` is reached or no further pages exist

#### **Resource Usage**

- Memory: Low, since no browser instance is launched
- Network: One request per result page within the requested date range
- Proxy: Optional residential proxy tunnel shared across the session for the run

***

### ⚠️ Important Notes

#### **Legal & Compliance**

- **Fair Use**: Respects the USAJOBS public API and applies pacing delays between requests
- **Public Data Only**: Retrieves only publicly posted **USAJOBS Government Jobs** announcements
- **Legal**: Not legal or employment advice — consult official USAJOBS listings before applying or making hiring decisions

#### **Data Quality**

- **Freshness**: Reflects USAJOBS' listings at time of run
- **Completeness**: Keyword filtering is title-only; some relevant postings with keywords only in the description may be excluded
- **Accuracy**: Sourced directly from the official USAJOBS API
- **Verification**: Always confirm deadlines and eligibility directly on the official USAJOBS listing before applying

#### **Best Practices**

- Use specific keywords to narrow large date ranges to relevant **USAJOBS Government Jobs** postings
- Combine `agency` and `keyword` filters together for the most targeted results
- Increase `daysBack` for broader historical coverage, or keep it short for the freshest postings
- Re-run periodically to catch newly posted announcements
- Always verify application deadlines directly on the official USAJOBS site before submitting

***

### 📄 License & Legal

**Terms of Use:**

- Use for legitimate job search, research, and workforce analysis purposes
- Respect the USAJOBS API's terms of use
- Attribute USAJOBS/OPM as the original data source where required
- Use data responsibly

**Disclaimer:**
USAJOBS Government Jobs Scraper is provided as-is for research and informational purposes. Users are responsible for compliance with USAJOBS' terms of use. This is not legal or employment advice — always verify listings directly on the official USAJOBS website.

***

### ⚖️ USAJOBS Government Jobs Excellence

This Actor is optimized for **USAJOBS Government Jobs** research with:

- ✅ Full date-range and agency-scoped search
- ✅ Keyword title filtering
- ✅ Continuation-token pagination for complete coverage
- ✅ Incremental, real-time Dataset push
- ✅ Retry logic with exponential backoff
- ✅ Production-ready code

# Actor input Schema

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

Keyword to filter position titles by (client-side, case-insensitive, e.g. 'data scientist', 'engineer'). Leave blank for all.

## `agency` (type: `string`):

Hiring agency code (e.g. 'VATA' for Veterans Health Administration). Leave empty to search across all agencies.

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

How many days back by position open date to search.

## `maxResults` (type: `integer`):

Maximum number of job announcements to collect.

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

Select Apify Proxy to bypass any network blocks or rate limits.

## Actor input object example

```json
{
  "keyword": "engineer",
  "agency": "",
  "daysBack": 30,
  "maxResults": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `crawlResults` (type: `string`):

No description

## `jobsOverview` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("datapilot/usajobs-government-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 = {}

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

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

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

```

## CLI example

```bash
echo '{}' |
apify call datapilot/usajobs-government-jobs-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datapilot/usajobs-government-jobs-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/uKCBXmwdQKVCjvGCl/builds/KfLmnoHIpD615VDB0/openapi.json
