# California Grant Deadline Change Watch (`nexgenwatch/us-ca-grant-deadline-change-watch`) Actor

Application deadlines moving on California Grants Portal listings - including a grant that had no fixed deadline acquiring one.

- **URL**: https://apify.com/nexgenwatch/us-ca-grant-deadline-change-watch.md
- **Developed by:** [NexGen Watch](https://apify.com/nexgenwatch) (community)
- **Categories:** Business, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $134.00 / 1,000 deadline-change deltas

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## California Grant Deadline Change Watch

Application deadlines moving on California Grants Portal listings - including a grant that had no fixed deadline acquiring one.

### Source

California Grants Portal, published as a daily CSV on data.ca.gov (public, logged-out)

- `https://data.ca.gov/dataset/california-grants-portal`

Measured 2026-07-28: **1,973 rows, 36 columns**, resource last updated 2026-07-27 08:01.
`PortalID` is the source-native key and is **unique — 1,973 distinct of 1,973**. The whole file
is read every run, so a listing that disappears really has gone; there is no sliding window.

### The deadline is not always a date

`ApplicationDeadline` carries **three** shapes, measured on the live file:

| shape | rows |
|---|---|
| a timestamp, `2026-09-01 23:59:00` | 1,845 |
| the literal string **`Ongoing`** | **127** — every one an active grant |
| empty | 1 |

So the deadline is signed as **the source's own string**, and a separate
`application_deadline_iso` field is populated **only** when the source actually gave a date —
`null` for `Ongoing`. A grant moving from `Ongoing` to a real date therefore reports as
*acquiring a deadline*, not as a date change and not as a parse failure.

### The small-business slice is a filter, not another Actor

`applicant_types: ["Business"]` — 477 of 1,973 rows on 2026-07-28. The source lists several
types per row separated by `;`, so matching is substring and case-insensitive. Other tokens:
Public Agency 1,557, Nonprofit 1,309, Tribal Government 959, Individual 375, Other Legal
Entity 146.

### Pricing

Pay-per-event on the ratified four-tier ladder (FREE → GOLD, with Platinum and Diamond floored
at the Gold rate). Apify applies its own plan discount on top.

| Event | FREE | BRONZE | SILVER | GOLD |
|---|---|---|---|---|
| Actor start (`apify-actor-start`) | $0.02 | $0.02 | $0.02 | $0.02 |
| Source check (`source-check`) | $0.10 | $0.09 | $0.08 | $0.067 |
| Deadline-change delta (`ca-grant-delta`) | $0.20 | $0.18 | $0.16 | $0.134 |

`source-check` is charged **once per run**, after the source enumeration terminates — seed runs
and no-change runs included. It is **not** charged when the source refused the read.

`ca-grant-delta` is charged **per emitted delta**, in watch mode only. Seed runs and no-change runs
charge nothing here.

`apify-actor-start` is the platform's reserved event, never charged in this code. The Actor is
clamped to **1024 MB on both settings**, so it is charged exactly **once** per run — the
platform bills it once per gigabyte of run memory.

### Snapshot mode is a PREVIEW

`watch_mode: false` returns at most **25 records**, hard-capped in code, labelled
`output_mode: "preview"`. This Actor sells change detection, not bulk export.

### Watch semantics

The first watch run stores a private baseline and emits **zero** deltas. Later runs emit
`NEW` / `CHANGED` keyed on `PortalID`, with `before` / `after` and `changed_fields`. Billed
deltas are capped at 500 per run; the overflow is a named PARTIAL withholding, never billed,
and re-detected on the next run.

### One delta type per Actor

This Actor emits **`deadline-change`** and nothing else. Its sibling reads the same file for the other
slice, each with its own baseline and its own price.

### Terminal states

`NORMAL` · `SUCCEEDED-0: GENUINE_EMPTY` · `SUCCEEDED-0` (no change) · `PARTIAL` · `BLOCKED`.
A zero with no evidence FAILS loud rather than exiting 0 quietly.

**A file that arrives and does not parse BLOCKS.** It is never reported as an empty source.
The portal serves this CSV with a UTF-8 byte-order mark; on build 0.1.2 that made every
`PortalID` lookup miss, so a 6,401,507-byte read parsed to zero rows and the run announced
`GENUINE_EMPTY` about a file holding 1,973 live grants. Since 0.1.3 the mark is stripped, the
key column is checked by name, and a large body that yields no rows fails the run loudly
naming what arrived. An outage you can see beats an emptiness you cannot.

# Actor input Schema

## `statuses` (type: `array`):

Filter to the portal's own Status values. Measured 2026-07-28: active 177, closed 1795, forecasted 1. Leave empty for every row in the file.

## `applicant_types` (type: `array`):

Filter on the source's own ApplicantType tokens - Public Agency, Nonprofit, Tribal Government, Business, Individual, Other Legal Entity. THE SMALL-BUSINESS SLICE IS THIS FILTER: pass \["Business"] (477 of 1,973 rows on 2026-07-28). Matching is substring and case-insensitive because a row lists several types separated by ';'.

## `agency_contains` (type: `string`):

Keep only rows whose AgencyDept contains this text. Case-insensitive.

## `max_items` (type: `integer`):

Hard cap on rows kept after filtering. The whole daily CSV is ~1,973 rows, so the default reads all of it; lower it only to bound a trial run.

## `watch_mode` (type: `boolean`):

On: emit CHANGES against a stored baseline (the product). Off: a labelled PREVIEW of at most 25 records, which is not an export path.

## `baseline_id` (type: `string`):

Names the stored baseline. Use different ids to watch different filter combinations independently without their baselines colliding.

## Actor input object example

```json
{
  "statuses": [
    "active"
  ],
  "applicant_types": [],
  "agency_contains": "",
  "max_items": 200,
  "watch_mode": true,
  "baseline_id": "default"
}
```

# 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 = {
    "statuses": [
        "active"
    ],
    "applicant_types": [],
    "agency_contains": "",
    "max_items": 200,
    "watch_mode": false,
    "baseline_id": "default"
};

// Run the Actor and wait for it to finish
const run = await client.actor("nexgenwatch/us-ca-grant-deadline-change-watch").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 = {
    "statuses": ["active"],
    "applicant_types": [],
    "agency_contains": "",
    "max_items": 200,
    "watch_mode": False,
    "baseline_id": "default",
}

# Run the Actor and wait for it to finish
run = client.actor("nexgenwatch/us-ca-grant-deadline-change-watch").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 '{
  "statuses": [
    "active"
  ],
  "applicant_types": [],
  "agency_contains": "",
  "max_items": 200,
  "watch_mode": false,
  "baseline_id": "default"
}' |
apify call nexgenwatch/us-ca-grant-deadline-change-watch --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nexgenwatch/us-ca-grant-deadline-change-watch"
        }
    }
}

```

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/tudZh2pu3AEpt4Sg3/builds/1J2kta0OUT24yFdtc/openapi.json
