# SAM.gov & USAspending – US Federal Contracts & Awards (`ram1eal/us-federal-contracts`) Actor

New US government contract and grant awards from USAspending.gov – who won, amount, agency, NAICS, PSC – with no API key, plus open SAM.gov opportunities with your free key. Track competitors and get daily alerts. Pay per result.

- **URL**: https://apify.com/ram1eal/us-federal-contracts.md
- **Developed by:** [Hiếu Trần Quang](https://apify.com/ram1eal) (community)
- **Categories:** Lead generation, Business, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.80 / 1,000 award or opportunities

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

## SAM.gov & USAspending – US Federal Contracts & Awards

**Newly awarded US government contracts and grants** from **USAspending.gov** – who won, how much, which agency, NAICS and PSC codes, place of performance – **no API key needed**. Plus **open SAM.gov opportunities** with your own free SAM.gov key. Filter by keyword, NAICS, PSC, state, amount and recipient; schedule daily for alerts.

### Why this one

- **No key for awards.** Contract and grant awards come from the official USAspending.gov API – no SAM.gov account, no daily key limits.
- **Competitive intelligence.** See which companies win which contracts, for how much, from which agency – or follow named competitors.
- **Opportunities when you need them.** Switch to SAM.gov opportunities with your own free key (pre-solicitations, sources sought, solicitations, award notices).
- **Clean, readable output.** Descriptions in sentence case, NAICS/PSC with descriptions, links to USAspending / SAM.gov.
- **Alerts.** "Only new results" turns any search into a daily feed.
- **No contact persons.** Contracting officers' names, e-mails and phones are never collected; awards to individuals are skipped.

### Compared with alternatives

|                                         | This Actor            | Typical alternatives          |
| --------------------------------------- | --------------------- | ----------------------------- |
| Awards without an API key               | Yes (USAspending.gov) | Needs SAM.gov key or scraping |
| Competitor tracking by name/UEI         | Yes                   | Rarely                        |
| Daily alerts (only new results)         | Yes                   | Full re-scrape                |
| Contracting officers' personal contacts | Never collected       | Often included                |

### What you get

**Awards:** award ID, recipient name and UEI, amount (USD), agency and sub-agency, NAICS and PSC (with descriptions), place-of-performance state, award type, start and end dates, last modified, USAspending link.

**Opportunities:** title, notice type, solicitation number, agency path, NAICS, PSC, state and city, set-aside, posted date, response deadline, awardee for award notices, SAM.gov link.

### Sample output

```json
{
  "recordType": "award",
  "title": "Cybersecurity exercise support services",
  "agency": "Department of Homeland Security",
  "subAgency": "Office of Procurement Operations",
  "recipientName": "EXAMPLE SOLUTIONS LLC",
  "amount": 2435544.91,
  "naicsCode": "541512",
  "pscCode": "R408",
  "state": "VA",
  "startDate": "2026-10-02",
  "url": "https://www.usaspending.gov/award/CONT_AWD_..."
}
```

### How to use

1. Keep **Awarded contracts** (no key) or choose **Open opportunities** and paste your SAM.gov key.
2. Add keywords, NAICS codes, states or a minimum amount; set "Since" (e.g. `30 days`).
3. Click Start – or schedule daily with "Only new results".

### Use cases

- **GovCon business development:** who is winning in your NAICS codes and agencies.
- **Competitor and partner tracking:** follow named competitors; find teaming partners and subcontracting leads.
- **Sales to government contractors:** fresh lists of companies that just won funding.
- **Grant intelligence:** new grants to universities, nonprofits and companies.
- **AI agents:** "Which companies won DHS cybersecurity contracts this month?"

### Pricing

| Apify plan | Per 1,000 results | Per run |
| ---------- | ----------------- | ------- |
| Free       | $4.00             | $0.005  |
| Starter    | $3.70             | $0.005  |
| Scale      | $3.30             | $0.005  |
| Business   | $2.80             | $0.005  |

### Cost examples

- Last 30 days of awards in one NAICS (≈ 300): $1.20
- Daily competitor alert: cents per day

### Use it from code, n8n or AI agents

Run it from the Apify API, the Python or JavaScript client, n8n, Make or Zapier – or let an AI agent call it through the **Apify MCP server** (Claude, ChatGPT, Cursor).

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("ram1eal/us-federal-contracts").call(run_input={"keywords":["cybersecurity"],"postedSince":"30 days"})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

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

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client
  .actor('ram1eal/us-federal-contracts')
  .call({ keywords: ['cybersecurity'], postedSince: '30 days' });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

**MCP:** add `ram1eal/us-federal-contracts` to the Apify MCP server and ask in plain English – the agent fills the input and pays per result.

### Data sourcing & compliance

- Awards: **USAspending.gov API** (U.S. Department of the Treasury) – public domain.
- Opportunities: **SAM.gov Get Opportunities API** (GSA) with **your** API key; the key is never logged or stored. Personal SAM.gov keys allow about 10 requests per day and expire every 90 days.
- Contracting officers' contact details are not collected; awards to individuals are skipped.

### FAQ

- **Why do opportunities need a key?** SAM.gov requires one per user; it is free (sam.gov → Account details → Public API Key).
- **Why does "Since" use new awards only?** Awards are matched by their start, so each award appears once rather than with every modification.
- **What if something breaks?** Open an issue – typical response under 12 hours.

### More tools from this author

- [Public Tenders – EU TED & UK Find a Tender Procurement](https://apify.com/ram1eal/public-tenders-search) – EU TED & UK Find a Tender notices with daily alerts
- [Startup Funding Rounds – Crunchbase Alternative (SEC Form D)](https://apify.com/ram1eal/startup-funding-rounds) – US startups raising money, daily from SEC Form D
- [SEC EDGAR API – Company Financials, 10-K Data & Filings](https://apify.com/ram1eal/sec-company-financials) – SEC EDGAR financials and 10-K/10-Q/8-K filings by ticker
- [Companies House API & Company Registry – UK, France, LEI](https://apify.com/ram1eal/company-registry-search) – UK Companies House, France SIRENE & LEI search with a KYB risk score
- [WHOIS Lookup & Domain Checker – Age, DNS, Email, SSL](https://apify.com/ram1eal/domain-intelligence) – bulk WHOIS: domain age, DNS, email provider, SSL and risk
- [Shopify Scraper – Products, Prices, Stock & Price Monitor](https://apify.com/ram1eal/shopify-store-products) – any Shopify store: products, prices, stock, price-drop alerts
- [Tech Stack Detector – BuiltWith & Wappalyzer Alternative](https://apify.com/ram1eal/website-tech-stack) – 3,500+ technologies per website, plus the email provider
- [Impressum Scraper – German Company Data, HRB & VAT Check](https://apify.com/ram1eal/company-imprint) – German/Austrian/Swiss company data from the Impressum, VAT checked
- [Contact Info Scraper – Company Emails, Phones & Socials](https://apify.com/ram1eal/company-contact-finder) – company e-mails, phones and social profiles, GDPR-safe

### Input reference

| Field         | Type    | Default   | Description                                     |
| ------------- | ------- | --------- | ----------------------------------------------- |
| `mode`        | string  | awards    | `awards` (USAspending) or `opportunities` (SAM) |
| `keywords`    | array   | –         | Search words                                    |
| `naicsCodes`  | array   | –         | NAICS codes                                     |
| `postedSince` | string  | 30 days   | Date or relative period                         |
| `maxItems`    | integer | 1000      | Maximum results                                 |
| `onlyNew`     | boolean | false     | Only results not delivered before               |
| `states`      | array   | –         | Place-of-performance states                     |
| `pscCodes`    | array   | –         | PSC codes (awards)                              |
| `minAmount`   | integer | –         | Minimum award amount (USD)                      |
| `recipients`  | array   | –         | Recipient names or UEIs (awards)                |
| `awardTypes`  | string  | contracts | `contracts` or `grants`                         |
| `setAside`    | string  | –         | SAM.gov set-aside code (opportunities)          |
| `samApiKey`   | string  | –         | Your SAM.gov API key (opportunities)            |

### Changelog

- 0.1 – USAspending new awards (contracts, grants), SAM.gov opportunities with user key, only-new alerts.

# Actor input Schema

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

Awards show who won which contract. Opportunities are open SAM.gov notices you can bid on.

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

Words to search in award descriptions or opportunity titles, e.g. cybersecurity, cloud, janitorial.

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

Industry codes, e.g. 541511 (custom programming) or 236220 (commercial construction).

## `postedSince` (type: `string`):

New awards / notices since this date, or within a period like "30 days".

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

Stop after this many results. You pay per result.

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

For daily alerts: return (and pay for) only awards or notices not delivered in your previous runs with the same filters.

## `states` (type: `array`):

Two-letter state codes, e.g. VA, MD, CA.

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

Product and Service Codes, e.g. D399 or R408.

## `minAmount` (type: `integer`):

Only awards of at least this amount.

## `recipients` (type: `array`):

Company names or UEIs, to follow what specific competitors win.

## `awardTypes` (type: `string`):

Contracts, or grants and cooperative agreements to organisations (awards mode).

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

SAM.gov set-aside code, e.g. SBA (small business), 8A, WOSB, SDVOSBC, HZC.

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

Your own free key from sam.gov → Account details → Public API Key. Needed only for opportunities; never logged or stored.

## `stateKey` (type: `string`):

Runs with the same history name share what was already delivered. Leave empty to use one history per search.

## Actor input object example

```json
{
  "mode": "awards",
  "keywords": [
    "cybersecurity"
  ],
  "postedSince": "30 days",
  "maxItems": 100,
  "onlyNew": false,
  "awardTypes": "contracts"
}
```

# Actor output Schema

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

Awards: award ID, recipient name and UEI, amount, agency and sub-agency, NAICS and PSC with descriptions, place of performance, start/end dates, link. Opportunities: title, notice type, solicitation number, agency path, NAICS, PSC, set-aside, posted date, response deadline, link. No contact persons.

## `runSummary` (type: `string`):

JSON summary of the run: requests, results delivered and charged, unchanged results skipped (only-new mode) and error 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 = {
    "keywords": [
        "cybersecurity"
    ],
    "maxItems": 100
};

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

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

```

## MCP server setup

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

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/05eLjsovV7FdFyPU2/builds/LDbBpKM1Op8x3Yts7/openapi.json
