# City Council & County Agenda Search (`civic-data-tools/meeting-agenda-search`) Actor

Search upcoming and recent city council, county board and commission agendas for keywords or topic presets (data centers, short-term rentals, battery storage, rezoning…). Official public Legistar API, no scraping, no proxies.

- **URL**: https://apify.com/civic-data-tools/meeting-agenda-search.md
- **Developed by:** [Civic Data Tools](https://apify.com/civic-data-tools) (community)
- **Categories:** AI, Automation, Developer tools
- **Stats:** 3 total users, 2 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

## City Council & County Agenda Search

Search public city council, county board, and commission agendas for keywords or topic presets (data centers, short-term rentals, battery storage, rezoning, RFPs…). You get one clean record per matching agenda item, with the meeting date, body, snippet, and links to the official meeting page / agenda file.

It ships two ways from the same core (`src/lib.js`):

| Interface | Entry | Use |
|---|---|---|
| **Apify Actor** (pay-per-event) | `src/main.js`, `.actor/` | Apify Store, and AI agents through `mcp.apify.com` |
| **MCP server** (stdio) | `src/mcp-server.js` | Claude Desktop, Cursor, and any MCP client |
| CLI demo | `src/cli.js` | Local testing |

### Data sources and compliance

See **`sources.md`** for the per-city map.

| Source | How we read it | Scraping? |
|---|---|---|
| **Legistar Web API** (`webapi.legistar.com`) | Official public JSON | No |
| **CivicClerk** (`{host}.api.civicclerk.com`) | Official public OData Events + `GetMeetingFileStream(…,plainText=true)` | No |
| **Granicus** ViewPublisher **RSS** | Official agenda RSS | No (feed only) |
| **Granicus** AgendaViewer **PDF** | Public PDF bytes → `pdf-parse` (or `pdftotext` if installed) | No HTML; official PDF |
| **Granicus** GeneratedAgendaViewer **HTML** | Only if `allowHtmlPublicAgenda=true` | **Yes — labeled `html-public-agenda`** |

Honesty note: earlier versions of this actor said “no HTML scraping” because only Legistar was supported. V0.2 adds CivicClerk and Granicus. HTML parsing is **off by default** and gated by an input flag. Prefer JSON / ICS / RSS / official PDF text whenever a government publishes them.

Requests identify themselves with a User-Agent, run at low concurrency, and insert a short delay. Some Legistar clients need a published API token (`TOKEN_REQUIRED`); pass `tokens: {"<slug>": "<token>"}` if you have one.

### Jurisdiction directory

`data/jurisdictions.json` holds Legistar cities/counties plus Tri-Valley CivicClerk and Granicus entries. Rebuild Legistar candidates with `node scripts/build-directory.mjs`. You can still search any other Legistar client with `"legistar:<slug>"`, or any CivicClerk host with `"civicclerk:<host>"` (e.g. `civicclerk:sanramonca`).

Tri-Valley additions (2026-10-05): San Ramon, Pleasanton (CivicClerk); Dublin, Livermore, Danville (Granicus); Contra Costa County slug **`contra-costa`**; BART; MTC.

Bay Area + LA Legistar expansion (2026-10-05): Cupertino, Sunnyvale (`sunnyvaleca`), Emeryville, Hercules, Napa; Los Angeles County (`lacounty`), Manhattan Beach, Pomona, Redondo Beach (`redondo`); Fullerton, Newport Beach, Costa Mesa, Westminster (`westminsterca`). See `sources.md`.

### Input (Actor and MCP)

```json
{
  "keywords": ["data center"],
  "topics": ["data-centers"],
  "jurisdictions": ["San Ramon, CA", "Dublin, CA", "legistar:seattle"],
  "states": ["CA"],
  "daysBack": 14, "daysAhead": 30,
  "matchMode": "any",
  "bodyFilter": "Planning",
  "maxMeetingsPerJurisdiction": 40, "maxResults": 200,
  "allowHtmlPublicAgenda": false
}
```

`allowHtmlPublicAgenda`: when true, parse public Granicus HTML agendas (Danville and similar). Matches include `sourceMode: "html-public-agenda"`. Default false → RSS title/description only for HTML-only cities, with an `HTML_GATED` error explaining the gap.

### Output

Same shape as before (`demo/actor-sample-item.json`), plus:

- `platform`: `legistar` | `civicclerk` | `granicus`
- `sourceMode` (Granicus): `rss-only` | `pdf` | `html-public-agenda`

Source problems never crash the run. They appear in `OUTPUT.errors` (`UNRESOLVED_JURISDICTION`, `TOKEN_REQUIRED`, `SOURCE_ERROR`, `HTML_GATED`, `PDF_TOOL_MISSING`).

### Pay-per-event charging (Actor)

Unchanged pricing model (do not alter Store prices in this update):

- `agenda-item-match` (**primary**): per matching item
- `meeting-scanned`: per meeting whose agenda was fetched and searched
- Keep `apify-actor-start`; remove `apify-default-dataset-item` in Console so items aren't double-charged

### Run it

```bash
npm install
npm test                      # offline unit tests (mocked APIs)
LIVE=1 npm test               # also live API + MCP round trip
npm run demo                  # CA data-center scan
npm run demo:trivalley        # CivicClerk + Granicus smoke
npm start                     # Actor locally (INPUT.json in storage/)
```

MCP tools: `search_meeting_agendas`, `list_jurisdictions`, `list_topic_presets`.

### Known limits

- PDF full-text inside attached staff reports is not OCR'd beyond Granicus AgendaViewer PDFs and CivicClerk plainText streams.
- School boards (BoardDocs) and some PrimeGov/eScribe cities remain out until a compliant public feed exists — see `sources.md`.
- Legistar / CivicClerk / Granicus data quality varies; agendas can post late.

### Civic Data Tools (related Actors)

Same publisher (`civic-data-tools`) — useful together for agents monitoring local government:

| Actor | Use when | Store |
|---|---|---|
| **Public Bid & RFP Search** | Open government bids/RFPs plus new federal contract awards (official APIs) | [public-bid-search](https://apify.com/civic-data-tools/public-bid-search) |
| **Multi-City Building Permits** | Normalized building permits from large US city open-data portals | [building-permits](https://apify.com/civic-data-tools/building-permits) |

This Actor covers **meeting agendas**. Pair bid search when an agenda item mentions an RFP, and permits when land-use items move into construction.

# Actor input Schema

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

Case-insensitive; whole-word match; spaces also match hyphens. Example: "data center", "rezoning".

## `topics` (type: `array`):

Expands to a curated keyword list.

## `jurisdictions` (type: `array`):

Names like "Seattle, WA", "San Ramon", "Dublin, CA", or raw "legistar:<slug>" / "civicclerk:<host>" for clients not in the directory.

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

Two-letter codes, e.g. CA, WA.

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

How many days in the past to search (0-120).

## `daysAhead` (type: `integer`):

How many days ahead to search for upcoming meetings (0-120).

## `dateFrom` (type: `string`):

YYYY-MM-DD

## `dateTo` (type: `string`):

YYYY-MM-DD. Max window 120 days.

## `matchMode` (type: `string`):

"any" matches items containing any keyword; "all" requires every keyword.

## `bodyFilter` (type: `string`):

e.g. "Planning" or "City Council".

## `maxMeetingsPerJurisdiction` (type: `integer`):

Upper limit of meetings scanned per jurisdiction.

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

Stop after this many matching agenda items.

## `allowHtmlPublicAgenda` (type: `boolean`):

When true, parse public Granicus GeneratedAgendaViewer HTML for cities whose AgendaViewer is HTML-only (e.g. Danville). Default false: those cities search RSS titles/descriptions only. Prefer official JSON/ICS/RSS/PDF. Clearly labeled html-public-agenda in results.

## Actor input object example

```json
{
  "keywords": [
    "data center"
  ],
  "jurisdictions": [
    "San Ramon, CA",
    "Dublin, CA",
    "Oakland, CA"
  ],
  "daysBack": 14,
  "daysAhead": 30,
  "matchMode": "any",
  "maxMeetingsPerJurisdiction": 40,
  "maxResults": 200,
  "allowHtmlPublicAgenda": false
}
```

# Actor output Schema

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

Dataset of agenda items that matched your keywords or topics.

# 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": [
        "data center"
    ],
    "jurisdictions": [
        "San Ramon, CA",
        "Dublin, CA",
        "Oakland, CA"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("civic-data-tools/meeting-agenda-search").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": ["data center"],
    "jurisdictions": [
        "San Ramon, CA",
        "Dublin, CA",
        "Oakland, CA",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("civic-data-tools/meeting-agenda-search").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": [
    "data center"
  ],
  "jurisdictions": [
    "San Ramon, CA",
    "Dublin, CA",
    "Oakland, CA"
  ]
}' |
apify call civic-data-tools/meeting-agenda-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,civic-data-tools/meeting-agenda-search"
        }
    }
}
```

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/L5pOpy6GmZCWCE07F/builds/fdmdKMzJUtrJPUap3/openapi.json
