# Federal Bids & Subcontracting Leads by NAICS (`bjgomes/federal-bids-subcontracting-by-naics`) Actor

For small federal contractors: open SAM.gov bids you can respond to with your set-asides, primes winning in your NAICS codes with their subcontracting plans, teaming partners, contracts ending soon and SBA SubNet posts, in one run. Official data, no API key. Pay per row.

- **URL**: https://apify.com/bjgomes/federal-bids-subcontracting-by-naics.md
- **Developed by:** [Brian Gomes](https://apify.com/bjgomes) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 open bids

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 Bids & Subcontracting Leads by NAICS finds federal work for a small contractor in one run. You give it your NAICS codes and certifications. It returns:

- the open SAM.gov bids you can actually respond to
- the prime contractors winning in your codes, and whether they must subcontract to small businesses
- teaming partners: firms winning the same set-asides you hold
- contracts ending soon
- subcontracting posts from SBA SubNet

All of it comes from official public data. You don't need a SAM.gov API key or an account.

### What it does

Give it your NAICS codes, such as `541512` or `5415` for the whole group, and the certifications you hold. You get:

- **Open bids you can respond to.** Every open SAM.gov solicitation, combined synopsis, presolicitation and sources sought in your codes, from SAM.gov's nightly file of all active notices.
  - Each is marked eligible or not for your certifications: an SDVOSB sees SDVOSB, VA veteran-owned and small-business set-asides, and no 8(a) or HUBZone ones.
  - Amendments are folded into one row per solicitation.
  - Each row has the contracting officer's name, email and phone, and is flagged when it mentions a security clearance.
- **Primes to approach.** The large businesses winning the most in your codes, from USAspending. Each shows the FPDS subcontracting plan code on its largest award. A plan means FAR 19.702 requires the prime to subcontract to small businesses, which makes those primes the ones to pitch.
- **Teaming partners.** The firms winning the set-asides you hold, in your codes.
- **Contracts ending soon.** Contracts in your codes whose end date falls in the next months, largest first, with the incumbent named. Each is a recompete to prepare for, or a company to team with.
- **Subcontracting posts.** Open SBA SubNet posts from primes looking for subcontractors in your codes.
- **What's new.** Every row says whether it's new since the last run. Turn on "Only what's new" and schedule it daily to get just the new bids, charged only for those.
- **A summary.** A plain-English run summary on the Output tab: set-asides you hold, bids due soonest, primes with plans, contracts ending and what was left out.

Here's what four rows look like:

| type | title or company | detail | due or ends | eligible or plan |
|---|---|---|---|---|
| opportunity | Network Operations Support Services | SDVOSB set-aside, NAICS 541512, Dept of the Army | due in 18 days | eligible |
| opportunity | Cloud Migration Sources Sought | No set-aside, NAICS 541519, Dept of Veterans Affairs | due in 9 days | eligible |
| prime | Example Federal Systems Inc | $74.6M in your codes, 60 awards | | Individual subcontract plan |
| expiring-contract | Example Data Corp | $12.4M with Defense Health Agency, NAICS 541512 | ends 2027-04-30 | |

(Example data.)

### Who it's for

- **Small businesses new to federal work.** See which bids fit your codes and certifications without learning SAM.gov's search screens.
- **Veteran-owned, women-owned, 8(a) and HUBZone firms.** The eligibility check reads every set-aside, not just one type at a time.
- **Firms that want to subcontract first.** The primes, teaming partners and SubNet posts sections are built for finding a prime to work under.
- **Business development consultants and APEX advisors.** Run it per client and hand them the spreadsheet.
- **AI agents and automations.** Fixed fields, no API key, and it works through the Apify MCP server.

### Input

| Field | What it does | Default |
|---|---|---|
| NAICS codes | Your codes: 6 digits, or 4 or 2 digits for a whole group. Up to 20. | none |
| Certifications you hold | Small business, 8(a), HUBZone, SDVOSB, VOSB, WOSB, EDWOSB. Decides which set-asides you can respond to. | none |
| What to find | Open bids, primes and teaming partners, contracts ending soon, subcontracting posts. | all four |
| Which bids | Bids you can respond to, only set-asides you hold, or all bids. | Bids I can respond to |
| Place of performance states | Two-letter codes. Empty means nationwide, which suits remote work. | nationwide |
| Keep bids with no place of performance | About 65% of notices give none. Off: keep them only when the contracting office is in your states. | on |
| Notice types | Solicitation, Combined Synopsis/Solicitation, Presolicitation, Sources Sought, Special Notice, Award Notice. | the first four |
| Posted or amended within (days) | Leave out notices with no activity in this many days. | 90 |
| Minimum days to respond | Leave out bids due sooner than this. | 3 |
| Also find these words | Also include bids and posts with these words, whatever their NAICS code. | none |
| Leave out these words | Leave out bids and posts with these words. | none |
| Leave out architect-engineer work | Leave out A-E design work (PSC C codes), common under 541330. | on |
| Services only | Leave out product buys (PSC codes starting with a digit). | off |
| Leave out bids that mention a clearance | Leave out bids that mention Secret, TS/SCI, a SCIF or a polygraph. | off |
| Award states | Limit primes, teaming partners and expiring contracts to work in these states. | nationwide |
| Award agencies | Limit them to these agencies. | all |
| Award lookback (months) | The window for ranking primes. | 12 |
| Maximum primes per list | Primes to profile, and as many teaming partners. | 15 |
| Prime size | Other than small (the ones that hold subcontracting plans), or all. | Other than small |
| Find teaming partners | Also list firms winning the set-asides you hold. | on |
| Contracts ending within (months) | The window for expiring contracts. | 12 |
| Minimum contract value (USD) | Leave out smaller expiring contracts. | 100,000 |
| Maximum expiring contracts | How many to list, largest first. | 100 |
| Only what's new since the last run | Leave out rows the last run of the same codes already returned. | off |
| Maximum rows per section | A ceiling per section. | 500 |

Input field names in the API: `naicsCodes`, `certifications`, `sections`, `setAsideFilter`, `states`, `includeNoStateListed`, `noticeTypes`, `postedWithinDays`, `minDaysToRespond`, `keywords`, `excludeKeywords`, `excludeArchitectEngineer`, `servicesOnly`, `excludeClearanceRequired`, `awardStates`, `awardAgencies`, `awardLookbackMonths`, `maxPrimes`, `primeSize`, `includeSetAsidePeers`, `expiringWithinMonths`, `expiringMinAmount`, `maxExpiringContracts`, `onlyNew`, `maxResultsPerSection`.

**Values:**

- Certifications: `small`, `8a`, `hubzone`, `sdvosb`, `vosb`, `wosb`, `edwosb`.
- Sections: `opportunities`, `primes`, `expiringContracts`, `subcontractingPosts`.
- Notice types: `solicitation`, `combined`, `presolicitation`, `sourcesSought`, `specialNotice`, `award`.

Expiring contracts need award states or award agencies. Nationwide, most codes have tens of thousands of contracts.

Example input: an SDVOSB IT firm that works remotely, with primes and expiring contracts in Texas:

```json
{
  "naicsCodes": ["541512", "541519", "541511"],
  "certifications": ["sdvosb", "vosb"],
  "servicesOnly": true,
  "awardStates": ["TX"]
}
```

Daily monitoring of new bids only:

```json
{
  "naicsCodes": ["541512", "541519", "541511"],
  "certifications": ["sdvosb"],
  "sections": ["opportunities", "subcontractingPosts"],
  "onlyNew": true
}
```

### Output

One dataset with a `type` on every row. The Output tab has a Summary and one table per type. Export it from the Console as CSV, JSON, Excel, XML or HTML, or read it through the Apify API.

**Open bids** (`type: "opportunity"`):

| Field | What it holds |
|---|---|
| `title`, `noticeType` | The notice and its type. |
| `agency`, `subTier`, `office` | Who's buying. |
| `solicitationNumber`, `noticeId` | Identifiers. |
| `postedDate`, `firstPostedDate`, `versions` | Latest and first posting, and how many versions (amendments) there are. |
| `responseDeadline`, `daysToRespond` | When responses are due. |
| `setAsideCode`, `setAside` | The set-aside. |
| `eligible`, `eligibleReason` | Whether your certifications let you respond, and why. |
| `naicsCode`, `matchedBy`, `pscCode` | Classification, and which of your codes or words found it. |
| `isArchitectEngineer`, `isProductBuy` | A-E design work, or a product buy. |
| `placeOfPerformance`, `stateSource`, `officeState` | Where the work is done, and where the state came from. |
| `primaryContact`, `secondaryContact` | Name, email and phone. |
| `mentionsClearance`, `clearanceMention` | The notice mentions a clearance, SCIF or polygraph, and the words. |
| `award` | Award notices: number, date, amount, awardee. |
| `description`, `descriptionLength` | The first 2,000 characters, and the full length. |
| `samUrl`, `additionalInfoUrl` | Links. |

**Primes and teaming partners** (`type: "prime"`):

| Field | What it holds |
|---|---|
| `role` | `large-prime` or `set-aside-peer` (a teaming partner). |
| `name`, `uei`, `parentName` | The company. |
| `businessSize`, `businessCategories` | Size and USAspending's categories, such as Service Disabled Veteran Owned Business. |
| `hasSubcontractingPlan`, `subcontractingPlanCode`, `subcontractingPlan` | The FPDS plan code on its largest award in your codes. |
| `obligatedInYourCodes`, `awardCount`, `lookbackMonths` | Dollars and awards in your codes. |
| `agencies`, `largestAwards` | Its customers and 3 largest awards, with links. |
| `largestAwardSubawards` | Subawards reported on its largest award. Often empty, because many primes don't report them. |
| `contractsEndingSoon` | How many of this run's expiring contracts are its own. |
| `usaspendingUrl` | Its USAspending profile. |

**Contracts ending soon** (`type: "expiring-contract"`):

- The award: `awardId`, `awardType`, `amount`, `description` and `usaspendingUrl`.
- Who holds it: `incumbent`, `uei` and `incumbentUrl`.
- Who's buying: `agency` and `subAgency`.
- What and where: `naicsCode`, `naicsTitle`, `pscCode` and `placeOfPerformanceState`.
- When: `startDate`, `endDate` and `monthsLeft`.

**Subcontracting posts** (`type: "subcontracting-post"`):

- The post: `title`, `primeContractor`, `description` and `url`.
- Dates: `closingDate` and `performanceStartDate`.
- Where: `performancePlace` and `state`.
- What: `naicsCode` and `naicsTitle`.
- Who to call: `contactName`, `contactPhone` and `contactEmail`.

**On every row:** `changeSinceLastRun` (`new`, `updated` or empty) and `error`.

An `error` row (free) says what was skipped or partial, in `section` and `error`.

Example row (JSON, shortened):

```json
{
  "type": "opportunity",
  "changeSinceLastRun": "new",
  "title": "Network Operations Support Services",
  "noticeType": "Solicitation",
  "agency": "DEPT OF DEFENSE",
  "subTier": "DEPT OF THE ARMY",
  "solicitationNumber": "W000XX-27-R-0001",
  "postedDate": "2026-10-21 09:14:00",
  "versions": 2,
  "responseDeadline": "2026-11-12T14:00:00-06:00",
  "daysToRespond": 18,
  "setAsideCode": "SDVOSBC",
  "setAside": "Service-Disabled Veteran-Owned Small Business (SDVOSB) Set-Aside (FAR 19.14)",
  "eligible": true,
  "eligibleReason": "SDVOSB set-aside: you hold SDVOSB certification.",
  "naicsCode": "541512",
  "placeOfPerformance": {"city": "San Antonio", "state": "TX", "zip": "78234", "country": "USA"},
  "primaryContact": {"name": "Pat Officer", "email": "pat.officer@army.mil", "phone": "210-555-0100"},
  "mentionsClearance": false,
  "samUrl": "https://sam.gov/workspace/contract/opp/.../view",
  "error": null
}
```

(Example data.)

### Pricing

You pay per row. There's no monthly fee and no API key to buy.

- **Each open bid:** $0.003, so $3 per 1,000.
- **Each prime or teaming partner:** $0.02. Each one is a profile built from several USAspending lookups.
- **Each expiring contract:** $0.005.
- **Each subcontracting post:** $0.003.
- **Each run:** a $0.02 start charge per GB of memory, so $0.02 at the default 1 GB. Every run downloads SAM.gov's full 210 MB file of active notices.
- **Not charged:** error rows, and rows "Only what's new" leaves out.

**Worked examples:**

- A first run with 130 open bids, 15 primes, 15 teaming partners and 100 expiring contracts: 130 × $0.003 + 30 × $0.02 + 100 × $0.005 + $0.02 = **$1.51**.
- A daily "only new" run with 10 new bids: **$0.05**.

Set a maximum cost per run for a hard ceiling. The run stores only what fits, and looks up no primes it couldn't charge for. Then it stops and says what it left out.

On Apify's free plan, a run returns at most 25 rows per section and 5 primes per list, as a sample. Any paid Apify plan removes that limit.

### How it handles the hard cases

- **Amendments.** SAM.gov's file has a row for every version of a notice. They're grouped by solicitation number and agency. You get the newest version, with `versions` and `firstPostedDate`.
- **No place of performance.** About two in three notices give none. They're kept by default. With the setting off, the contracting office's state stands in, and `stateSource` says which was used.
- **Set-asides you can't check.** A local-area (disaster) set-aside, or a code it doesn't know, is kept with `eligible` empty and a reason.
- **Architect-engineer work.** A-E design jobs (PSC C codes: roofs, elevators, HVAC, building design) crowd 541330. They're left out unless you turn that off.
- **Clearances.** Bids that mention Secret, TS/SCI, a SCIF, a polygraph or a facility clearance are flagged. A CAC or base pass isn't. You can leave the flagged ones out.
- **DoD data delay.** DoD contract awards reach USAspending 90 days after award, by DoD rule. DoD primes and expiring DoD contracts look quieter than they are. The summary says so.
- **Subaward reports.** Many primes don't report subawards, so they're shown but not ranked on. The subcontracting plan code is the reliable signal.
- **SBA SubNet.** It has no API. Its listing is read from sba.gov, which was moving to a new site in October 2026, when only SubNet's first page loaded. Pages that fail give one free error row saying so, and the run goes on.
- **A source that's down.** SAM.gov's file is retried once. USAspending is tried 3 times with a pause between. A source that still fails gives an error row, and the other sections still run. The run is marked failed only when every section it ran failed.
- **The run's time limit.** The run stops starting new work a little before its timeout, and says what's left.

### Compared with the free tools

**SAM.gov saved searches** are free and email new bids by NAICS code and set-aside. They're the right tool if bids are all you need. This Actor adds:

- the prime, teaming partner, expiring contract and SubNet sections
- an eligibility check across every set-aside at once
- one row per solicitation instead of one per amendment
- a spreadsheet or API you can feed into anything

**USAspending's own search** answers any one question about awards. This Actor asks the questions a subcontractor needs, across your codes, in one run.

**Paid GovCon platforms** (GovWin, GovTribe, HigherGov) do far more, for hundreds to thousands of dollars a year. This Actor costs a few dollars a month for daily monitoring.

Data from SAM.gov, USAspending.gov and the SBA. Not made by or affiliated with GSA, SAM.gov, USAspending, the SBA or any US government agency.

### FAQ

**Do I need a SAM.gov account or API key?**
No. Bids come from SAM.gov's public nightly file of all active notices, and awards from USAspending's public API. Neither needs a key.

**How fresh is it?**
SAM.gov rebuilds the file every night, so a notice posted today appears in tomorrow morning's file. USAspending updates daily, except for DoD's 90-day delay.

**Why are there so few bids in my state?**
Most notices don't name a place of performance, and much federal IT work is remote or at the agency's site. Leave states empty for nationwide work, or keep "Keep bids with no place of performance" on.

**What's a subcontracting plan, and why does it matter?**
Under FAR 19.702, a large business winning a contract over $900,000 ($2 million in construction) must have a plan to subcontract to small businesses, with goals it reports on. Primes with plans are looking for small subs. `hasSubcontractingPlan` reads the plan code FPDS records on the prime's largest award in your codes.

**Is a teaming partner a competitor?**
Often both. Firms winning the same set-asides know the agencies and can bring you in as a sub, or join you in a joint venture or mentor-protégé arrangement.

**Does it check SDVOSB or 8(a) status in SAM.gov?**
No. It takes the certifications you say you hold and shows the bids they qualify for.

**Can I run it on a schedule?**
Yes. Turn on "Only what's new" and schedule it daily or weekly. The history is kept per set of NAICS codes and keywords, so changing other filters doesn't reset it.

### Limits

- US federal contracts only. No grants, and no state or local bids, so Texas ESBD and other state portals aren't covered.
- Bids are SAM.gov notices over $25,000. DIBBS, GSA eBuy and agency-only portals aren't covered.
- Up to 20 NAICS codes per run. USAspending only takes codes of 2, 4 or 6 digits.
- Primes are ranked by dollars obligated in your codes over the lookback, not by how much they subcontract.
- SBA SubNet is best-effort while sba.gov changes.
- On Apify's free plan, 25 rows per section and 5 primes per list.

### Integrations

This Actor runs on Apify, so everything the platform does works with it.

- **API.** Start a run and read the results from your own code, in any language. [Apify API](https://docs.apify.com/integrations/api)
- **Schedules.** Run your codes every morning with "Only what's new". [Schedules](https://docs.apify.com/actors/running/schedules)
- **Tasks.** Save your input once as a task, and run it with one click or on a schedule. [Tasks](https://docs.apify.com/actors/running/tasks)
- **Webhooks.** Get a call to your own URL when a run succeeds or fails. [Webhooks](https://docs.apify.com/integrations/webhooks)
- **Google Sheets and Drive.** Download the results as CSV or Excel and open them in Sheets. Or add a Google Sheets step after this Actor in Make or Zapier. [Datasets and exports](https://docs.apify.com/storage/dataset), [Google Drive](https://docs.apify.com/integrations/drive)
- **Zapier, Make and n8n.** Send new bids to email, Slack or a CRM. [Zapier](https://docs.apify.com/integrations/zapier), [Make](https://docs.apify.com/integrations/make), [n8n](https://docs.apify.com/integrations/n8n)
- **AI agents (MCP).** Claude, ChatGPT and other MCP clients can find and run this Actor through the Apify MCP server. [Apify MCP server](https://docs.apify.com/integrations/mcp)

### Works with

- [Website Contact Finder](https://apify.com/bjgomes/website-contact-finder): find the emails and phones on a prime's website, such as its small business liaison or supplier diversity office.

# Actor input Schema

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

Your NAICS codes: 6 digits for one code (541512), or 4 or 2 digits for a whole group (5415 is all of 5415xx). Up to 20. Open bids, primes, expiring contracts and subcontracting posts are all found by these codes.

## `certifications` (type: `array`):

Decides which set-aside bids you can respond to. Any of these implies small business; SDVOSB implies VOSB; EDWOSB implies WOSB. Leave empty if you hold none: you'll see bids open to everyone. Also used to find teaming partners: firms winning the same set-asides.

## `sections` (type: `array`):

Open bids from SAM.gov; primes winning in your codes (and teaming partners) from USAspending; contracts ending soon from USAspending (needs award states or agencies); subcontracting posts from SBA SubNet.

## `setAsideFilter` (type: `string`):

'Bids I can respond to': no set-aside, plus the set-asides your certifications qualify for. 'Only set-asides I hold'. 'All bids': every set-aside, each marked eligible or not.

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

Two-letter codes (TX, VA, DC). Empty means nationwide, which suits remote work. Most notices (about 65%) give no place of performance; see the next field.

## `includeNoStateListed` (type: `boolean`):

On: a bid with no place of performance is kept. Off: it's kept only when its contracting office is in one of your states. Only matters with states set.

## `noticeTypes` (type: `array`):

Which SAM.gov notices count as bids. Sources Sought and Presolicitations are the early ones: answer them to shape the requirement.

## `postedWithinDays` (type: `integer`):

Leave out notices not posted or amended in this many days. Closed notices are always left out.

## `minDaysToRespond` (type: `integer`):

Leave out bids due in fewer days than this. Notices without a response date are kept.

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

Also include bids and SubNet posts whose title or description has any of these words or phrases (whole words), whatever their NAICS code. About 13% of notices have no NAICS code. Used for primes only when no NAICS codes are given.

## `excludeKeywords` (type: `array`):

Leave out bids and SubNet posts whose title or description has any of these words or phrases (whole words).

## `excludeArchitectEngineer` (type: `boolean`):

Leave out A-E design work (PSC codes starting with C: building, roof, HVAC and elevator design by licensed architects and engineers, bought on an SF 330). Common under 541330. Applies to bids, primes and expiring contracts.

## `servicesOnly` (type: `boolean`):

Leave out product buys (PSC codes starting with a digit, such as IT equipment). Applies to bids, primes and expiring contracts. Keeps reseller primes out of your teaming list. Leave off if you sell products.

## `excludeClearanceRequired` (type: `boolean`):

Every bid is flagged when it mentions a security clearance (Secret, TS/SCI, SCIF, polygraph, facility clearance). A CAC or base pass doesn't count. On: flagged bids are left out.

## `awardStates` (type: `array`):

Two-letter codes. Limits primes, teaming partners and expiring contracts to work performed in these states. Empty means nationwide, where the largest primes dominate.

## `awardAgencies` (type: `array`):

Limits primes, teaming partners and expiring contracts to awards from these agencies.

## `awardLookbackMonths` (type: `integer`):

Primes are ranked by dollars obligated to them in your codes over this many months.

## `maxPrimes` (type: `integer`):

How many primes to profile, largest first, and as many teaming partners. Each profile is one charged row.

## `primeSize` (type: `string`):

'Other than small': large businesses, the ones FAR 19.702 requires to hold a subcontracting plan on contracts over $900,000 ($2 million in construction). 'All': small businesses too.

## `includeSetAsidePeers` (type: `boolean`):

Also list the firms winning the set-asides you hold (SDVOSB set-asides for an SDVOSB, and so on) in your codes. Needs at least one certification.

## `expiringWithinMonths` (type: `integer`):

List contracts in your codes whose current end date falls in the next this many months, largest first: recompetes to prepare for, or incumbents to team with.

## `expiringMinAmount` (type: `integer`):

Leave out expiring contracts below this value. 0 keeps all.

## `maxExpiringContracts` (type: `integer`):

How many expiring contracts to list, largest first. Each is one charged row.

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

Every row says whether it's new or updated since the last run of the same NAICS codes and keywords. On: rows you already got are left out, and not charged. Schedule it daily.

## `maxResultsPerSection` (type: `integer`):

A ceiling on rows from each section. Set a maximum cost per run for a hard ceiling on spend.

## Actor input object example

```json
{
  "naicsCodes": [
    "541512",
    "541519"
  ],
  "certifications": [],
  "sections": [
    "opportunities",
    "primes",
    "expiringContracts",
    "subcontractingPosts"
  ],
  "setAsideFilter": "eligible",
  "states": [],
  "includeNoStateListed": true,
  "noticeTypes": [
    "solicitation",
    "combined",
    "presolicitation",
    "sourcesSought"
  ],
  "postedWithinDays": 90,
  "minDaysToRespond": 3,
  "keywords": [],
  "excludeKeywords": [],
  "excludeArchitectEngineer": true,
  "servicesOnly": false,
  "excludeClearanceRequired": false,
  "awardStates": [],
  "awardAgencies": [],
  "awardLookbackMonths": 12,
  "maxPrimes": 15,
  "primeSize": "otherThanSmall",
  "includeSetAsidePeers": true,
  "expiringWithinMonths": 12,
  "expiringMinAmount": 100000,
  "maxExpiringContracts": 100,
  "onlyNew": false,
  "maxResultsPerSection": 500
}
```

# Actor output Schema

## `summary` (type: `string`):

The run in plain English: set-asides you hold, bids due soonest, primes with subcontracting plans, teaming partners, contracts ending soon and SubNet posts, with what's new since the last run.

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

Open SAM.gov bids in your codes, soonest deadline first, each marked eligible or not for your certifications, with the contracting officer's contact.

## `primes` (type: `string`):

Primes winning in your codes with their subcontracting plan, and firms winning the set-asides you hold.

## `expiring` (type: `string`):

Contracts in your codes ending in the next months, largest first, with the incumbent.

## `posts` (type: `string`):

SBA SubNet posts from primes looking for subcontractors in your codes.

## `allFields` (type: `string`):

Every row with every field, including full contacts, descriptions, largest awards and error rows.

# 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": [
        "541512",
        "541519"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bjgomes/federal-bids-subcontracting-by-naics").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": [
        "541512",
        "541519",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("bjgomes/federal-bids-subcontracting-by-naics").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": [
    "541512",
    "541519"
  ]
}' |
apify call bjgomes/federal-bids-subcontracting-by-naics --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bjgomes/federal-bids-subcontracting-by-naics"
        }
    }
}
```

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/qK5DintYEDSS2evaT/builds/NQIUGJeCLi7CmtaHI/openapi.json
