# HigherGov Federal Contracts Scraper (`parselab/highergov-contracts-scraper`) Actor

Search live US federal contract opportunities by keyword, NAICS code, set-aside type and agency. No login required.

- **URL**: https://apify.com/parselab/highergov-contracts-scraper.md
- **Developed by:** [Alonso Garcia](https://apify.com/parselab) (community)
- **Categories:** Business, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $18.75 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 🏛️ HigherGov Federal Contract Opportunities Scraper

> Search live US federal contract opportunities by keyword, NAICS code, agency and set-aside — no login required.

### What it does

Queries HigherGov's public contract opportunity search (the same data behind `highergov.com/contract-opportunity/`)
and returns structured records: title, agency, solicitation number, set-aside type, NAICS/PSC codes, posted date,
response deadline, place of performance and description.

- **Server-side search**: `keywords` (full-text, optionally title-only) is sent directly to HigherGov's search.
- **Client-side filters**: `naicsCode`, `setAsideCode`, `agencyKeyword`, `postedAfter`/`postedBefore` and
  `activeOnly` are applied on top of the fetched results (HigherGov's other server-side filter parameters
  either error out or are silently ignored for anonymous requests — see `SCRAPER.md` for what was tested).
  For best coverage, pair them with `keywords` so the underlying search is already narrow.
- No login, no proxy, no browser — plain HTTP requests to the public search endpoint.

### Limits

HigherGov caps anonymous (non-logged-in) search results at roughly **1000 rows per keyword search**. Very broad
searches (no keywords) will only ever surface the same ~1000 most recent opportunities regardless of `maxItems`.

### Input

| Field | Description |
|---|---|
| `maxItems` | Max results to return. Free users limited to 10. |
| `keywords` | Full-text search (server-side). |
| `searchTitleOnly` | Restrict `keywords` matching to the title only. |
| `naicsCode` | Exact 6-digit NAICS code (client-side filter). |
| `setAsideCode` | Small-business set-aside type (client-side filter). |
| `agencyKeyword` | Substring match on awarding agency name (client-side filter). |
| `postedAfter` / `postedBefore` | Date range on posted date (client-side filter). |
| `activeOnly` | Only opportunities with an open response deadline. |
| `sortBy` / `sortDirection` | Order results by posted date, deadline or relevance. |

### Output fields

`title`, `opportunityType`, `agency`, `solicitationNumber`, `setAside`, `isActive`, `postedDate`,
`responseDeadline`, `naicsCode`, `pscCode`, `placeOfPerformanceCountry`, `description`, `opportunityUrl`,
`scrapedAt`, `error`.

### Disclaimer

This actor collects publicly available data from HigherGov.com. It is not affiliated with, endorsed by, or
sponsored by HigherGov. Use of the collected data must comply with HigherGov's Terms of Service and applicable
law.

# Actor input Schema

## `maxItems` (type: `integer`):

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000. Note: HigherGov caps anonymous search results at ~1000 per filter combination.

## `keywords` (type: `string`):

Free-text search across opportunity titles and descriptions (e.g. 'drone', 'IT support services').

## `searchTitleOnly` (type: `boolean`):

If enabled, only matches keywords in the opportunity title (not the full description).

## `naicsCode` (type: `string`):

Filter by an exact 6-digit NAICS industry code (e.g. 541511). Applied after fetching results, so pair it with Keywords for best coverage within maxItems.

## `setAsideCode` (type: `string`):

Restrict to opportunities with a specific small-business set-aside. Applied after fetching results.

## `agencyKeyword` (type: `string`):

Filter by (part of) the awarding agency's name, e.g. 'Army' or 'Veterans Affairs'. Applied after fetching results.

## `postedAfter` (type: `string`):

Only opportunities posted on or after this date (YYYY-MM-DD). Applied after fetching results.

## `postedBefore` (type: `string`):

Only opportunities posted on or before this date (YYYY-MM-DD). Applied after fetching results.

## `activeOnly` (type: `boolean`):

Only include opportunities whose response deadline has not passed. Applied after fetching results.

## `sortBy` (type: `string`):

How to order results.

## `sortDirection` (type: `string`):

Ascending or descending order for the chosen Sort By field.

## `fetchDetails` (type: `boolean`):

Visit each opportunity's detail page for the AI-generated summary, estimated pricing type, est. level of competition, signs of shaping, SBA size standard, primary contact and the direct SAM.gov link. Off by default for speed; turn on for the full picture at the cost of one extra page load per opportunity.

## Actor input object example

```json
{
  "maxItems": 10,
  "searchTitleOnly": false,
  "activeOnly": true,
  "sortBy": "posted_date",
  "sortDirection": "desc",
  "fetchDetails": 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 = {
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parselab/highergov-contracts-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 = { "maxItems": 10 }

# Run the Actor and wait for it to finish
run = client.actor("parselab/highergov-contracts-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 '{
  "maxItems": 10
}' |
apify call parselab/highergov-contracts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parselab/highergov-contracts-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/g2GaQ90fgh9Vuz8yf/builds/IEYGRfJkJyJKbv5xS/openapi.json
