# NYC City Record Facility Bids - Trade Alerts (`bidsweep/nyc-facility-bids`) Actor

NYC City Record procurement notices from the official NYC Open Data API, classified by facility-services trade (janitorial, HVAC, elevator, snow, landscaping, pest, security...). Filter by trade, agency, notice type and date; alerts on new and changed notices and addenda.

- **URL**: https://apify.com/bidsweep/nyc-facility-bids.md
- **Developed by:** [Miguel Buckenmeyer](https://apify.com/bidsweep) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## NYC City Record Facility Bids – Trade Alerts

Get New York City procurement notices for **facility-services contractors**, already sorted by trade and checked for changes. Notices come straight from the City's official open data.

If you do janitorial, HVAC, elevator, fire-alarm and sprinkler, landscaping, pest control, security guard, snow removal, waste hauling, plumbing, roofing or general building maintenance work, this Actor reads every procurement notice the City publishes in *The City Record*. It keeps the ones for your trade and tells you what is **new or changed** since your last run.

### What you get

- **Trade tags on every notice.** A notice can have more than one trade. The 14 trades are janitorial, building, grounds, pest, hvac, roofing, plumbing, electrical, fire, snow, security, elevator, waste and window. Each tag comes with the reason it was applied (the keyword that matched), so you can see why a notice was tagged.
- **Filters** by trade, agency, notice type, category, publication date, due date and keyword.
- **Change detection** (alert mode). Each notice is marked `new`, `changed` (the changed fields are listed: due date, title, amount, description, documents…) or `addendum`. A notice counts as an addendum when it is a correction, bid extension, re-ad or cancellation, or when the same agency re-publishes a notice under an existing PIN. Re-published notices are linked to the earlier notice through `relatedRequestIds`.
- **Clean fields**, including the agency, PIN, selection method, due date, days until due, contract amount (for awards and intents to award), awarded vendor (businesses only), the description as plain text, and a link to the official notice on City Record Online.

### Typical uses

| Goal | Input |
|---|---|
| Open elevator & HVAC bids | `{"trades":["elevator","hvac"],"noticeTypes":["Solicitation"]}` |
| Daily alert for NYCHA facility work | `{"agencies":["Housing Authority"],"onlyNewOrChanged":true}`, scheduled daily |
| Who won janitorial/security contracts this year | `{"trades":["janitorial","security"],"noticeTypes":["Award"],"daysBack":365}` |
| Bids due in December | `{"noticeTypes":["Solicitation"],"dueAfter":"2026-12-01","dueBefore":"2026-12-31"}` |

#### Setting up alerts

1. Choose your filters and turn on **Only new or changed notices**.
2. Run it once. The first run quietly records a baseline of what is already published and outputs nothing.
3. Schedule it daily. Each later run outputs only notices that are new, changed or addenda.
   To keep separate alert streams (one per saved search), give each one its own **State store name**.

### Output example

```json
{
  "requestId": "20261008021", "agency": "Housing Authority", "noticeType": "Solicitation",
  "title": "VISUAL INSPECTION OF FIRE STANDPIPE AND SPRINKLER SYSTEMS",
  "trades": ["fire"], "tradeLabels": ["Fire & life-safety inspection"],
  "selectionMethod": "Request for Quote", "dueDate": "2026-11-10T14:00:00.000", "daysUntilDue": 25,
  "changeType": "changed", "changedFields": ["due_date"],
  "noticeUrl": "https://a856-cityrecord.nyc.gov/RequestDetail/20261008021"
}
```

See the `samples/` folder for complete runs.

### Pricing (pay per event)

- **Notice result**: $0.005 for each notice written to your dataset ($5 per 1,000).
- **New or changed match**: an extra $0.02 for each notice that is new, changed or an addendum since your previous run. The baseline run never charges this.
  To cap your spend, set **Max results** or a maximum charge on the run. A typical daily alert run returns 0–5 notices.

### Sources & terms

- The data comes from **NYC Open Data, "City Record Online" (dataset `dg92-zbpx`)**, read through the official Socrata SODA API. The dataset license is **Public Domain**.
- The portal's robots.txt allows the `/resource/` API and blocks only browse facets and a few internal paths. It sets `Crawl-delay: 1`, so the Actor waits at least 1 s between API pages.
- The NYC Open Data and NYC.gov terms of use cover lawful use without disrupting City servers. This Actor runs a small number of paginated queries per run.
- The Actor does **not** scrape City Record Online web pages. It only links to them.
- **The agency's official notice always controls.** Always check due dates, addenda and documents on the official notice or in PASSPort before you bid.

### Privacy

Only public, non-personal business data is output.

- Contact names, phone numbers, fax numbers, emails and "address to request" are **never requested** from the API.
- Emails and phone numbers inside descriptions are replaced with `[email removed]` and `[phone removed]`. Names after "Contact:", "Attn:" and similar phrases become `[name removed]`.
- Vendor names that don't look like a business (no LLC, Inc, Corp, Services…) are withheld, and `vendorNameWithheld` is set to true.

### How the trade tags work

Trades are tagged from the notice title using keyword rules. The rules are reused from BidSweep's facility-services classifier and extended with NYC wording, and they exclude goods purchases, capital construction and design, consulting and software. When a short title matches nothing, the start of the description is checked as well. This is a rules-based classifier, not a guarantee. Use `includeUnclassified` to see everything.

### Limitations

- City Record has no commodity codes (NIGP/NAICS), so tagging is based on keywords. Expect some misses and false positives, for example roof *replacement* capital projects tagged as roofing.
- Change detection compares notices only within the date window you query. If you widen the filters later, older matching notices show up as `new`.
- Addendum linking needs a PIN. Some notices, such as many NYCHA ones, have no PIN and are linked only by their title prefix (Correction, Bid Extension, …).
- The source dataset is refreshed daily by the City.

# Actor input Schema

## `trades` (type: `array`):

Facility-services trades to include. Leave empty for all facility trades. A notice can match several trades. Values: janitorial, building, grounds, pest, hvac, roofing, plumbing, electrical, fire, snow, security, elevator, waste, window.

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

City Record notice types to include, e.g. Solicitation, Intent to Award, Award, Vendor List. Default: Solicitation and Intent to Award. An empty list means all types.

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

Agency name filter (case-insensitive substring), e.g. 'Housing Authority', 'Parks', 'Environmental Protection'. Empty means all agencies.

## `categories` (type: `array`):

Exact City Record categories, e.g. 'Services (other than human services)', 'Construction/Construction Services', 'Construction Related Services'. Empty means all. Pure 'Goods' notices are never trade-classified.

## `daysBack` (type: `integer`):

Only notices whose City Record publication date is within this many days.

## `dueAfter` (type: `string`):

Only notices with a response due date on or after this date (YYYY-MM-DD). Overrides 'Open solicitations only'.

## `dueBefore` (type: `string`):

Only notices with a response due date on or before this date (YYYY-MM-DD).

## `openOnly` (type: `boolean`):

When only Solicitation notices are selected, drop ones whose due date has already passed.

## `keyword` (type: `string`):

Optional extra keyword that must appear in the title or description (case-insensitive).

## `includeUnclassified` (type: `boolean`):

Also output notices that match no facility trade (charged as normal results). Usually off.

## `onlyNewOrChanged` (type: `boolean`):

Output only notices that are new, changed (due date, title, amount, description...) or look like an addendum/correction/extension since the previous run with the same state store. The first run only records a baseline and outputs nothing in this mode.

## `stateStoreName` (type: `string`):

Named key-value store that remembers notices between runs for change detection. Use a different name per saved search if you want separate alert streams.

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

Hard cap on dataset items (and therefore on charges) per run.

## `socrataAppToken` (type: `string`):

Optional free NYC Open Data app token for higher rate limits. Not needed for normal use.

## `requestDelaySecs` (type: `number`):

Pause between paginated API calls. Default 1 s honors the portal's robots.txt Crawl-delay.

## Actor input object example

```json
{
  "trades": [],
  "noticeTypes": [
    "Solicitation",
    "Intent to Award"
  ],
  "daysBack": 30,
  "openOnly": true,
  "includeUnclassified": false,
  "onlyNewOrChanged": false,
  "stateStoreName": "nyc-facility-bids-state",
  "maxItems": 200,
  "requestDelaySecs": 1
}
```

# Actor output Schema

## `overview` (type: `string`):

Trade-classified notices (agency, type, title, trades, due date, change type, City Record link).

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

Counts of scanned, matched, output and new/changed notices.

# 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 = {
    "noticeTypes": [
        "Solicitation",
        "Intent to Award"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bidsweep/nyc-facility-bids").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 = { "noticeTypes": [
        "Solicitation",
        "Intent to Award",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("bidsweep/nyc-facility-bids").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 '{
  "noticeTypes": [
    "Solicitation",
    "Intent to Award"
  ]
}' |
apify call bidsweep/nyc-facility-bids --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bidsweep/nyc-facility-bids"
        }
    }
}
```

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/VVTi1ZXKIfUQkuhhk/builds/M2J1HVZUOXufYl17Q/openapi.json
