# Federal Contract Intelligence (`skootle/usaspending-contract-intelligence`) Actor

Search USAspending.gov federal contracts, IDVs and grants by contractor, NAICS, agency or keyword. Flags recompete candidates by option end date, spots competed awards that drew a single offer, scores buyer concentration. Export, run via API, schedule and monitor runs, or integrate anywhere.

- **URL**: https://apify.com/skootle/usaspending-contract-intelligence.md
- **Developed by:** [Skootle](https://apify.com/skootle) (community)
- **Categories:** AI, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

<!-- skootle:growth-loop-hook -->
**Federal Contract Intelligence pulls prime contract, IDV and grant awards from the official USAspending.gov API and tells you which ones are coming up for recompete, which were competed in name only, and how concentrated a contractor's buyer base really is.**

Built for capture and BD teams at federal contractors, M&A and equity analysts covering govcon, journalists and oversight researchers, and AI agents that need federal award data in a shape they can act on.

Three ways to run it:

1. Click **Try for free** above, leave the prefilled input alone, and press Start. You get a real Booz Allen award landscape in about ten seconds.
2. Call it from your own code with the Apify API or one of the client libraries. Input is plain JSON, output is plain JSON.
3. Put it on a schedule and let it watch a NAICS code, an agency, or a competitor for you. New recompete candidates show up on their own.

![Federal Contract Intelligence](https://raw.githubusercontent.com/kesjam/skootle-actors-assets/main/heroes/usaspending-contract-intelligence.png)

### TL;DR

Give it a contractor name, a NAICS code, an agency, or a keyword. You get back one `AWARD` record per federal award and one `SUMMARY` record per query.

Every `AWARD` record carries `awardId`, `recipientName`, `parentRecipientName`, `recipientUei`, `awardingAgency`, `awardingSubAgency`, `fundingAgency`, `awardAmountUsd`, `potentialValueUsd`, `totalOutlaysUsd`, `startDate`, `endDate`, `potentialEndDate`, `daysToEnd`, `recompeteWindow`, `isRecompeteCandidate`, `extentCompeted`, `numberOfOffersReceived`, `setAside`, `solicitationProcedures`, `competitionRisk`, `isSingleBidCompeted`, `naicsCode`, `naicsDescription`, `pscCode`, `pscDescription`, `popStateCode`, `marketShareOfNaicsPct`, `subawardCount`, `businessCategories`, `signalRationale`, `fieldCompletenessScore`, `agentMarkdown` and `usaspendingUrl`.

Every `SUMMARY` record carries `awardCount`, `totalObligationsUsd`, `medianAwardUsd`, `agencyConcentrationHhi`, `agencyConcentrationLabel`, `topAgencies`, `naicsMix`, `recompetePipeline`, `competitionProfile`, `fiscalYearTrend`, `fiscalYearTrendBasis` and a plain English `headline`.

The pain it kills: USAspending has the data but makes you assemble the answer. Award search does not tell you when the option period actually ends, the competition fields live on a different endpoint, and nothing on the site tells you that a contract labeled "full and open competition" drew exactly one offer. This Actor does all three joins and hands you the conclusion.

<!-- skootle:review-cta -->
**If this saves you an afternoon of clicking through USAspending, please leave a review at [apify.com/skootle/usaspending-contract-intelligence/reviews](https://apify.com/skootle/usaspending-contract-intelligence/reviews). It is the single biggest thing that helps other buyers find it.**

### What does this Actor actually do?

It runs three joins that USAspending does not run for you.

**Join one: the real end date.** The award search endpoint gives you `End Date`, which is the current period of performance. The option period usually runs longer. This Actor pulls `potential_end_date` from the award detail endpoint, computes `daysToEnd` against today, and buckets each award into `expired`, `imminent` (inside 180 days), `near` (inside your window), or `future`. That bucket is what turns a spreadsheet of past awards into a pipeline you can work.

**Join two: competition reality.** Competition fields live on the award detail record, not on the search result. This Actor pulls `extent_competed`, `number_of_offers_received`, `type_set_aside` and `solicitation_procedures`, then classifies each award into one `competitionRisk` value: `single_bid_competed`, `sole_source`, `set_aside`, `competed_multiple_offers`, or `unknown`.

`single_bid_competed` is the one that matters. It means the government ran a competition and exactly one company bid. The incumbent has the work but has never actually had to defend it. In our verification run against Booz Allen, 6 of 20 enriched awards were in that state, worth billions in obligations.

**Join three: buyer concentration.** The Actor rolls every matching award up by awarding agency and computes a Herfindahl-Hirschman Index on the 0 to 10,000 scale, then labels it against the DOJ and FTC 2023 merger guideline bands: under 1500 is unconcentrated, 1500 to 2500 is moderately concentrated, 2500 and above is highly concentrated. This is how you see in one number whether a contractor is a diversified federal player or one agency away from a very bad quarter.

![Real output from a verification run](https://raw.githubusercontent.com/kesjam/skootle-actors-assets/main/heroes/usaspending-contract-intelligence-proof.png)

### Worked examples from real verification runs

Every row below came out of an actual run. Nothing here is illustrative.

#### Example 1: an incumbent that never had to compete

Input: `{"recipients": ["BOOZ ALLEN HAMILTON"], "fiscalYearsBack": 3, "maxAwardsPerQuery": 50, "enrichTopAwards": 20}`

```json
{
  "recordType": "AWARD",
  "awardId": "47QFCA21F0018",
  "recipientName": "BOOZ ALLEN HAMILTON INC",
  "parentRecipientName": "BOOZ ALLEN HAMILTON HOLDING CORPORATION",
  "awardingAgency": "General Services Administration",
  "awardingSubAgency": "Federal Acquisition Service",
  "fundingAgency": "Department of Defense",
  "awardAmountUsd": 1379603153.12,
  "potentialValueUsd": 1602230952.0,
  "extentCompeted": "FULL AND OPEN COMPETITION",
  "numberOfOffersReceived": 1,
  "competitionRisk": "single_bid_competed",
  "isSingleBidCompeted": true,
  "naicsCode": "541512",
  "signalRationale": "the period of performance has already ended; labeled competed but exactly one offer was received, so the incumbent ran unopposed"
}
````

A $1.38 billion GSA task order, funded by DoD, advertised as full and open competition, and exactly one company bid. You will not find that fact anywhere on the USAspending award page without opening the FPDS transaction detail.

#### Example 2: a recompete that is 17 days out

From the same run, the top of `recompetePipeline.topAwards`:

```json
{
  "awardId": "36C10B21N10070021",
  "recipientName": "BOOZ ALLEN HAMILTON INC",
  "awardingAgency": "Department of Veterans Affairs",
  "awardAmountUsd": 1365285599.63,
  "potentialEndDate": "2026-08-07",
  "daysToEnd": 17,
  "competitionRisk": "competed_multiple_offers"
}
```

This one is genuinely contested, six offers were received, and the work ends in 17 days. That is a different play from example 1, and the record tells you which is which.

#### Example 3: the whole landscape in one SUMMARY record

```json
{
  "recordType": "SUMMARY",
  "awardCount": 50,
  "totalObligationsUsd": 22022913848.69,
  "medianAwardUsd": 270876962.54,
  "agencyConcentrationHhi": 2648.72,
  "agencyConcentrationLabel": "highly_concentrated",
  "topAgencies": [
    { "name": "Department of Defense", "obligationsUsd": 7028189437.52, "sharePct": 34.7 },
    { "name": "General Services Administration", "obligationsUsd": 6901974470.54, "sharePct": 34.1 },
    { "name": "Department of Veterans Affairs", "obligationsUsd": 3176695926.11, "sharePct": 15.7 }
  ],
  "recompetePipeline": { "windowDays": 540, "awardCount": 17, "valueUsd": 6509136775.35, "sharePct": 34 },
  "competitionProfile": {
    "enrichedAwards": 20,
    "singleBidCompeted": 6,
    "singleBidCompetedPct": 30,
    "competedMultipleOffers": 14,
    "averageOffersReceived": 3.6
  },
  "headline": "50 contracts worth $22.02B matched recipient:BOOZ ALLEN HAMILTON. 17 of them ($6.51B) end inside 540 days. 6 of 20 enriched awards were competed with a single offer."
}
```

Three agencies hold 84 percent of the obligations. That is what `highly_concentrated` means in practice.

#### Example 4: sizing a market by NAICS

Input: `{"naicsCodes": ["541512"], "fiscalYearsBack": 2, "maxAwardsPerQuery": 25, "enrichTopAwards": 10}`

Returned `headline`: `25 contracts worth $27.03B matched naics:541512. 10 of them ($9.92B) end inside 365 days. 2 of 10 enriched awards were competed with a single offer.`

Concentration came back at HHI 1450.06, `unconcentrated`, with DoD at 25.6 percent, GSA at 19.1 percent and VA at 13.7 percent. When you pass a NAICS code, each award also gets `marketShareOfNaicsPct` computed against total federal obligations in that code, which was $84.05 billion for 541512 in the searched window:

```json
{
  "awardId": "SAQMMA11F0233",
  "recipientName": "SCIENCE APPLICATIONS INTERNATIONAL CORPORATION",
  "awardAmountUsd": 2087211597.56,
  "marketShareOfNaicsPct": 4.117,
  "numberOfOffersReceived": 3,
  "competitionRisk": "competed_multiple_offers"
}
```

#### Example 5: a capability area by keyword

Input: `{"keywords": ["zero trust"], "fiscalYearsBack": 2, "maxAwardsPerQuery": 25, "enrichTopAwards": 10}`

Returned `headline`: `25 contracts worth $242.23M matched keyword:zero trust. 8 of them ($60.03M) end inside 365 days. 2 of 10 enriched awards were competed with a single offer.`

Concentration was HHI 7157.5, `highly_concentrated`, with DoD holding 84.4 percent. Half of the enriched awards were set asides, which tells a small business something useful before it writes a capture plan. Sample row:

```json
{
  "awardId": "HQ003425CE074",
  "recipientName": "KONIAG IT SYSTEMS, LLC",
  "awardingAgency": "Department of Defense",
  "awardAmountUsd": 24617208.06,
  "competitionRisk": "set_aside"
}
```

#### Example 6: what a genuine no-match looks like

A lot of scrapers bill you a start fee and report success when they find nothing, which makes it impossible to tell a real empty answer from a broken run. This Actor is explicit:

```json
{
  "recordType": "SUMMARY",
  "queryLabel": "recipient:ZZZQXNOTAREALCONTRACTOR",
  "zeroMatch": true,
  "awardCount": 0,
  "sourceStatus": "ok",
  "agencyConcentrationHhi": null,
  "headline": "No contracts matched recipient:ZZZQXNOTAREALCONTRACTOR between 2024-10-01 and 2026-07-20."
}
```

`sourceStatus: "ok"` and no diagnostics means the source was healthy and the answer is genuinely zero. If the upstream API had drifted, returned a malformed body, or handed back rows with no usable identifiers, the run would have **failed** instead, with the evidence written to the key value store under a `DEBUG_ZERO_PARSE_` or `DEBUG_SOURCE_ERROR_` key. An honest failure beats a silent zero.

#### Example 7: the agent-ready view of a single award

Every record ships an `agentMarkdown` field so a model does not have to reason over raw JSON:

```
### 47QFCA21F0018 $1.38B
- Recipient: BOOZ ALLEN HAMILTON INC (parent BOOZ ALLEN HAMILTON HOLDING CORPORATION)
- Buyer: General Services Administration / Federal Acquisition Service
- Work: 541512 COMPUTER SYSTEMS DESIGN SERVICES | PSC DA01
- Period: 2021-03-09 to 2025-05-15 (expired)
- Competition: FULL AND OPEN COMPETITION, offers 1, risk single_bid_competed
- Why it matters: the period of performance has already ended; labeled competed but exactly one offer was received, so the incumbent ran unopposed.
- Source: https://www.usaspending.gov/award/CONT_AWD_47QFCA21F0018_4732_47QTCK18D0004_4732
```

Each run also writes an `AGENT_BRIEFING` record to the key value store with per query counts, so an agent can orient itself before it reads a single row.

### How do I run it?

#### Tutorial: your first run in three minutes

1. Press **Try for free**. The input is already filled in with `BOOZ ALLEN HAMILTON`, three fiscal years, 50 awards and a 540 day recompete window.
2. Press **Start**. The run finishes in roughly eight to thirteen seconds.
3. Open the **Dataset** tab and switch to the **Awards and recompete pipeline** view. Sort by `daysToEnd` ascending to see what is closest to expiring.
4. Filter `recordType` to `SUMMARY` to read the landscape in one row, or filter `isSingleBidCompeted` to `true` to see only the soft incumbencies.
5. Swap `recipients` for your own target, or delete it and put a NAICS code in `naicsCodes` instead.

#### Input

```json
{
  "recipients": ["BOOZ ALLEN HAMILTON"],
  "naicsCodes": [],
  "awardingAgencies": [],
  "keywords": [],
  "placeOfPerformanceStates": [],
  "awardCategory": "contracts",
  "fiscalYearsBack": 3,
  "maxAwardsPerQuery": 50,
  "recompeteWindowDays": 540,
  "enrichTopAwards": 20,
  "includeMarketShare": true
}
```

Every one of `recipients`, `naicsCodes`, `awardingAgencies` and `keywords` accepts a list, and each entry becomes its own query with its own `SUMMARY` record. Set at least one of the four. `awardCategory` switches between prime contracts, indefinite delivery vehicles and grants.

`enrichTopAwards` controls how many of the largest awards get the second lookup that adds competition fields and the option end date. Twenty is a good default. Set it to 0 if you only want the fast award list.

#### Output

Two record types share one dataset, separated by `recordType`. Filter on it. The dataset ships with a prebuilt table view covering the fields most buyers sort on.

#### Running it from code

```bash
curl -X POST "https://api.apify.com/v2/acts/skootle~usaspending-contract-intelligence/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"recipients":["LEIDOS"],"fiscalYearsBack":2,"maxAwardsPerQuery":50}'
```

Standard Apify surfaces all work: the REST API, the JavaScript and Python clients, scheduled runs, webhooks on run completion, and integrations with Make, Zapier, Slack, Google Sheets and the rest of the connector catalog. Monitoring is built in, so a failed run pages you instead of quietly returning nothing.

### How much will this cost you?

Pricing is **$3.00 per 1,000 results**, plus a **$0.01 start fee** per run, with a **$5.00 hard cap per run** so a runaway query cannot surprise you. Platform usage is included, so the price you see is the price you pay.

A result is one dataset record, meaning one award row or one query summary. The prefilled demo run returns 51 records, which costs about **$0.16 all in**.

Some concrete shapes:

| What you are doing | Records | Cost |
|---|---|---|
| Demo run, one contractor, 50 awards | 51 | $0.16 |
| Weekly watch on one NAICS code, 100 awards | 101 | $0.31 |
| Competitor sweep, 5 contractors at 100 awards each | 505 | $1.53 |
| Daily recompete monitor on 3 agencies, 50 awards each | 153 per day | $0.47 per day |

You are paying for the joins, not for the raw rows. USAspending is free and public, and you are welcome to call it yourself. What you are buying here is the option end date join, the competition classification, the concentration math, the honest-empty contract, and the fact that it keeps working when the upstream response shape moves.

### Is it legal to use USAspending data?

Yes, and this Actor only touches the official public API.

USAspending.gov is operated by the US Department of the Treasury and publishes federal award data under the DATA Act of 2014. The data is a work of the United States government, which is not subject to copyright protection in the United States under 17 U.S.C. section 105. The API is documented, open, and requires no key or account.

This Actor sends ordinary API requests to `api.usaspending.gov`. It does not scrape HTML, does not use a proxy, does not use a browser, does not bypass any access control, and does not touch any authenticated or restricted endpoint. It respects the published API and nothing else.

The records describe federal awards to organizations. They are not consumer personal data, so GDPR and CCPA obligations around personal information are not triggered by ordinary use. Recipient contact and executive compensation fields that USAspending publishes about individuals are not collected by this Actor.

**Not affiliated with, endorsed by, or connected to the United States government, the Department of the Treasury, USAspending.gov, or any federal agency.** No government seal, agency logo, or official mark is used in this listing. All artwork is original. Award data is reproduced as the government published it, and you should verify anything material against the source record, which is linked on every row as `usaspendingUrl`.

### What is the best USAspending scraper, and why choose this Actor?

Most of the USAspending Actors on the Store do the same thing: they call the award search endpoint and hand you the rows back. That is genuinely useful and it is also about twenty minutes of work. Here is an honest comparison.

| Capability | Typical USAspending scraper | Federal Contract Intelligence |
|---|---|---|
| Award search rows | Yes | Yes |
| Option period end date (`potential_end_date`) | No, only current end date | Yes, from the award detail endpoint |
| Recompete bucketing and pipeline value | No | Yes, `recompeteWindow` plus a rolled up `recompetePipeline` |
| Extent competed and offers received | No | Yes |
| Single bid competed detection | No | Yes, `isSingleBidCompeted` |
| Set aside and solicitation procedures | No | Yes |
| Buyer concentration (HHI) | No | Yes, with DOJ and FTC band labels |
| Share of NAICS market | No | Yes, when a NAICS code is supplied |
| Fiscal year trend, clipped to the query window | No | Yes, with an explicit `fiscalYearTrendBasis` |
| Per query market summary | No | Yes, one `SUMMARY` record per query |
| Agent ready output (`agentMarkdown`, `AGENT_BRIEFING`) | No | Yes |
| Versioned schema, stable record ids, ISO dates | Rarely | Yes, `schemaVersion` 1.0.0 |
| Honest empty contract | No, silent zero on failure | Yes, zero match succeeds, drift fails with evidence |
| Field completeness scoring | No | Yes, `fieldCompletenessScore` per row |

Two things to be fair about. First, if all you need is a list of awards, a cheaper scraper will do it, and several on the Store charge $1 to $2 per 1,000. Second, the competition and option date fields depend on FPDS data that USAspending itself sometimes leaves incomplete on older awards. When that happens you get `unknown` and a `detailEnriched: false` flag rather than a guess.

### Buyer questions

**Which awards does `isRecompeteCandidate` flag?**
Any award whose latest known end date, preferring `potentialEndDate` over `endDate`, falls inside your `recompeteWindowDays` and has not already passed. The default window is 540 days, which is roughly the point where a serious capture effort has to start.

**Why does an award show `competitionRisk: "unknown"`?**
Either it was outside your `enrichTopAwards` cut so it never got the detail lookup, or USAspending has no FPDS competition data for it. Check `detailEnriched` to tell the two apart. Raise `enrichTopAwards` if you want more coverage.

**Does the fiscal year trend cover only the years I asked for?**
Yes. USAspending filters on action date, so a search covering the last two fiscal years legitimately returns awards that started in 2012. Charting those would misstate the trend, so the series is clipped to the fiscal year your window starts in, and the trend change percentage compares complete fiscal years only. `fiscalYearTrendBasis` spells out exactly what was compared.

**Can I search subawards or contractor executives?**
Not in this version. Prime awards, IDVs and grants are covered. `subawardCount` and `totalSubawardAmountUsd` come through on enriched awards so you can see where subaward volume exists, but the subaward rows themselves are not pulled. Ask in Issues if you need them and it moves up the list.

**How current is the data?**
As current as USAspending, which loads most contract transactions within a few days of the action date. Every row carries `lastModifiedDate` from the source so you can see the vintage yourself.

**What happens if USAspending is down or changes its response shape?**
The run fails with a readable message and writes the response body snippet to the key value store. It will not report success with an empty dataset, and it will not bill you for rows it did not deliver beyond the start fee.

**Do partial contractor names work?**
Yes. `recipients: ["BOOZ ALLEN"]` matches every Booz Allen entity. Use `parentRecipientName` in the output to roll subsidiaries up to the corporate parent.

**Can I run this on a schedule and get alerted?**
Yes. Use Apify Schedules for the cadence and a webhook or an integration for the alert. A common setup is a daily run with a 90 day `recompeteWindowDays` on your target NAICS, piped into Slack.

**Why is there a start fee?**
Because a run that returns two records still costs real compute. One cent per run keeps the per result price low for people pulling hundreds of rows instead of loading it onto them.

**Is there a free way to try it?**
Yes. The Apify free plan includes monthly credits, and the demo run costs about sixteen cents against them.

### Sibling Actors from Skootle

These are built to the same standard and they compose well with this one.

- [Federal Rulemaking Monitor](https://apify.com/skootle/federal-rulemaking-monitor) tracks Federal Register rules and comment deadlines, which is where the requirement usually shows up before the contract does.
- [SAM.gov Federal Contracts](https://apify.com/skootle/sam-gov-federal-contracts) covers open solicitations. USAspending tells you what was awarded, SAM.gov tells you what is being bought right now. Run both against the same NAICS code.
- [FDIC Bank Intelligence](https://apify.com/skootle/fdic-bank-intelligence) for official institution level financial data when you are diligencing a counterparty.
- [SEC EDGAR Filings](https://apify.com/skootle/sec-edgar-filings) for the public company side of a govcon target, including the risk factors where contract concentration usually gets disclosed.
- [Clinical Trials Intel](https://apify.com/skootle/clinical-trials-intel) if your federal work touches HHS, NIH or BARDA research pipelines.

### Your feedback

If something is wrong, missing, or slower than it should be, open an issue on the [Issues tab](https://apify.com/skootle/usaspending-contract-intelligence/issues). Bugs get fixed there, usually fast, and that is a much better path than a one star review that leaves the problem in place for everyone else.

Feature requests are welcome in the same place. Subaward rows, contractor executive compensation, recipient location filters and IDV parent rollups are all on the list and buyer demand is what moves them up it.

If it worked, a [review](https://apify.com/skootle/usaspending-contract-intelligence/reviews) genuinely helps.

### Technical notes

- Source: the official USAspending.gov API v2, endpoints `/api/v2/search/spending_by_award/`, `/api/v2/search/spending_by_category/{category}/` and `/api/v2/awards/{id}/`. No API key, no proxy, no browser.
- Output schema version 1.0.0, declared on every record. Dates are ISO 8601. Every money field is a plain number in USD with a `Usd` suffix. Enums are normalized and stable.
- Record ids are idempotent: `usaspending:{generated_internal_id}`. The same award produces the same `recordId` on every run, so deduplication across scheduled runs is trivial.
- Verification before release: TypeScript compiles clean, 32 unit tests green, 24 live end to end checks green covering no match, malformed payload, upstream drift and multi page pagination, and three consecutive clean cloud runs on the prefilled input with the output spot checked row by row.

# Actor input Schema

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

Company names to look up, matched against the recipient name on the award. Partial names work: BOOZ ALLEN finds every Booz Allen entity.

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

Industry codes, 2 to 6 digits. 541512 is Computer Systems Design Services. Adding one turns on share of market against every other contractor in that code.

## `awardingAgencies` (type: `array`):

Top tier agency names exactly as USAspending writes them, for example Department of Defense or General Services Administration.

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

Free text searched across award descriptions and identifiers. Use this for capability areas like zero trust or wildfire mitigation.

## `placeOfPerformanceStates` (type: `array`):

Two letter state codes. Leave empty for nationwide.

## `awardCategory` (type: `string`):

Prime contracts, indefinite delivery vehicles, or grants.

## `fiscalYearsBack` (type: `integer`):

How many US federal fiscal years back to search, counting the current one.

## `maxAwardsPerQuery` (type: `integer`):

Cap on award rows returned per lookup, largest obligation first.

## `recompeteWindowDays` (type: `integer`):

Awards whose work ends inside this many days are flagged as recompete candidates and rolled into the pipeline total.

## `enrichTopAwards` (type: `integer`):

The largest N awards get a second lookup that adds extent competed, number of offers received, set aside, and the option period end date. Set 0 to skip.

## `includeMarketShare` (type: `boolean`):

When a NAICS code is set, compare each award against total federal obligations in that code.

## Actor input object example

```json
{
  "recipients": [
    "BOOZ ALLEN HAMILTON"
  ],
  "naicsCodes": [],
  "awardingAgencies": [],
  "keywords": [],
  "placeOfPerformanceStates": [],
  "awardCategory": "contracts",
  "fiscalYearsBack": 3,
  "maxAwardsPerQuery": 50,
  "recompeteWindowDays": 540,
  "enrichTopAwards": 20,
  "includeMarketShare": true
}
```

# 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 = {
    "recipients": [
        "BOOZ ALLEN HAMILTON"
    ],
    "fiscalYearsBack": 3,
    "maxAwardsPerQuery": 50,
    "recompeteWindowDays": 540,
    "enrichTopAwards": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("skootle/usaspending-contract-intelligence").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 = {
    "recipients": ["BOOZ ALLEN HAMILTON"],
    "fiscalYearsBack": 3,
    "maxAwardsPerQuery": 50,
    "recompeteWindowDays": 540,
    "enrichTopAwards": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("skootle/usaspending-contract-intelligence").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "recipients": [
    "BOOZ ALLEN HAMILTON"
  ],
  "fiscalYearsBack": 3,
  "maxAwardsPerQuery": 50,
  "recompeteWindowDays": 540,
  "enrichTopAwards": 20
}' |
apify call skootle/usaspending-contract-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=skootle/usaspending-contract-intelligence",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Federal Contract Intelligence",
        "description": "Search USAspending.gov federal contracts, IDVs and grants by contractor, NAICS, agency or keyword. Flags recompete candidates by option end date, spots competed awards that drew a single offer, scores buyer concentration. Export, run via API, schedule and monitor runs, or integrate anywhere.",
        "version": "0.1",
        "x-build-id": "OrfBpfO0231g8jUEM"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/skootle~usaspending-contract-intelligence/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-skootle-usaspending-contract-intelligence",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/skootle~usaspending-contract-intelligence/runs": {
            "post": {
                "operationId": "runs-sync-skootle-usaspending-contract-intelligence",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/skootle~usaspending-contract-intelligence/run-sync": {
            "post": {
                "operationId": "run-sync-skootle-usaspending-contract-intelligence",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "recipients": {
                        "title": "Contractor names",
                        "type": "array",
                        "description": "Company names to look up, matched against the recipient name on the award. Partial names work: BOOZ ALLEN finds every Booz Allen entity.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "naicsCodes": {
                        "title": "NAICS codes",
                        "type": "array",
                        "description": "Industry codes, 2 to 6 digits. 541512 is Computer Systems Design Services. Adding one turns on share of market against every other contractor in that code.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "awardingAgencies": {
                        "title": "Awarding agencies",
                        "type": "array",
                        "description": "Top tier agency names exactly as USAspending writes them, for example Department of Defense or General Services Administration.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "keywords": {
                        "title": "Keywords",
                        "type": "array",
                        "description": "Free text searched across award descriptions and identifiers. Use this for capability areas like zero trust or wildfire mitigation.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "placeOfPerformanceStates": {
                        "title": "Place of performance states",
                        "type": "array",
                        "description": "Two letter state codes. Leave empty for nationwide.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "awardCategory": {
                        "title": "Award category",
                        "enum": [
                            "contracts",
                            "idvs",
                            "grants"
                        ],
                        "type": "string",
                        "description": "Prime contracts, indefinite delivery vehicles, or grants.",
                        "default": "contracts"
                    },
                    "fiscalYearsBack": {
                        "title": "Fiscal years to cover",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "How many US federal fiscal years back to search, counting the current one.",
                        "default": 3
                    },
                    "maxAwardsPerQuery": {
                        "title": "Max awards per query",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Cap on award rows returned per lookup, largest obligation first.",
                        "default": 100
                    },
                    "recompeteWindowDays": {
                        "title": "Recompete window in days",
                        "minimum": 30,
                        "maximum": 1825,
                        "type": "integer",
                        "description": "Awards whose work ends inside this many days are flagged as recompete candidates and rolled into the pipeline total.",
                        "default": 540
                    },
                    "enrichTopAwards": {
                        "title": "Awards to enrich with competition data",
                        "minimum": 0,
                        "maximum": 100,
                        "type": "integer",
                        "description": "The largest N awards get a second lookup that adds extent competed, number of offers received, set aside, and the option period end date. Set 0 to skip.",
                        "default": 20
                    },
                    "includeMarketShare": {
                        "title": "Compute share of NAICS market",
                        "type": "boolean",
                        "description": "When a NAICS code is set, compare each award against total federal obligations in that code.",
                        "default": true
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
