# SAM.gov Federal Contracts & Bid Opportunities (`justaduck/sam-gov-contract-opportunities`) Actor

Search SAM.gov federal contract opportunities from the official daily public data file: solicitations, sources sought and award notices with agency, NAICS, PSC, set-aside, deadline and award amount. Filter by date, keyword, NAICS, PSC, set-aside, notice type, agency and state. No login, no API key.

- **URL**: https://apify.com/justaduck/sam-gov-contract-opportunities.md
- **Developed by:** [Justaduck](https://apify.com/justaduck) (community)
- **Categories:** Lead generation, Business, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 notices

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### SAM.gov Federal Contracts & Bid Opportunities

**SAM.gov federal contract opportunities as a clean table: solicitations, sources sought, award notices and more, filtered by date, keyword, NAICS, PSC, set-aside, agency and state.**

- **What you get:** one row per notice with `title`, `noticeType`, `solicitationNumber`, `department` / `office`, `postedDate`, `responseDeadline`, `naicsCode`, `pscCode`, `setAside`, place of performance, award fields (`awardDate`, `awardAmount`, `awardee`), `description` and links to SAM.gov. Contracting officer contacts only if you turn them on.
- **What it costs:** US$2.00 per 1,000 notices plus US$0.0005 per run start. Apify's free plan (US$5 of usage a month) covers about 2,500 notices. That is the price on Apify's Free plan; on paid Apify plans it goes down to US$1.40 per 1,000 notices, the "from" price on the Store page.
- **Try it:** Click **Start** on the prefilled form: it returns up to 5 notices from the newest posting day (at most US$0.01005) in a few seconds.

Search **US federal contract opportunities** (solicitations, presolicitations, sources sought, award notices, special notices and more) and get them as clean JSON, CSV or Excel. The data comes from **SAM.gov's official public data extract** – the *Contract Opportunities* file that SAM.gov publishes for download under Data Services (`ContractOpportunitiesFullCSV.csv`, public version). No login, no API key.

- **Updated once a day.** SAM.gov regenerates the file once a day (around 04:30 UTC in our checks). Every result carries `dataUpdatedAt`, the time SAM.gov last updated the file, so you always know how fresh the data is. This Actor is not real-time: a notice posted an hour ago appears after SAM.gov's next daily refresh.
- **Quick for recent notices.** The file is about 230 MB, newest notices first. The Actor reads only the beginning of the file and stops as soon as it has enough notices (`maxItems`) or has passed your date range – a quick 5-notice run reads only a few kilobytes. It checks on every run that the dates really are in newest-first order; if they are not, it reads the whole file instead and says so in the log, so nothing is missed.
- **Contracting officer contacts only if you ask.** SAM.gov's notices list a primary and secondary point of contact (name, title, work e-mail, phone, fax). They are left empty by default; turn on `includeContacts` to get them exactly as SAM.gov publishes them. The description is SAM.gov's original text: e-mail addresses and phone numbers in it are always masked, but names mentioned in it are not removed (see below; you can turn the description off).

### How to use the SAM.gov scraper

1. Open [this Actor on Apify Store](https://apify.com/justaduck/sam-gov-contract-opportunities) and try it in Apify Console. A free Apify account is enough; no credit card is needed.
2. The input form is prefilled with a small example: it returns up to 5 notices from the newest posting day in SAM.gov's file. Click **Start** to try it; it finishes in a few seconds.
3. Set your own filters: **Keywords**, **NAICS codes**, **PSC codes**, **Set-aside codes**, **Notice types**, **Agencies** or **Place-of-performance states**, and a date range (**Posted within the last N days** or **Posted from** / **Posted to**). Set **Max items** to cap the run and its cost.
4. Click **Start** and open the **Output** tab when the run finishes. Preview the notices as a table, or export them as JSON, CSV or Excel.
5. To automate it, save the input as a task and **schedule** it, call the Actor through the **Apify API**, or send the results to Make, Zapier, n8n, Slack or a webhook with Apify **integrations**.

### What you can filter

All filters are optional. Different filters are combined with AND; several values inside one filter are combined with OR. All filtering happens on the official file rows.

| Input | What it does |
|---|---|
| `postedWithinDays` | Calendar days counted back from the newest posting date in today's file, including that day. `1` (default) = the newest day, usually yesterday (US Eastern time). |
| `postedFrom`, `postedTo` | Fixed date range (YYYY-MM-DD, inclusive). `postedFrom` overrides `postedWithinDays`; leave `postedTo` empty for "up to the newest day". |
| `keywords` | Words or phrases found in the title or description (case-insensitive). |
| `naicsCodes` | NAICS code or prefix, 2–6 digits (`5415` matches 541511, 541512, …). |
| `pscCodes` | Product/Service Code (PSC, SAM.gov `ClassificationCode`) or prefix, e.g. `R4`, `D3`, `7030`. |
| `setAsideCodes` | SAM.gov set-aside codes, e.g. `SBA`, `SBP`, `8A`, `8AN`, `HZC`, `SDVOSBC`, `WOSB`, `EDWOSB`, `ISBEE`, `VSA`, `NONE`. |
| `noticeTypes` | Exact notice types, e.g. `Solicitation`, `Combined Synopsis/Solicitation`, `Presolicitation`, `Sources Sought`, `Award Notice`, `Special Notice`, `Justification`. |
| `agencies` | Part of the department, sub-tier or office name, e.g. `Veterans Affairs`, `Army`, `NASA`. |
| `states` | Two-letter code of the place-of-performance state, e.g. `VA`, `CA`. |
| `maxItems` | Maximum number of notices to return. **Default 1,000, maximum 20,000** (the form is pre-filled with 5 for a quick first try). The Actor stops reading as soon as it has that many; the log then says that more matching notices are available. |
| `includeContacts` | Return the contracting officer points of contact published in each notice (default `false`). Off: the ten contact fields are `null`. On: they are returned exactly as in SAM.gov's file. See FAQ. |
| `includeDescription` | Include the description text (default `true`). Set to `false` to leave it out completely (`description` = `null`), for example if you do not want any names that appear in the original text. |

Values that are not valid (for example a NAICS code with letters) are skipped and listed in the run's `SUMMARY` record with the reason; the rest of the search still runs.

### Input example

```json
{
    "postedWithinDays": 7,
    "naicsCodes": ["5415"],
    "setAsideCodes": ["SBA", "SDVOSBC"],
    "states": ["VA", "MD", "DC"],
    "maxItems": 500
}
```

### Output example

A real result (posted 2026-11-20, from the 2026-11-21 file; default settings, so the contact fields are `null`):

```json
{
    "noticeId": "40d6703a465b4814802f744ca9f00df4",
    "title": "JAX and TBW WFO CARPET REPLACEMENT",
    "solicitationNumber": "1305M327Q0043",
    "department": "COMMERCE, DEPARTMENT OF",
    "cgac": "013",
    "subTier": "NATIONAL OCEANIC AND ATMOSPHERIC ADMINISTRATION",
    "fpdsCode": "1330",
    "office": "DEPT OF COMMERCE NOAA",
    "aacCode": "1305M3",
    "postedDate": "2026-11-20",
    "postedDateTimeRaw": "2026-11-20 16:11:59",
    "noticeType": "Combined Synopsis/Solicitation",
    "baseType": "Combined Synopsis/Solicitation",
    "archiveType": "auto15",
    "archiveDate": "2026-12-25",
    "setAsideCode": "SDVOSBC",
    "setAside": "Service-Disabled Veteran-Owned Small Business (SDVOSB) Set-Aside (FAR 19.14)",
    "responseDeadline": "2026-12-10T17:00:00.000Z",
    "responseDeadlineRaw": "2026-12-10T12:00:00-05:00",
    "naicsCode": "238330",
    "pscCode": "S214",
    "popStreetAddress": null,
    "popCity": null,
    "popState": "FL",
    "popZip": null,
    "popCountry": "USA",
    "active": true,
    "awardNumber": null,
    "awardDate": null,
    "awardAmount": null,
    "awardCurrency": null,
    "awardAmountRaw": null,
    "awardee": null,
    "organizationType": "OFFICE",
    "officeState": "WA",
    "officeCity": "SEATTLE",
    "officeZip": "98115",
    "officeCountryCode": "USA",
    "additionalInfoLink": null,
    "description": "JAX and TBW Weather Forecast Office (WFO) Carpet Replacement Services Please see the attachments for all details. Pay special attention to sections 2, 6, and 7 if interested in this RFQ.",
    "primaryContactTitle": null,
    "primaryContactName": null,
    "primaryContactEmail": null,
    "primaryContactPhone": null,
    "primaryContactFax": null,
    "secondaryContactTitle": null,
    "secondaryContactName": null,
    "secondaryContactEmail": null,
    "secondaryContactPhone": null,
    "secondaryContactFax": null,
    "sourceUrl": "https://sam.gov/workspace/contract/opp/40d6703a465b4814802f744ca9f00df4/view",
    "dataUpdatedAt": "2026-11-21T04:30:20.000Z"
}
```

### Output fields

Values are copied from the official file; empty cells become `null` (nothing is guessed or filled in by AI).

| Field | Type | Description (SAM.gov column) |
|---|---|---|
| `noticeId` | string | SAM.gov notice ID (`NoticeId`); unique key |
| `title` | string | null | Notice title (`Title`) |
| `solicitationNumber` | string | null | Solicitation number (`Sol#`) |
| `department` | string | null | Department / independent agency (`Department/Ind.Agency`) |
| `cgac` | string | null | CGAC agency code (`CGAC`) |
| `subTier` | string | null | Sub-tier agency (`Sub-Tier`) |
| `fpdsCode` | string | null | FPDS agency code (`FPDS Code`) |
| `office` | string | null | Contracting office (`Office`) |
| `aacCode` | string | null | Activity address code (`AAC Code`) |
| `postedDate` | string | Posting date, YYYY-MM-DD (date part of `PostedDate`) |
| `postedDateTimeRaw` | string | `PostedDate` exactly as published. The file gives no time zone; it appears to be US Eastern time, so it is not converted to UTC |
| `noticeType` | string | null | Current notice type (`Type`) |
| `baseType` | string | null | Original notice type (`BaseType`) |
| `archiveType` | string | null | Archive rule (`ArchiveType`) |
| `archiveDate` | string | null | Archive date, YYYY-MM-DD (`ArchiveDate`) |
| `setAsideCode` | string | null | Set-aside code as published (`SetASideCode`; a few rows use the form `["SBA"]`, which the set-aside filter understands) |
| `setAside` | string | null | Set-aside description (`SetASide`) |
| `responseDeadline` | string | null | Response deadline in ISO 8601 UTC when SAM.gov gives a UTC offset; YYYY-MM-DD when only a date is given; `null` when a time is given without a time zone (`ResponseDeadLine`) |
| `responseDeadlineRaw` | string | null | `ResponseDeadLine` exactly as published |
| `naicsCode` | string | null | NAICS code (`NaicsCode`) |
| `pscCode` | string | null | Product/Service Code (`ClassificationCode`) |
| `popStreetAddress` | string | null | Place of performance street address (`PopStreetAddress`) |
| `popCity` | string | null | Place of performance city (`PopCity`) |
| `popState` | string | null | Place of performance state (`PopState`) |
| `popZip` | string | null | Place of performance ZIP (`PopZip`) |
| `popCountry` | string | null | Place of performance country (`PopCountry`) |
| `active` | boolean | null | `Active` (Yes → true, No → false) |
| `awardNumber` | string | null | Award number (`AwardNumber`) |
| `awardDate` | string | null | Award date, YYYY-MM-DD (`AwardDate`) |
| `awardAmount` | number | null | Award amount as a number (`Award$`); `null` when the cell is not a plain amount |
| `awardCurrency` | string | null | `USD` when `awardAmount` is set |
| `awardAmountRaw` | string | null | `Award$` exactly as published |
| `awardee` | string | null | Awardee name and address as published (`Awardee`) |
| `organizationType` | string | null | Organization type of the office (`OrganizationType`) |
| `officeState` | string | null | Contracting office state (`State`) |
| `officeCity` | string | null | Contracting office city (`City`) |
| `officeZip` | string | null | Contracting office ZIP (`ZipCode`) |
| `officeCountryCode` | string | null | Contracting office country (`CountryCode`) |
| `additionalInfoLink` | string | null | Additional information link, when it is an absolute URL (`AdditionalInfoLink`) |
| `description` | string | null | Description text from the file (`Description`), with e-mail addresses and phone numbers replaced by `[email removed]` / `[phone removed]`; names in the text are kept. `null` when `includeDescription` is `false` |
| `primaryContactTitle` | string | null | Primary point of contact, job title (`PrimaryContactTitle`). `null` unless `includeContacts` is on |
| `primaryContactName` | string | null | Primary point of contact, name (`PrimaryContactFullname`). `null` unless `includeContacts` is on |
| `primaryContactEmail` | string | null | Primary point of contact, work e-mail (`PrimaryContactEmail`). `null` unless `includeContacts` is on |
| `primaryContactPhone` | string | null | Primary point of contact, work phone (`PrimaryContactPhone`). `null` unless `includeContacts` is on |
| `primaryContactFax` | string | null | Primary point of contact, fax (`PrimaryContactFax`). `null` unless `includeContacts` is on |
| `secondaryContactTitle` | string | null | Secondary point of contact, job title (`SecondaryContactTitle`). `null` unless `includeContacts` is on |
| `secondaryContactName` | string | null | Secondary point of contact, name (`SecondaryContactFullname`). `null` unless `includeContacts` is on |
| `secondaryContactEmail` | string | null | Secondary point of contact, work e-mail (`SecondaryContactEmail`). `null` unless `includeContacts` is on |
| `secondaryContactPhone` | string | null | Secondary point of contact, work phone (`SecondaryContactPhone`). `null` unless `includeContacts` is on |
| `secondaryContactFax` | string | null | Secondary point of contact, fax (`SecondaryContactFax`). `null` unless `includeContacts` is on |
| `sourceUrl` | string | Official SAM.gov notice page (`Link`) |
| `dataUpdatedAt` | string | null | When SAM.gov last updated the file (ISO 8601 UTC) |

### Contacts and personal data

The file has ten contact columns: `PrimaryContactTitle`, `PrimaryContactFullname`, `PrimaryContactEmail`, `PrimaryContactPhone`, `PrimaryContactFax` and the same five for the secondary contact. These are the contracting officers SAM.gov names in each official notice, with their government work contact details. **By default they are not returned** (the fields are `null`). If you turn on `includeContacts`, they are returned exactly as SAM.gov publishes them – the Actor does not add, guess or enrich anything. They come from a public official source, but they are still details of individual people: you are responsible for using them lawfully (for example anti-spam and data-protection rules).

The description is the official text as SAM.gov published it. The Actor masks e-mail addresses and phone numbers in it (best effort: unusual spellings can slip through), but it does **not** remove names: many descriptions say things like "contact the Contract Specialist, Jane Doe". If you want to avoid that text entirely, set `includeDescription` to `false`. Each notice's `sourceUrl` links to the official SAM.gov page, where the contracting office's points of contact are shown in context.

Attachments are not downloaded; the description is the text included in SAM.gov's file.

### Run time limit and scheduled runs

- **Time limit:** one run lasts at most 20 minutes. Results are written page by page as they arrive, so when the limit is reached everything already written is kept (and charged as usual). In the run summary (`SUMMARY` in the run's key-value store) the input that was running is marked `partial` ("time budget … more results are available") and inputs not reached are marked `not-run` (nothing charged for them).
- **Speed:** Reading the whole SAM.gov file (about 230 MB) takes about 4–5 minutes; a 1-day window reads only the first few MB. For long date ranges, use fewer days per run.
- **When the source fails:** a page that fails its format check is not written and the run ends as failed (results from earlier pages are kept); an input that keeps failing (timeouts, server errors) is marked `failed` or `partial`, and after 3 such inputs in a row the remaining inputs of that source are marked `not-run`.
- **SAM.gov maintenance:** during SAM.gov's scheduled maintenance the download link shows a web page instead of the file. The Actor waits 30 seconds and tries again, 3 times (about 1.5 minutes in total); if SAM.gov is still down, the run fails with "SAM.gov answered with a web page (probably scheduled maintenance)…" and no results are charged (only the run start fee applies). Run it again later.
- **Scheduled runs:** This Actor does not keep track of what earlier runs returned. For a daily feed, schedule it with `postedWithinDays: 2` (a little overlap so nothing falls between runs): each run returns, and charges for, every notice in that window, including ones you got the day before. Remove those repeats by `noticeId` (the same notice returned again has the same `noticeId`). An amendment is published by SAM.gov as a new notice with a new `noticeId` and the same `solicitationNumber`, so to follow one solicitation and its amendments, group rows by `solicitationNumber`. Some notices have no solicitation number (`solicitationNumber` is `null`); those can only be told apart by `noticeId`.

### Pricing

Pay per result: **US$2.00 per 1,000 notices** (US$0.002 each) plus **US$0.0005 per run start**. You pay only for notices returned; a run that finds nothing costs only the start fee.

| Run | Cost |
|---|---|
| Quick try (pre-filled form, 5 notices) | 5 × 0.002 + 0.0005 = **US$0.0105** |
| 200 notices | **US$0.40005** |
| 1,000 notices | **US$2.00005** |

Discounts by Apify plan (per 1,000 results): Free $2.00, Bronze $1.80, Silver $1.60, Gold $1.40.

**Free plan:** Apify's free plan includes US$5 of prepaid usage every month (no credit card needed). With this Actor that is enough for about 2,500 notices a month.

### Use with AI agents (MCP)

AI agents can run this Actor through the [Apify MCP server](https://docs.apify.com/mcp) (Model Context Protocol). There are two ways to connect:

- **Load this Actor as its own tool:** add `https://mcp.apify.com?tools=justaduck/sam-gov-contract-opportunities` to your MCP client. The server exposes it as the tool `justaduck--sam-gov-contract-opportunities`.
- **Let the agent find it:** connect to `https://mcp.apify.com` (default tools). The agent can find this Actor with `search-actors`, read its input schema with `fetch-actor-details` and start it with `call-actor`.

On first connection you sign in to Apify with OAuth (or send your Apify API token as a Bearer header). The agent passes the same fields as in the Input section. A run returns its dataset ID, and the agent reads the rows with `get-dataset-items`. Runs started this way run on your Apify account and are charged as in the Pricing section; `call-actor` also accepts `maxTotalChargeUsd` in `callOptions` to cap what one run can spend.

### FAQ

**How fresh is the data?** As fresh as SAM.gov's daily file. Check `dataUpdatedAt` on any result. Running more than once a day returns the same data until SAM.gov's next refresh.

**What does "last 1 day" mean?** The newest posting date found in the file (normally yesterday, US Eastern time) – not the last 24 hours. `postedWithinDays: 7` returns that day plus the six calendar days before it.

**Why can a large request take longer?** The file is ordered newest first. The Actor stops as soon as it has `maxItems` notices, so a small request is quick whatever the date range (5 notices: about 33 KB read, 1–2 seconds in our tests from Asia). Asking for every notice of a long range means reading further into the file: all notices of the last 7 days needed 29 MB, of the last 30 days 88 MB (about 24 and 94 seconds on that connection).

**What if SAM.gov changes the file?** The Actor checks the columns on every run. If a column it needs is missing or a row has the wrong number of columns, the run fails with "Source format changed" instead of returning shifted or partial data. New extra columns are noted in the log.

**Can I get the contracting officer's name, e-mail and phone?** Yes: turn on `includeContacts`. You then get the primary and secondary points of contact that SAM.gov publishes in the notice (name, title, work e-mail, phone, fax), exactly as in the official file; empty in the file means `null`. Without the option these fields are always `null`.

**How much memory does it need?** The default 512 MB is enough for normal runs. If you set `maxItems` above about 10,000, use 1 GB.

**How is this different from other SAM.gov tools?** Several SAM.gov tools work by calling the search endpoints behind the SAM.gov website. SAM.gov's terms of use state: "Automated data gathering, web scraping tools are prohibited". The same terms say "You may also download some SAM.gov data"; this Actor uses only that public download file (and the official file storage it redirects to). The trade-off is freshness: the download is refreshed once a day, while the website changes during the day.

**Is the data official?** Yes – every value comes from SAM.gov's public Contract Opportunities extract. This Actor is not affiliated with or endorsed by SAM.gov or the U.S. General Services Administration.

### Related Actors

Other public procurement Actors by the same author, with the same kind of output:

- **[TED Tenders Scraper – EU Public Procurement](https://apify.com/justaduck/eu-ted-tenders)**: EU public tenders and contract award notices from TED, filtered by country, CPV code, notice type and deadline. Use it for tenders in the European Union.
- **[UK Tenders – Find a Tender & Contracts Finder](https://apify.com/justaduck/uk-government-tenders)**: UK public sector tenders, pipeline notices and contract awards from Find a Tender and Contracts Finder. Use it for tenders in the United Kingdom (no longer published on TED).

# Actor input Schema

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

Calendar days counted back from the newest posting date in today's SAM.gov file (1 = the newest day, usually yesterday US Eastern time). Ignored when Posted from is set.

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

Fixed start date (inclusive). Overrides Posted within the last N days.

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

Fixed end date (inclusive). Needs Posted from. Leave empty for up to the newest day.

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

Match notices whose title or description contains any of these words or phrases (case-insensitive).

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

NAICS code or prefix, 2 to 6 digits (e.g. 5415 matches 541511, 541512 …).

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

Product/Service Code (ClassificationCode) or prefix, e.g. R4, D3, 7030.

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

SAM.gov set-aside codes, e.g. SBA (total small business), SBP, 8A, 8AN, HZC, SDVOSBC, WOSB, EDWOSB, ISBEE, VSA, NONE.

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

Exact notice types, e.g. Solicitation, Combined Synopsis/Solicitation, Presolicitation, Sources Sought, Award Notice, Special Notice, Justification, Sale of Surplus Property.

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

Part of the department, sub-tier or office name (case-insensitive), e.g. Veterans Affairs, Army, NASA.

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

Two-letter state codes of the place of performance, e.g. VA, CA, TX.

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

Maximum number of notices to return (default 1,000, up to 20,000). The Actor stops reading as soon as it has this many. You pay only for notices returned.

## `includeDescription` (type: `boolean`):

Include the notice description text from SAM.gov's file. E-mail addresses and phone numbers in it are masked, but the description is the official text and may still mention people by name (for example the contracting officer). Turn this off to leave the description out (description = null).

## `includeContacts` (type: `boolean`):

Off by default. When on, adds the primary and secondary points of contact (name, title, work e-mail, phone, fax) exactly as SAM.gov publishes them in the official notice. These are government employees' official work contacts from a public source; you are responsible for using them lawfully (for example anti-spam and privacy rules).

## Actor input object example

```json
{
  "postedWithinDays": 1,
  "maxItems": 5,
  "includeDescription": true,
  "includeContacts": false
}
```

# Actor output Schema

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

One dataset item per result. Field descriptions are in the dataset schema.

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

SUMMARY record: per-input status, item counts and the reason for any skipped or failed input.

# 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 = {
    "postedWithinDays": 1,
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("justaduck/sam-gov-contract-opportunities").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 = {
    "postedWithinDays": 1,
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("justaduck/sam-gov-contract-opportunities").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 '{
  "postedWithinDays": 1,
  "maxItems": 5
}' |
apify call justaduck/sam-gov-contract-opportunities --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,justaduck/sam-gov-contract-opportunities"
        }
    }
}
```

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/6Odmzyr8auxTRKtdi/builds/tSNz5eQXj9uPdnbpw/openapi.json
