# US Federal Contracts Finder (SAM.gov + USAspending) (`unhampered_dolly/us-federal-contracts-finder`) Actor

Find open SAM.gov contract opportunities and past federal awards by keyword, NAICS, PSC, agency and set-aside. Daily only-new alerts. No API key needed.

- **URL**: https://apify.com/unhampered_dolly/us-federal-contracts-finder.md
- **Developed by:** [Stoian Catalin](https://apify.com/unhampered_dolly) (community)
- **Categories:** Lead generation, Business, Open source
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.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/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

## US Federal Contracts & Opportunities Finder (SAM.gov + USAspending)

Find **open federal contract opportunities** on SAM.gov and **past contract awards** on USAspending.gov. Filter by keyword, NAICS, PSC, agency, small-business set-aside, state and date. Turn on **Only new** and schedule a daily run to get a deduplicated feed of new bids, ready for Slack, email or a CRM through Apify integrations.

> **Main feature: awards mode (fully tested, no key needed).** Search past federal contract awards from the official USAspending.gov API.
>
> **Opportunities mode is in beta.** It needs **your own free SAM.gov API key**. SAM.gov allows **10 requests/day** for a key from an account with no SAM.gov role, and 1,000/day with a role. This mode follows the official API spec but **has not yet been verified with a live key**.

### Modes

- **awards** (default, fully tested): contract awards (types A–D) from the official USAspending.gov API v2. No key needed.
- **opportunities** (beta, not yet verified with a live key): active SAM.gov notices (solicitations, sources sought, presolicitations and so on) from the official **SAM.gov Get Opportunities API v2**. This mode **requires your own free SAM.gov API key** (sam.gov → Account Details → API key). SAM.gov's Terms of Use allow automated access only through its official APIs and extracts, so the Actor never scrapes the SAM.gov website. Your key is stored as a secret input and is never written to logs.

**SAM.gov API limits:** by default, a key from a non-federal account with no SAM.gov role allows **10 requests per day**, and a key from an account with a role allows 1,000 per day. Each request returns up to 1,000 notices, so one daily alert run normally needs 1–3 requests for each keyword.

### Output

**Opportunity:** noticeId, solicitationNumber, title, noticeType, agency, subAgency, office, naics\[], psc, setAside, postedDate, responseDeadline, placeOfPerformance {city, state, zip, country}, isActive, url, source, firstSeenAt.

**Award:** awardId, internalId, recipientName, recipientUei, amount, totalOutlays, startDate, endDate, awardingAgency, awardingSubAgency, fundingAgency, contractAwardType, naics, naicsDescription, psc, pscDescription, description, placeOfPerformanceState, lastModifiedDate, url, source.

**Personal data:** contracting officers' names, emails and phone numbers are never output.

### Use cases

- Small businesses and 8(a)/WOSB/SDVOSB firms get a daily alert of new set-aside bids in their NAICS codes.
- Capture/BD teams research who won similar contracts, for how much and when they expire (recompete pipeline).
- Govcon consultants and newsletters build curated opportunity feeds.

### How to use it

1. Choose **awards** (no key needed) or **opportunities** (paste your SAM.gov API key).
2. Add keywords, NAICS/PSC codes, agencies, a set-aside or a state.
3. To get alerts, turn on **Only new** and schedule a daily run. Send new rows to Slack, email, Google Sheets or a CRM with Apify integrations or webhooks.

### Input examples

```json
{ "mode": "opportunities", "samApiKey": "<your SAM.gov key>", "keywords": ["cybersecurity"], "naicsCodes": ["541512"],
  "setAside": "SBA", "placeOfPerformanceState": "VA", "maxItems": 100, "onlyNew": true }
```

```json
{ "mode": "awards", "keywords": ["cybersecurity"], "agencies": ["Department of Veterans Affairs"],
  "postedFrom": "2026-01-01", "maxItems": 25 }
```

### Output example

```json
{"type":"opportunity","noticeId":"b1d2e6906e4b4782bda294f368dd2bda","solicitationNumber":"N6660427Q0006","title":"Water Filled Test Weight",
 "noticeType":"Combined Synopsis/Solicitation","agency":"DEPT OF DEFENSE","subAgency":"DEPT OF THE NAVY","office":"NUWC DIV NEWPORT",
 "naics":["332439"],"psc":"6635","setAside":"SBA","postedDate":"2026-10-13T17:27:44+00:00","responseDeadline":"2026-10-28T14:00:00-04:00",
 "url":"https://sam.gov/opp/b1d2e6906e4b4782bda294f368dd2bda/view"}
{"type":"award","awardId":"36C10B26F0263","recipientName":"CLIENT FIRST TECHNOLOGIES, INC","amount":1050667.68,"startDate":"2026-09-25",
 "endDate":"2027-09-24","awardingAgency":"Department of Veterans Affairs","naics":"541511","psc":"DA01",
 "description":"ENTERPRISE CYBERSECURITY PROGRAM AUDIT SUPPORT BASE PERIOD","url":"https://www.usaspending.gov/award/CONT_AWD_36C10B26F0263_3600_47QTCA21D00C1_4732"}
```

### Only-new mode

IDs the Actor has already output are stored in the named key-value store `stateStoreName`, separately for each mode. Only unseen IDs are output; each run reports how many it skipped (`STATS.skippedSeen`). Use a different store name for each saved search.

### Limitations

- Opportunities mode needs a SAM.gov API key and is subject to SAM.gov's daily request limits (see above). The posted-date range can be at most 1 year.
- In opportunities mode, keywords match notice **titles** (SAM.gov API `title` parameter). Agency filtering is applied after fetching.
- Opportunities mode follows the official API specification, but it has not yet been tested end to end with a live key.
- Awards come from USAspending, which normally lags 1–5 days behind FPDS.

### Pricing

Pay per event: **$2.00 per 1,000 results** (one `result` event for each opportunity or award in your dataset). Results skipped by **Only new** are free. Example: a daily alert that finds 20 new bids costs about **$0.04 a day**. You can cap any run with the maximum cost per run setting, and the Actor stops cleanly when it reaches the cap.

### FAQ

**Where does the data come from?** Only from official public government APIs: api.usaspending.gov (DATA Act public spending data) and api.sam.gov (with your own key). The Actor uses no scraping of government websites.

**Personal data?** Contracting officers' names, emails and phone numbers are never output. Award recipients are businesses, though a few sole proprietors trade under their own names.

**Is this an official government tool?** No. This Actor is independent and is not affiliated with or endorsed by GSA, SAM.gov, the U.S. Department of the Treasury or USAspending.gov.

**Something broke?** Open an issue on the Actor's Issues tab and include the run ID.

# Actor input Schema

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

What to search. 'awards' (main feature, fully tested) uses the public USAspending.gov API and needs no key. 'opportunities' is BETA and has not yet been verified with a live key. It needs your own free SAM.gov API key (10 requests/day without a SAM.gov role, 1,000/day with a role).

## `keywords` (type: `array`):

Free-text keywords (any of them).

## `naicsCodes` (type: `array`):

e.g. 541512.

## `pscCodes` (type: `array`):

Product/Service codes, e.g. DJ01.

## `agencies` (type: `array`):

Awards: exact top-tier agency names (e.g. 'Department of Veterans Affairs'). Opportunities: case-insensitive match on the department/sub-agency name.

## `setAside` (type: `string`):

Small-business set-aside type.

## `placeOfPerformanceState` (type: `string`):

Two-letter US state code, e.g. VA.

## `postedFrom` (type: `string`):

YYYY-MM-DD. Default: 30 days ago (opportunities) or 1 year ago (awards).

## `postedTo` (type: `string`):

YYYY-MM-DD. Default: today.

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

Opportunities mode: skip archived/inactive notices.

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

Maximum results to output.

## `onlyNew` (type: `boolean`):

Skip results already output by a previous run with the same state store. Schedule daily for alerts.

## `stateStoreName` (type: `string`):

Named key-value store that remembers seen IDs for onlyNew.

## `samApiKey` (type: `string`):

BETA, opportunities mode only. Your own free SAM.gov public API key (sam.gov, Account Details page). Required for opportunities mode, because SAM.gov's Terms of Use allow automated access only through its official API. Limits: 10 requests/day for a non-federal account with no SAM.gov role, 1,000/day with a role. Each request returns up to 1,000 notices. This mode has not yet been verified with a live key.

## Actor input object example

```json
{
  "mode": "awards",
  "keywords": [
    "cybersecurity"
  ],
  "setAside": "",
  "activeOnly": true,
  "maxItems": 100,
  "onlyNew": false,
  "stateStoreName": "us-federal-contracts-state"
}
```

# Actor output Schema

## `results` (type: `string`):

All dataset items: contract awards and/or opportunities.

## `awards` (type: `string`):

Contract awards from USAspending.gov (awards mode).

## `opportunities` (type: `string`):

SAM.gov opportunities (beta, requires your own SAM.gov API key).

## `stats` (type: `string`):

STATS record with output, skipped and date-range counts.

# 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 = {
    "mode": "awards",
    "keywords": [
        "cybersecurity"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("unhampered_dolly/us-federal-contracts-finder").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 = {
    "mode": "awards",
    "keywords": ["cybersecurity"],
}

# Run the Actor and wait for it to finish
run = client.actor("unhampered_dolly/us-federal-contracts-finder").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 '{
  "mode": "awards",
  "keywords": [
    "cybersecurity"
  ]
}' |
apify call unhampered_dolly/us-federal-contracts-finder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,unhampered_dolly/us-federal-contracts-finder"
        }
    }
}
```

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/XdXcS5rv4o8zqa9Cc/builds/iViy9i0QnyT8B6ASK/openapi.json
