# Government Bids, RFP & Contracts Search API for AI Agents (`talcoe/government-bids-search-api`) Actor

Search more than 10,000 open US government bids, RFPs and contract opportunities with one HTTP request. The answer comes straight back, with no run to start. It covers SAM.gov federal contracts and state, county and city procurement. AI agents and apps call it like any API. You pay per bid returned.

- **URL**: https://apify.com/talcoe/government-bids-search-api.md
- **Developed by:** [M Usama](https://apify.com/talcoe) (community)
- **Categories:** Lead generation, Business, AI
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.00 / 1,000 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

### What does Government Bids Search API do?

**Government Bids Search API** answers searches over an index of more than 10,000 open US government bids, RFPs and contract opportunities. You send one HTTP request and get JSON straight back, with no run to start and nothing to poll. You can also start a normal run with an input and read the matches from the dataset.

The index covers SAM.gov (federal), BidNet Direct, Bonfire agency portals, PlanetBids, and the state portals of Texas, North Carolina, Illinois, Massachusetts, Florida, Pennsylvania, Georgia, Oregon and Nevada. It also covers the cities of Chicago, Philadelphia and New York. More state portals join as the index grows.

The index is rebuilt every night from a full sweep of every source. Each answer carries `index.sweepAt`, the time of the sweep it comes from. This Actor does not scrape anything when you call it. For a live scrape of the portals, use the [live scraper](https://apify.com/talcoe/us-government-bids-rfps).

### Why use Government Bids Search API?

- Give an AI agent or an app one endpoint to find open bids by keyword, state, source, agency type, NAICS prefix or set aside.
- Check each morning which new bids match your trade, using `postedWithinDays` or `dueWithinDays`.
- Pull a bid by its id and send your team to the bid's own page.
- Leave the sweeps to us. The index is rebuilt every night, and bids whose due date has passed are never returned.

### Use it from an AI agent

An agent can call this Actor in the middle of a conversation, because one request returns the answer. Give the agent the server URL, an Apify token and the description at `GET /openapi.json`, or let it call the Actor through the Apify MCP server.

The search understands plain requests. A search for `hvac maintenance contracts in texas` drops the filler words, filters to Texas and lists what it did in `query.notes`. The word `federal` in a search filters to federal agencies the same way.

### Use it as an MCP server

Point any MCP client at `https://talcoe--government-bids-search-api.apify.actor/mcp` and send the header `Authorization: Bearer <YOUR_APIFY_TOKEN>`. The endpoint speaks Streamable HTTP and keeps no session.

It offers three tools.

- `search_government_bids` takes the same parameters as `/search`.
- `get_government_bid` takes a bid `id`.
- `get_bid_index_stats` takes no arguments and is free.

Each bid returned by a search or a lookup is charged like a search. A bad argument comes back as a tool error with a sentence that says what to send instead.

### How to use Government Bids Search API

1. Get your Apify API token from the Console under Settings, then Integrations.
2. Send a GET request to `https://talcoe--government-bids-search-api.apify.actor` with the header `Authorization: Bearer <YOUR_APIFY_TOKEN>`.
3. Read the `bids` array. When `nextOffset` is a number, send it as `offset` to get the next page.

```bash
curl -H "Authorization: Bearer <YOUR_APIFY_TOKEN>" \
  "https://talcoe--government-bids-search-api.apify.actor/search?q=janitorial,landscaping&state=TX,CA&limit=10"
```

To fetch one bid, encode the colon in its id as `%3A`.

```bash
curl -H "Authorization: Bearer <YOUR_APIFY_TOKEN>" \
  "https://talcoe--government-bids-search-api.apify.actor/bids/texas%3AIW256103_RESUBMIT"
```

See how many open bids each state and source holds. This call is free.

```bash
curl -H "Authorization: Bearer <YOUR_APIFY_TOKEN>" \
  "https://talcoe--government-bids-search-api.apify.actor/stats"
```

The Server tab of this Actor shows every parameter. `GET /openapi.json` returns the same description for your tools.

#### Search parameters

| Parameter | What it does |
|---|---|
| `q` | Search phrases separated by commas. A bid matches when it matches any phrase. A phrase matches when all of its words appear in the bid text. A word matches when a bid word starts with it. A word of 3 characters or fewer must be a whole word in the title or in fields such as the agency and category. Case and punctuation are ignored. |
| `state` | Two letter state codes separated by commas, such as `TX,CA`. |
| `source` | Source ids separated by commas, such as `sam,texas,bidnet`. |
| `agencyType` | Any of federal, state, county, city, school, authority, other. |
| `naics` | NAICS prefixes separated by commas. `5617` matches `561720`. |
| `setAside` | A set aside code such as `SBA` or `8A` matches that code only. Other text, such as `small business` or `HUBZone`, matches part of the code or its name. |
| `postedWithinDays` | Bids posted in the last N days, from 1 to 365. |
| `dueWithinDays` | Bids due in the next N days, from 1 to 365. Bids with no due date are left out. |
| `hasDocumentFacts` | `true` keeps only bids that carry `documentFacts`. |
| `sort` | `relevance`, `due` or `posted`. |
| `limit` | 1 to 50. The default is 10. |
| `offset` | How many matches to skip. |

A bad parameter returns HTTP 400 with an `error` sentence that says what to send instead.

### Input

A normal run reads these fields from the Input tab. Every field is optional.

- `keywords`: one search phrase per entry. A bid matches when it matches any entry.
- `states`, `sources`, `agencyTypes`, `naics`, `setAside`: the same filters as above.
- `postedWithinDays` and `dueWithinDays`: day windows from 1 to 365.
- `onlyWithDocumentFacts`: keep bids that carry `documentFacts`.
- `sort`: `relevance`, `due` or `posted`.
- `maxResults`: from 1 to 5000. The default is 100.

```json
{
    "keywords": ["janitorial", "landscaping"],
    "maxResults": 25
}
```

### Output

Each bid is one JSON object. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

```json
{
    "id": "texas:IW256103_RESUBMIT",
    "source": "texas",
    "title": "Relocation of Pulse Fence",
    "agency": "Tx Dept Crim. Justice/inst Div",
    "agencyType": "state",
    "state": "TX",
    "postedDate": "2026-11-23",
    "dueDate": "2026-12-28T15:00:00",
    "status": "open",
    "solicitationNumber": "IW256103_RESUBMIT",
    "category": "Fence Installation, Maintenance And Repair",
    "naics": [],
    "setAside": null,
    "url": "https://www.txsmartbuy.gov/esbd/IW256103_RESUBMIT",
    "firstSeen": "2026-11-24T23:42:16+00:00",
    "lastSeen": "2026-11-24T23:42:16+00:00"
}
```

#### Data fields

| Field | Meaning |
|---|---|
| `id` | The source and the source's own id, joined by a colon. |
| `title`, `agency`, `agencyType` | What is being bought and who is buying. |
| `state`, `city` | Where the agency is. About half of the SAM.gov bids have no state. |
| `postedDate`, `dueDate` | ISO dates. Some carry a time and an offset, some are date only. |
| `noticeType`, `solicitationNumber`, `category` | How the portal labels the bid. |
| `naics` | NAICS codes when the portal gives them. |
| `setAside` | On SAM.gov bids a code such as `SBA` or `8A`. Other portals give free text. |
| `setAsideLabel` | The name of the SAM.gov code, such as Total Small Business Set-Aside. Other portals have none. |
| `description`, `documents` | Summary text and linked files when the portal gives them. |
| `url` | The bid's own page. |
| `firstSeen`, `lastSeen` | When our nightly history first and last saw the bid. |
| `documentFacts` | Beta. Present on about 100 bids. |

About 100 bids carry `documentFacts`: scope, bid bond, performance bond, insurance, license needs, each with the sentence it was read from. It is a beta.

No contact names, emails or phones are in the index. The bid's own page has them.

### How much does it cost to search government bids?

Pricing is pay per event.

| Event | Price |
|---|---|
| A bid returned by a request to the server URL | $0.008 |
| A bid returned by a run started with an input | $0.006 |
| A run started with an input | $0.005 |

The calls to `/stats`, `/` and `/openapi.json` are free. A search that finds nothing costs nothing.

### Tips

- Use `limit` and `offset` to page through large result sets, 50 bids at a time.
- Combine `state` with `dueWithinDays` to build a daily list of bids that close soon.
- Send several phrases in `q` to cover synonyms, such as `hvac,air conditioning`.
- Read `index.sweepAt` in each answer to know how fresh the data is.

### FAQ and support

**Where does the data come from?** From the portals listed above, collected by a nightly sweep and published as one index.

**Does it return bids that already closed?** No. A bid whose due date is before today is never returned.

**Can I get contact details?** The index holds none. Open the bid's `url` for the contact on the bid's own page.

**Need something else?** Open an issue in the Issues tab.

# Actor input Schema

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

Search phrases. A bid matches when it matches any phrase. A phrase matches when all its words appear in the bid text. Leave empty to match every open bid.

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

Two letter US state codes, for example TX or CA. Leave empty for all states. About half of the SAM.gov bids have no state.

## `sources` (type: `array`):

Only return bids from these portals. Leave empty for all sources.

## `agencyTypes` (type: `array`):

Only return bids from these kinds of agency. Leave empty for all.

## `naics` (type: `array`):

NAICS code prefixes. 5617 matches 561720. Leave empty for all codes.

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

A code such as SBA or 8A matches that code only. Other text matches part of the code or its name, for example small business or HUBZone.

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

Only bids posted in the last N days, from 1 to 365.

## `dueWithinDays` (type: `integer`):

Only bids due in the next N days, from 1 to 365. Bids with no due date are left out when this is set.

## `onlyWithDocumentFacts` (type: `boolean`):

Keep only the bids that carry documentFacts (scope, bonds, insurance and license needs read from the bid documents). Beta.

## `sort` (type: `string`):

relevance ranks by where the keywords match. due puts the soonest due date first. posted puts the newest first.

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

The most bids to return. Each bid returned is charged.

## Actor input object example

```json
{
  "keywords": [
    "janitorial",
    "landscaping"
  ],
  "onlyWithDocumentFacts": false,
  "maxResults": 25
}
```

# Actor output Schema

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

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

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

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "keywords": [
        "janitorial",
        "landscaping"
    ],
    "maxResults": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("talcoe/government-bids-search-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "keywords": [
        "janitorial",
        "landscaping",
    ],
    "maxResults": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("talcoe/government-bids-search-api").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "keywords": [
    "janitorial",
    "landscaping"
  ],
  "maxResults": 25
}' |
apify call talcoe/government-bids-search-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,talcoe/government-bids-search-api"
        }
    }
}
```

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/IMu5mx4QyI9v2qsAk/builds/17pqtu6XRHkT0Xh1c/openapi.json
