# Government Contracts API - Federal, SLED Bids, Awards, Grants (`nabeelbaghoor/government-contracts-grants-api`) Actor

Government contracts and grants data from the HigherGov API: federal and state and local (SLED) bid opportunities updated every 30 minutes, SAM.gov, DIBBS, SBIR and grant solicitations, federal contract, IDV and grant awards, subcontracts and contractors by UEI, CAGE or NAICS. Bring your own key.

- **URL**: https://apify.com/nabeelbaghoor/government-contracts-grants-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** Business, Lead generation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 government record returneds

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/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

## Government Contracts API - Federal, SLED Bids, Awards, Grants

Pull federal and state and local government contract opportunities, contract and grant awards, IDVs, subcontracts, contractors and agencies from the HigherGov API with your own key, as clean dataset rows.

Works with the official HigherGov API (www.highergov.com/api-external, OpenAPI v1.2): the Opportunity endpoint (SAM.gov contract opportunities, DIBBS, SBIR and STTR, federal grant and state and local SLED bids, refreshed about every 30 minutes), Federal Contract, Federal IDV, Federal Grant, State and Local Contract, Federal Subcontract and Subgrant awards, SAM registered Awardees and Agencies. Each record becomes one row with the ID, title, agency, awardee and UEI, dollar value, posted, due, action and performance dates, NAICS, PSC, set aside and place of performance as flat columns, plus the full HigherGov record. Download as JSON, CSV or Excel, schedule it daily for new bids, or feed it into a CRM, capture pipeline, Google Sheets or an AI agent. Bring your own API key.

BYOK, not live-tested: every endpoint, parameter and ordering value comes from HigherGov's published OpenAPI document, and every route was confirmed to exist on www.highergov.com, but the actor has not been run against a live HigherGov subscription.

### What it does

- **Contract and grant opportunities**: federal contract solicitations from SAM.gov, DIBBS (DLA) bids, SBIR and STTR topics, federal grant opportunities and state and local (SLED) bids, with title, AI summary, agency, NAICS, PSC, set aside, estimated value range, posted and due dates, place of performance and the source link. Filter by source, captured or posted date, agency, solicitation ID or a saved HigherGov search.
- **Federal contract awards**: prime contracts with awardee, UEI, awarding and funding agency, obligated, current and potential value, performance period, NAICS, PSC, set aside, competition fields and contract vehicle. Filter by award ID, parent IDV, awardee or parent UEI, agency, NAICS, PSC, vehicle, captured or last modified date, or a saved search.
- **Federal IDV awards**: IDIQs, GWACs, BPAs and schedules, with ordering period end date and who can use them.
- **Federal grant awards**: prime grants by assistance listing (CFDA) number, recipient, agency or date.
- **State and local contract awards**: SLED awards with state, agency, awardee, amount, start and end dates and contract contact, searchable by keyword.
- **Subcontracts and subgrants**: first tier subawards linked to their prime award, by awardee, parent company or agency.
- **Awardees**: SAM and DSBS registered contractors by UEI, CAGE code, primary NAICS, parent company or registration update date.
- **Agencies**: look up the HigherGov agency key and hierarchy that the agency filters take.
- **Saved searches**: paste a HigherGov SearchID (or the whole search URL) to reuse keywords, set asides, NAICS, PSC, state and value range filters built in the HigherGov app.
- **Pay only for results**: a search that matches nothing returns one free row that says why.

### How to get an API key

API access is included in every HigherGov subscription (plans from about 500 to 2,500 USD a year, plus Enterprise). Sign in to HigherGov as an account admin, select the gear icon in the upper right, then API, and create a key. The full key is shown only once, so copy it then. Paste it into the API key field (or set the DATA_API_KEY secret). It is sent only to www.highergov.com as the api_key parameter and is never logged. Every subscription includes 10,000 API records a month; contact HigherGov for more.

### Input

| Field | Modes | Description |
| --- | --- | --- |
| `mode` | all | `opportunities`, `contracts`, `idvs`, `grants`, `slContracts`, `subcontracts`, `subgrants`, `awardees` or `agencies` |
| `searchId` | opportunities, contracts, grants, state and local | SearchID from a saved HigherGov search URL, or the whole URL |
| `keyword` | state and local | Free text search across state and local awards |
| `sourceType` | opportunities | sam, dibbs, sbir, grant or sled |
| `capturedDate` | opportunities, contracts, state and local | Date HigherGov added or last updated the record, YYYY-MM-DD |
| `postedDate` | opportunities | Agency posting date, YYYY-MM-DD |
| `lastModifiedDate` | federal awards, subawards | Award last modified date, YYYY-MM-DD |
| `startDate`, `endDate` | state and local | Earliest start and latest end date of the award |
| `registrationLastUpdateDate` | awardees | Date of the last SAM registration update |
| `agencyKey` | opportunities, agencies, award modes | HigherGov agency key (awarding agency on awards) |
| `fundingAgencyKey` | award modes | Funding agency key |
| `awardeeKey`, `awardeeKeyParent` | award modes (parent also awardees) | HigherGov awardee keys |
| `awardeeUei`, `awardeeUeiParent` | award modes (UEI also awardees) | 12 character SAM UEI |
| `cageCode` | awardees | 5 character CAGE code |
| `awardId`, `parentAwardId` | contracts, IDVs (award ID also grants) | Government award ID (PIID or FAIN) |
| `naicsCode` | contracts, IDVs, awardees | NAICS code (primary NAICS on awardees) |
| `pscCode` | contracts, IDVs | Product and service code |
| `vehicleKey` | contracts, IDVs | HigherGov contract vehicle key |
| `cfdaProgramNumber` | grants | Assistance listing number, such as 93.837 |
| `oppKey`, `sourceId` | opportunities | HigherGov opportunity key or source solicitation ID |
| `sortBy` | all but agencies | default, newest, oldest, latestAction, largest or dueSoonest |
| `maxResults` | all | Record ceiling for the run (default 100, read 100 per page) |
| `requestsPerMinute` | all | Pacing, default 30 |
| `apiKey` | all | Your HigherGov API key (or the DATA_API_KEY secret) |

An input set for a mode that does not document it is left off with a warning, never sent, because the API would ignore it or answer empty.

Example: the 50 largest federal IT services contracts (NAICS 541512) modified since October 1.

```json
{
    "mode": "contracts",
    "naicsCode": "541512",
    "lastModifiedDate": "2026-10-01",
    "sortBy": "largest",
    "maxResults": 50
}
```

### Example output

An illustrative opportunity row, shaped like HigherGov's documented Opportunity schema (values are an example, not real data). The full provider record is kept under `record`.

```json
{
    "mode": "opportunities",
    "recordType": "opportunity",
    "found": true,
    "id": "a1b2c3d4e5",
    "title": "Enterprise Cloud Migration Support Services",
    "description": "The agency seeks a contractor to migrate legacy applications to a FedRAMP authorized cloud.",
    "agencyName": "Department of Veterans Affairs",
    "agencyKey": 1234,
    "awardeeName": null,
    "awardeeUei": null,
    "awardeeKey": null,
    "amount": null,
    "amountLow": 1000000,
    "amountHigh": 5000000,
    "postedDate": "2026-10-15",
    "dueDate": "2026-11-14",
    "actionDate": null,
    "startDate": null,
    "endDate": null,
    "lastModifiedDate": null,
    "capturedDate": "2026-10-15",
    "naicsCode": "541512",
    "pscCode": "DA01",
    "setAside": "Service-Disabled Veteran-Owned Small Business",
    "placeState": "DC",
    "placeCity": "Washington",
    "sourceType": "sam",
    "highergovUrl": "https://www.highergov.com/contract-opportunity/example/",
    "sourceUrl": "https://sam.gov/opp/example/view",
    "note": null,
    "record": { "opp_key": "a1b2c3d4e5", "source_type": "sam", "document_path": "..." }
}
```

### FAQ

#### What is the HigherGov API?

HigherGov (GOV ALPHA INC, part of Procurement Sciences) is a government market intelligence platform that aggregates federal and state and local procurement data: SAM.gov, DIBBS, SBIR and grants.gov opportunities, FPDS and USAspending contract and grant awards, SAM entity registrations and thousands of state and local bid sites. Its REST API at www.highergov.com/api-external serves that data as paginated JSON, authenticated with an api_key parameter.

#### Do I need my own HigherGov API key?

Yes. This is a bring-your-own-key actor: it calls HigherGov with your key, under your HigherGov subscription and its terms. A missing or rejected key ends the run cleanly with a status message that explains what to change, and nothing is charged.

#### How do I get only new opportunities every day?

Schedule the actor in Opportunities mode with a captured date (and a source type, or a SearchID for your keywords, NAICS and set asides) and sort Newest first. HigherGov adds opportunities about every 30 minutes and recommends the captured date as the update check field; awards use the last modified date and update daily.

#### Can I search by keyword?

Keyword search is a direct filter only on state and local contract awards. For opportunities, federal contracts and grants, build the keyword search on highergov.com, save it and paste its SearchID; the API applies the saved keywords, agency, NAICS, PSC, set aside, state and value range fields it supports.

#### How do I find an agency key or awardee key?

Run the Agencies mode to list agencies with their keys, or read `agencyKey` and `awardeeKey` from any opportunity or award row. Awardees can also be looked up by UEI or CAGE code.

#### How many records can I pull?

HigherGov includes 10,000 API records a month in every subscription, counted per record returned. Keep `maxResults` modest and filter by date; ask HigherGov for a higher allowance if you need more.

#### What do I pay?

Pay per result: 0.01 USD per record returned (opportunity, award, subaward, awardee or agency). Searches that match nothing are never charged. Your HigherGov subscription is billed separately by HigherGov.

### Pricing

| Event | Price | Charged for |
| --- | --- | --- |
| `gov-record` | 0.01 USD | Each opportunity, award, subaward, awardee or agency record |

### Keyword map

government contracts API, federal contracts API, SAM.gov opportunities API, government bids API, RFP data, SLED bids, state and local contracts, DIBBS solicitations, SBIR opportunities, grants API, federal grant awards, FPDS contract awards, USAspending alternative, IDIQ and GWAC data, subcontract data, government contractor database, UEI lookup, CAGE code lookup, NAICS contract search, HigherGov API, GovCon data for AI agents.

### Terms and data use

HigherGov data is licensed under the HigherGov Terms of Service (highergov.com/tos, effective 2025-03-15). API access is a paid service for subscribers. Data obtained from HigherGov may be shared only with users under the same HigherGov account, must not be sold, and must not be used to provide competing services; HigherGov also prohibits the mass contacting of individuals or organizations from contact details in its data. The terms do not forbid storing the data you pull. Run this actor with your own key, keep the results for your own internal use within your subscription, and contact HigherGov before sharing them outside your account. This actor is not affiliated with or endorsed by HigherGov.

# Actor input Schema

## `mode` (type: `string`):

Opportunities reads open and past federal contract (SAM.gov), DIBBS, SBIR, grant and state and local (SLED) solicitations, updated about every 30 minutes. The award modes read federal prime contracts, IDVs (IDIQs, GWACs, BPAs, schedules), grants, subcontracts and subgrants, plus state and local contract awards. Awardees reads SAM registered contractors; Agencies looks up agency keys for the agency filters.

## `searchId` (type: `string`):

Opportunities, Federal contract awards, Federal grant awards and State and local contract awards. Build a search on highergov.com (keywords, agency, NAICS, PSC, set aside, state, value range and more), save it, and paste the searchID from its URL or the whole URL. HigherGov applies the saved search fields its API supports.

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

State and local contract awards only. Free text search across state and local contract awards, such as cybersecurity or road maintenance.

## `sourceType` (type: `string`):

Opportunities only. Limit to one source: SAM.gov federal contracts, DIBBS (DLA) solicitations, SBIR and STTR topics, federal grants, or state and local (SLED) bids. Leave empty for all.

## `capturedDate` (type: `string`):

Opportunities, Federal contract awards and State and local contract awards. The date HigherGov added the record (for awards, captured the last amendment), YYYY-MM-DD. HigherGov recommends it to pull only what is new since your last run.

## `postedDate` (type: `string`):

Opportunities only. The date the agency posted the opportunity, YYYY-MM-DD.

## `lastModifiedDate` (type: `string`):

Federal contract, IDV and grant awards, subcontracts and subgrants. The award's last modified date, YYYY-MM-DD; HigherGov's update check field for syncing awards.

## `startDate` (type: `string`):

State and local contract awards only. Earliest start date for the award, YYYY-MM-DD.

## `endDate` (type: `string`):

State and local contract awards only. Latest end date for the award, YYYY-MM-DD.

## `registrationLastUpdateDate` (type: `string`):

Awardees only. The date the awardee last updated its SAM registration, YYYY-MM-DD.

## `agencyKey` (type: `integer`):

Opportunities and Agencies: agency_key. Award modes: the awarding agency key. A whole number HigherGov shows on the agency page; run the Agencies mode to look keys up.

## `fundingAgencyKey` (type: `integer`):

Federal contract, IDV and grant awards, subcontracts and subgrants. The HigherGov key of the agency that funds the award.

## `awardeeKey` (type: `integer`):

Federal contract, IDV and grant awards, subcontracts and subgrants. The HigherGov awardee key of the recipient.

## `awardeeKeyParent` (type: `integer`):

Award modes and Awardees. The HigherGov awardee key at the parent company level, to get every subsidiary's awards or registrations.

## `vehicleKey` (type: `integer`):

Federal contract and IDV awards. The HigherGov key of a contract vehicle such as a GWAC or schedule.

## `awardeeUei` (type: `string`):

Award modes: the recipient's 12 character SAM Unique Entity ID. Awardees: look up one registration by UEI.

## `awardeeUeiParent` (type: `string`):

Federal contract, IDV and grant awards, subcontracts and subgrants. The parent company UEI.

## `cageCode` (type: `string`):

Awardees only. The 5 character CAGE code.

## `awardId` (type: `string`):

Federal contract, IDV and grant awards. The government award ID (PIID or FAIN).

## `parentAwardId` (type: `string`):

Federal contract and IDV awards. The award ID of the parent IDV, to list its task and delivery orders.

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

Federal contract and IDV awards: the award NAICS code. Awardees: the primary registered NAICS code. For example 541512.

## `pscCode` (type: `string`):

Federal contract and IDV awards. The product and service code, such as D302.

## `cfdaProgramNumber` (type: `string`):

Federal grant awards only. The grant program number, such as 93.837.

## `oppKey` (type: `string`):

Opportunities only. The HigherGov opportunity key, to read one opportunity.

## `sourceId` (type: `string`):

Opportunities only. The solicitation number at the source, such as a SAM.gov notice ID.

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

Newest and Oldest sort by captured date (opportunities, state and local awards), last modified date (federal awards) or SAM update (awardees). Latest action sorts by posted date, action date or start date. Largest sorts by award value. Due soonest is for opportunities. A choice the endpoint does not offer falls back to the default order.

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

The most records this run returns and charges for, read 100 per page. Every record also counts against your HigherGov API allowance (10,000 records a month on the base plan), so keep it modest.

## `requestsPerMinute` (type: `integer`):

Pacing. A rate limit answer is waited out and retried.

## `apiKey` (type: `string`):

Your own HigherGov API key (an account admin creates it under the gear icon, then API). Stored as a secret, sent only to www.highergov.com as the api_key parameter, and never logged. You can instead set the DATA_API_KEY environment secret.

## Actor input object example

```json
{
  "mode": "opportunities",
  "sourceType": "sam",
  "sortBy": "newest",
  "maxResults": 20,
  "requestsPerMinute": 30
}
```

# Actor output Schema

## `records` (type: `string`):

One row per HigherGov record returned for the chosen mode and filters.

# 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 = {
    "sourceType": "sam",
    "sortBy": "newest",
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/government-contracts-grants-api").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 = {
    "sourceType": "sam",
    "sortBy": "newest",
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/government-contracts-grants-api").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 '{
  "sourceType": "sam",
  "sortBy": "newest",
  "maxResults": 20
}' |
apify call nabeelbaghoor/government-contracts-grants-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nabeelbaghoor/government-contracts-grants-api"
        }
    }
}
```

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/spxlGiQ5brS7lwd7B/builds/qnGRTUk6zpXNTfdUr/openapi.json
