# Federal Contract Awards by NAICS, State & Set-Aside (`queenly_friendship/federal-contract-awards`) Actor

Newly awarded US federal contracts from official USAspending.gov data. Filter by NAICS/PSC, place of performance, agency, small-business set-aside (8(a), SDVOSB, WOSB, HUBZone), amount and keywords. Subcontracting and supplier leads with UEI. $3 per 1,000 awards.

- **URL**: https://apify.com/queenly_friendship/federal-contract-awards.md
- **Developed by:** [Patera Ventures](https://apify.com/queenly_friendship) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 awards

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

## Federal Contract Awards: Who Just Won (by NAICS, State & Set-Aside)

See **which companies just won federal contracts** in your trade and area, straight from official **USAspending.gov** data. Filter by NAICS or PSC code, place-of-performance state, awarding agency, small-business set-aside (8(a), SDVOSB, WOSB, HUBZone), award size, and keywords. Each row includes the winner's UEI, amount, dates, agency, and description, with links to the award and the SAM.gov entity.

**$3 per 1,000 awards.** No login, no API key. You only pay for unique awards delivered to the dataset.

### Who uses it

- **Subcontractors and suppliers**: a prime that just won a $14M VA construction job needs subs and materials now.
- **Equipment rental, staffing, insurance and bonding, and financing** companies selling to new award winners.
- **GovCon consultants and BD teams** tracking competitors and set-aside winners.
- **Analysts and journalists** following federal spending by agency or region.

### Input

| Field | Example | Notes |
| --- | --- | --- |
| `naicsCodes` | `["23"]`, `["2382"]`, `["541512"]` | 2, 4, or 6 digits. Default `["23"]` (construction). Pass `[]` for all industries. |
| `pscCodes` | `["Z2AA"]` | Optional |
| `states` | `["OH"]` | Place of performance. Default `["OH"]`. Pass `[]` for all states. |
| `agencies` | `["Department of Veterans Affairs"]` | Top-tier agency names |
| `setAsideCodes` | `["SDVOSBC", "8A", "WOSB", "HZC", "SBA"]` | Optional |
| `keywords` | `["roof"]` | Optional |
| `awardedWithinDays` | `30` | Or set `startDate` / `endDate` |
| `newAwardsOnly` | `true` | Skip modifications to old contracts |
| `awardKind` | `contracts` | Or `idvs` (IDIQ, GWAC, BPA) |
| `minAmount` / `maxAmount` | `250000` | Optional |
| `maxResults` | `500` | Spending cap (default 200) |
| `skipPreviouslyReturned` | `true` | Skip records already delivered in earlier runs (not charged) |
| `resetPreviouslyReturned` | `false` | Forget earlier runs and start fresh |

Example (matches the Console form and a bare API call): new construction awards in Ohio from the last 30 days.

```json
{ "naicsCodes": ["23"], "states": ["OH"], "awardedWithinDays": 30, "newAwardsOnly": true, "maxResults": 200 }
```

To search all industries nationwide, pass empty lists: `{ "naicsCodes": [], "states": [] }`. If you omit `naicsCodes` or `states` in an API call, the Actor uses the same starting values as the Console form (`["23"]` and `["OH"]`).

**Tip:** schedule it weekly with `awardedWithinDays: 7` and send new winners to Google Sheets, Slack, or your CRM.

### Output

```json
{
  "awardId": "47PB5226C0002", "recipientName": "TOWN CENTER CONSTRUCTION, L.L.C.", "recipientUei": "LLU4JWAL6828",
  "awardAmount": 2523096.0, "startDate": "2026-11-12", "awardType": "DEFINITIVE CONTRACT",
  "awardingAgency": "General Services Administration", "awardingSubAgency": "Public Buildings Service",
  "naicsCode": "236220", "naicsDescription": "COMMERCIAL AND INSTITUTIONAL BUILDING CONSTRUCTION",
  "description": "CONSTRUCTION SERVICES FOR THE STOKES COURTHOUSE HARDENING PROJECT ...",
  "placeOfPerformanceState": "OH", "placeOfPerformanceZip": "44113",
  "usaspendingUrl": "https://www.usaspending.gov/award/CONT_AWD_47PB5226C0002_4740_-NONE-_-NONE-"
}
```

### Cost

**$0.003 per award ($3 per 1,000).** Duplicates are never charged.

### FAQ

**Where does the data come from?** The public USAspending.gov API (US Treasury). Not affiliated with USAspending, GSA, or SAM.gov.

**Does a bare API call search the whole country?** No. If you omit `naicsCodes` or `states`, the Actor uses the Console prefills: construction (NAICS 23) in Ohio. Pass empty arrays to search all NAICS and all states.

**Are emails or phone numbers included?** No. USAspending does not publish them. Use the UEI to look the company up on SAM.gov.

**Why are recent Department of Defense awards missing?** DoD contract data is published with about a 90-day delay by law.

**How are results sorted?** By award amount, largest first.

**What if I pass an invalid NAICS or state?** The run fails immediately with a short message, for example `NAICS codes must be 2, 4 or 6 digits: ['99999']` or `States must be 2-letter codes like OH, PA. Invalid: ['OHIO']`. You are not charged.

### No duplicates, ever

- **Within a run:** each award is keyed by its USAspending award ID and delivered once.
- **Across runs:** with `skipPreviouslyReturned` (on by default), the tool remembers what it already gave you in a private key-value store in *your* Apify account. Scheduled or repeat runs return only records you haven't received.
- **You're never charged for a duplicate.** Skipped records aren't saved or billed.
- To get everything again, turn on `resetPreviouslyReturned` for one run.

# Actor input Schema

## `awardedWithinDays` (type: `integer`):

Ignored if a start date is set.

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

YYYY-MM-DD

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

YYYY-MM-DD (default today)

## `newAwardsOnly` (type: `boolean`):

Only awards first made in the period (skip modifications to old contracts).

## `awardKind` (type: `string`):

Award kind.

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

2, 4 or 6 digits, e.g. 23 (construction), 2382 (building equipment contractors), 541512. The Console and API default to \["23"]. Pass an empty list to include all NAICS (nationwide industries).

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

Product/service codes, e.g. Z2AA, J035.

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

2-letter place-of-performance codes, e.g. OH, PA. The Console and API default to \["OH"]. Pass an empty list to include all states.

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

Top-tier names exactly as on USAspending, e.g. Department of Veterans Affairs, Department of Defense, General Services Administration.

## `setAsideCodes` (type: `array`):

e.g. SBA (small business), 8A, 8AN, HZC (HUBZone), SDVOSBC, WOSB, EDWOSB.

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

Words that must appear in the award (3+ letters).

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

Min award amount ($).

## `maxAmount` (type: `integer`):

Max award amount ($).

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

Max awards.

## `skipPreviouslyReturned` (type: `boolean`):

On by default: records this tool already delivered to you in earlier runs are skipped (and not charged), so scheduled or repeat runs only bring new records.

## `resetPreviouslyReturned` (type: `boolean`):

Clear the memory of previously returned records before this run, so everything matching is returned again.

## Actor input object example

```json
{
  "awardedWithinDays": 30,
  "newAwardsOnly": true,
  "awardKind": "contracts",
  "naicsCodes": [
    "23"
  ],
  "states": [
    "OH"
  ],
  "maxResults": 200,
  "skipPreviouslyReturned": true,
  "resetPreviouslyReturned": false
}
```

# Actor output Schema

## `results` (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 = {
    "naicsCodes": [
        "23"
    ],
    "states": [
        "OH"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("queenly_friendship/federal-contract-awards").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 = {
    "naicsCodes": ["23"],
    "states": ["OH"],
}

# Run the Actor and wait for it to finish
run = client.actor("queenly_friendship/federal-contract-awards").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 '{
  "naicsCodes": [
    "23"
  ],
  "states": [
    "OH"
  ]
}' |
apify call queenly_friendship/federal-contract-awards --silent --output-dataset

```

## MCP server setup

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

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/yO37tjVtPsAIiFBnn/builds/MDJowBLwlqQhEs9al/openapi.json
