# Massachusetts COMMBUYS Bids Scraper with UNSPSC Codes (`talcoe/massachusetts-commbuys`) Actor

Scrape open Massachusetts state and municipal bids from COMMBUYS with UNSPSC codes, buyer, organization and opening date; filter by keyword, organization and date, pay per result.

- **URL**: https://apify.com/talcoe/massachusetts-commbuys.md
- **Developed by:** [M Usama](https://apify.com/talcoe) (community)
- **Categories:** Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.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/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 Massachusetts COMMBUYS Bids Scraper do?

It collects open bids from COMMBUYS, the Massachusetts state procurement portal used by state agencies, cities, towns, schools and public authorities. Each record has the bid number, title, buying organization, opening (due) date, buyer name and email, UNSPSC codes with descriptions, the full bid description, posting date and attachment names. Filters keep runs small, and pricing is per result.

### Data source

The public COMMBUYS open bids search at commbuys.com/bso, read without a login, plus each bid's public detail page. Data is live, so every run reflects what is open today.

### Why use it?

- Lead generation for contractors and vendors: find new Massachusetts bids by keyword and UNSPSC category the day they post.
- Monitoring: schedule a daily run and send new bids to Slack, email or a sheet.
- Market research: see which towns and agencies buy what, and when bids open.
- It replaces manual clicking through the portal search and paged result tables.

### How to use it

1. Open the Actor and set the filters.
2. Click Start. Download results as JSON, CSV or Excel, or read them through the API.
3. Add a Schedule and an Integration (Slack, Google Sheets, webhook) to get new records automatically.

### Input

| Field | Description |
|---|---|
| `keywords` | Search bid descriptions for each keyword (for example road, janitorial). Empty lists all open bids. |
| `organization` | Keep only bids whose organization contains this text (for example Town of, College). |
| `dueDateFrom` / `dueDateTo` | Keep only bids opening within this date window (YYYY-MM-DD). |
| `fetchDetails` | Open each bid page for UNSPSC codes, description, buyer email and posting date. On by default. |
| `maxResults` | Hard stop for the run. You are billed per result, so this caps the cost. |
| `proxyConfiguration` | Apify proxy is recommended for larger runs. |

Example input:

```json
{
    "keywords": ["road"],
    "organization": "Town of",
    "dueDateFrom": "2026-11-01",
    "maxResults": 50
}
```

### Output

Every record has the same shape:

```json
{
    "id": "BD-27-1348-PD34-PD45-134756",
    "bidNumber": "BD-27-1348-PD34-PD45-134756",
    "title": "RFQ General and FSB Contractor for New Dispatch Facility",
    "agency": "Town of Westborough",
    "dueDate": "2026-11-04T13:00:00",
    "status": "Sent",
    "buyer": "Katelyn Barker",
    "alternateId": null,
    "url": "https://www.commbuys.com/bso/external/bidDetail.sda?docId=BD-27-1348-PD34-PD45-134756&external=true",
    "description": "Renovation of a two-story structure, with basement, located at 20 Phillips Street in Westborough, MA...",
    "postedDate": "2026-10-23T11:13:00",
    "department": "PD34 - Police Department",
    "bidType": "OPEN",
    "purchaseMethod": "Open Market",
    "typeCode": "NS - Non-Statewide Solicitation",
    "buyerEmail": null,
    "allowElectronicQuote": true,
    "unspscCodes": ["72-13-00"],
    "unspscDescriptions": ["General building construction"],
    "attachments": ["Legal Ad_RECC"],
    "scrapedAt": "2026-10-26T08:43:10.531Z"
}
```

| Field | Meaning |
|---|---|
| `id` / `bidNumber` | Stable COMMBUYS bid number, safe for deduplication between runs |
| `title` | Bid title from the listing |
| `agency` | Buying organization |
| `dueDate` | Bid opening date and time in Massachusetts local time (the portal gives no time zone) |
| `status` | Portal status; open bids show as Sent |
| `buyer`, `buyerEmail` | Purchaser name and the info contact email when the bid publishes one |
| `unspscCodes`, `unspscDescriptions` | UNSPSC categories on the bid items |
| `postedDate` | When the bid became available |

### Pricing

Pay per event: a small fee when a run starts, then a fixed price per result returned. You only pay for records that pass your filters. Set `maxResults` to cap any run.

### Limitations

- Only open bids are listed. Awarded and closed bids, blankets and contracts are not included.
- The portal search is plain text on bid descriptions, so a keyword only matches words in that field. Item level UNSPSC filtering is not offered by the portal; filter the `unspscCodes` column after the run.
- Bid documents are listed by name only. Downloads need a COMMBUYS login.
- Turning off `fetchDetails` is faster but leaves out UNSPSC codes, description, buyer email and posting date.

### FAQ

**Is this legal?** The Actor reads listings the site publishes for any visitor without a login and stores only business information published for that purpose. You are responsible for how you use the data.

**Something is missing or broken?** Open an issue in the Issues tab; response time is usually under a day.

# Actor input Schema

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

Search bid descriptions for each keyword (for example road, software, janitorial). Leave empty to list all open bids.

## `organization` (type: `string`):

Only keep bids whose buying organization contains this text (for example Town of, Department of Transportation, College).

## `dueDateFrom` (type: `string`):

Only keep bids opening on or after this date (YYYY-MM-DD).

## `dueDateTo` (type: `string`):

Only keep bids opening on or before this date (YYYY-MM-DD).

## `fetchDetails` (type: `boolean`):

Open each bid page to add UNSPSC codes, full description, buyer email, department and posted date. Slower but richer.

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

Hard stop for the run. You are billed per result, so this caps the cost.

## `proxyConfiguration` (type: `object`):

Apify proxy is recommended for larger runs.

## Actor input object example

```json
{
  "keywords": [],
  "fetchDetails": true,
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

# API

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

## JavaScript example

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

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

// Prepare Actor input
const input = {
    "keywords": [],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("talcoe/massachusetts-commbuys").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": [],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("talcoe/massachusetts-commbuys").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": [],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call talcoe/massachusetts-commbuys --silent --output-dataset

```

## MCP server setup

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

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/wHmihhmCdcldX3JdT/builds/z52siPDiUi3IFTnXZ/openapi.json
