# Checkbook NYC Contracts Scraper: City Vendors & Agencies (`talcoe/checkbook-nyc-contracts`) Actor

Scrape New York City government contracts by agency, vendor, purpose, amount and start date, with spend to date and M/WBE status, billed per result.

- **URL**: https://apify.com/talcoe/checkbook-nyc-contracts.md
- **Developed by:** [M Usama](https://apify.com/talcoe) (community)
- **Categories:** Business
- **Security:** Limited permissions
- **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 Checkbook NYC Contracts Scraper do?

Returns New York City government contracts from Checkbook NYC, the city comptroller's public spending portal. Each record has the vendor, contracting agency, purpose, current and original amount, spend to date, start and end dates, contract type, award method, industry and M/WBE category. Filter by purpose keyword, agency, start date window and contract amount so runs stay small. Pricing is per result.

### Data source

The public Checkbook NYC XML API at checkbooknyc.com/api, queried anonymously. Data is as fresh as the city's own publication, typically updated daily.

### Why use it?

- Lead generation for city vendors: find who holds contracts in your category, how large they are and when they expire.
- Rebid tracking: filter by end date window to see contracts approaching renewal.
- Competitor research: see which agencies buy from which vendors and at what size.
- M/WBE and small business prospecting: every record carries the vendor's M/WBE category.
- Replaces manual browsing of the portal and spreadsheet exports.

### 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` | Words matched against the contract purpose. One search per keyword. Empty means all. |
| `agencyCodes` | Limit to city agencies chosen from a list. Empty means all. |
| `startDateFrom` / `startDateTo` | Contract start date window, YYYY-MM-DD. |
| `minAmount` / `maxAmount` | Current contract amount range in USD. |
| `status` | `registered` (approved) or `pending`. |
| `includeSubVendors` | Also return one extra record per subcontractor. Default off. |
| `maxResults` | Hard stop for the run. You are billed per result, so this caps the cost. |
| `proxyConfiguration` | Optional. The API works without a proxy. |

Example input:

```json
{ "keywords": ["software"], "startDateFrom": "2025-01-01", "minAmount": 100000, "maxResults": 50 }
```

### Output

Every record has the same shape:

```json
{
  "id": "MA104020279775680",
  "contractId": "MA104020279775680",
  "vendor": "MCGRAW HILL LLC",
  "agency": "Department of Education",
  "purpose": "Educational software",
  "currentAmount": 773200,
  "originalAmount": 773200,
  "spentToDate": 191951.71,
  "startDate": "2026-09-01",
  "endDate": "2027-08-31",
  "registrationDate": "2026-07-31",
  "contractType": "DEPT OF ED-REQUIREMENT CONTRACT",
  "awardMethod": "RENEWAL OF CONTRACT",
  "industry": "Goods",
  "mwbeCategory": "Non-M/WBE",
  "pin": "R1412",
  "version": 2,
  "womanOwned": false,
  "emergingBusiness": false,
  "vendorRecordType": "Prime Vendor",
  "scrapedAt": "2026-10-17T08:33:02.962Z"
}
```

| Field | Meaning |
|---|---|
| `id` | Stable key (contract id), safe for deduplication between runs |
| `vendor`, `agency`, `purpose` | Who holds the contract, who buys, and what for |
| `currentAmount`, `originalAmount`, `spentToDate` | Dollar values |
| `startDate`, `endDate`, `registrationDate` | ISO dates |
| `contractType`, `awardMethod`, `industry` | Classification from the city |
| `mwbeCategory` | Minority and women owned business category of the vendor |

### 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

- Covers expense contracts only, not revenue or other contract categories.
- Vendor name is not a server side filter in the city API. Use purpose keywords, agency and amount filters instead.
- Agency list covers the main city agencies. Others can be added on request.
- Subcontractor fields are filled only when `includeSubVendors` is on and the contract reports them.

### 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`):

Return contracts whose purpose text contains any of these words (one search per keyword). Leave empty for all contracts.

## `agencyCodes` (type: `array`):

Limit to these city agencies. Leave empty for all agencies.

## `startDateFrom` (type: `string`):

Only contracts starting on or after this date (YYYY-MM-DD).

## `startDateTo` (type: `string`):

Only contracts starting on or before this date (YYYY-MM-DD). Optional.

## `minAmount` (type: `integer`):

Only contracts with a current amount at or above this value.

## `maxAmount` (type: `integer`):

Only contracts with a current amount at or below this value. Optional.

## `status` (type: `string`):

Registered contracts are approved and active. Pending contracts are awaiting registration.

## `includeSubVendors` (type: `boolean`):

Also return one extra record per subcontractor on contracts that report them.

## `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": [
    "software"
  ],
  "startDateFrom": "2025-01-01",
  "minAmount": 100000,
  "status": "registered",
  "includeSubVendors": false,
  "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": [
        "software"
    ],
    "startDateFrom": "2025-01-01",
    "maxResults": 50,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("talcoe/checkbook-nyc-contracts").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": ["software"],
    "startDateFrom": "2025-01-01",
    "maxResults": 50,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("talcoe/checkbook-nyc-contracts").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": [
    "software"
  ],
  "startDateFrom": "2025-01-01",
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call talcoe/checkbook-nyc-contracts --silent --output-dataset

```

## MCP server setup

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

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/KmwieoUhxDghBRFLN/builds/jbwahdIlRPpWvVUWm/openapi.json
