# Ma Ocpf Political Finance Delta Monitor (`apex-nexus/ma-ocpf-political-finance-delta-monitor`) Actor

- **URL**: https://apify.com/apex-nexus/ma-ocpf-political-finance-delta-monitor.md
- **Developed by:** [Valunex](https://apify.com/apex-nexus) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

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

## MA OCPF Political Finance / Campaign Disclosure Delta Monitor

Massachusetts campaign finance contributions monitor: watch Massachusetts OCPF
contribution and expenditure disclosure filings and get alerted when new or
amended records appear for the filers you care about. This Apify Actor is an
OCPF filings tracker for MA political contributions — candidates, committees,
PACs, lobbyists and lobbying firms/employers.

### What it does

The Actor polls the official, public Massachusetts OCPF API
(https://api.ocpf.us — "No Authentication Required ... No API keys, no sign-up")
for contribution / expenditure disclosure records in a date window you choose
(default: the last 7 days) and emits one dataset item per newly observed or
amended disclosure record matching your watchlist:

- New records matching a watched filer name / keyword → `changeType: "new"`
- Previously seen records whose content changed (amended filings) → `changeType: "amended"`
- Nothing changed since the last run → no dataset items at all (free when nothing changes)

State is checkpointed per watchlist item in the Actor default key-value store,
so repeat runs only surface genuinely new or amended OCPF filings.

### Search terms this Actor answers

- Massachusetts campaign finance contributions
- OCPF filings tracker
- MA political contributions monitor
- Massachusetts campaign disclosure alert
- OCPF new filings

### Who it is for

Public affairs firms, compliance officers, NGOs, political researchers and
journalists who must track new or amended MA OCPF filings — missed or opaque
disclosures create compliance and reputational exposure.

### Data source

Public Massachusetts government data, keyless, no login, no proxies:
https://api.ocpf.us/developers (49 documented endpoints covering filers,
reports, contributions, expenditures, elections).

This Actor queries `https://api.ocpf.us/search/items?name=...&startDate=...&endDate=...&pageSize=...`
(server-side name / filer-name filters) with deterministic client-side keyword
matching against filer name, donor name, employer and related disclosure fields.
No LLMs, no commercial inference, no credentials, no proxies inside the product.

### Input

See `actor/.actor/input_schema.json`.

- `watchlist` (array of strings, optional, default `[]`): filer names / keywords
  to watch (candidate, committee, lobbyist, lobbying firm, employer). Matching
  is case-insensitive substring. Leave empty to monitor every disclosure record
  in the date window.
- `sinceDays` (integer, 1-365, default 7): how far back to scan.
- `maxResults` (integer, 1-200, default 25): cap of new/amended records per run.

Example input:

```json
{
  "watchlist": ["1199 SEIU MA PAC", "Massachusetts Democratic Party"],
  "sinceDays": 7,
  "maxResults": 25
}
```

### Output

One dataset item per new/amended OCPF disclosure record (see
`actor/.actor/dataset_schema.json`), including record id, report id, filer
name/CPF id, filing date, amount, contributor/employer, tender type, change
type (`new` / `amended`), matched watchlist term and match fields, plus the
OCPF source link.

### Pricing

Published as a free Apify Store listing (no pay-per-event / pricing events).
Actor runs are free; no per-alert charges.

### Verification

- `pytest actor/tests` — deterministic tests, no network (15 tests)
- `ruff check actor/` — 0 errors
- Default input returns >0 dataset items against the live api.ocpf.us
  (evidenced by a real Apify run of the pushed build)

### Distinctness

Massachusetts OCPF campaign finance contribution/expenditure disclosure
monitoring — distinct from FDA recalls, NHTSA vehicle recalls, CPSC product
recalls, CFPB complaints, FSIS recalls and SEC filings monitors. No Apify
Store listing for MA OCPF campaign finance exists.

# Actor input Schema

## `watchlist` (type: `array`):

Massachusetts OCPF filer names or keywords to monitor for new or amended contribution / expenditure disclosure records: candidates, committees, PACs, lobbyists, lobbying firms, employers. Matching is case-insensitive substring against filer name, donor name, employer and related disclosure fields. Leave empty to monitor every disclosure record in the date window.

## `sinceDays` (type: `integer`):

How far back to scan for disclosure records on each run; repeat runs only emit records newer than the last checked state.

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

Cap the number of new or amended disclosure records emitted in a single run.

## Actor input object example

```json
{
  "watchlist": [
    "1199 SEIU MA PAC",
    "Massachusetts Democratic Party"
  ],
  "sinceDays": 7,
  "maxResults": 25
}
```

# Actor output Schema

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

Dataset items filtered by the overview view defined in the dataset schema.

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

All dataset items emitted by the Actor run (newly observed or amended OCPF disclosure records).

# 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 = {
    "watchlist": [
        "1199 SEIU MA PAC",
        "Massachusetts Democratic Party"
    ],
    "sinceDays": 7,
    "maxResults": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("apex-nexus/ma-ocpf-political-finance-delta-monitor").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 = {
    "watchlist": [
        "1199 SEIU MA PAC",
        "Massachusetts Democratic Party",
    ],
    "sinceDays": 7,
    "maxResults": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("apex-nexus/ma-ocpf-political-finance-delta-monitor").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 '{
  "watchlist": [
    "1199 SEIU MA PAC",
    "Massachusetts Democratic Party"
  ],
  "sinceDays": 7,
  "maxResults": 25
}' |
apify call apex-nexus/ma-ocpf-political-finance-delta-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apex-nexus/ma-ocpf-political-finance-delta-monitor"
        }
    }
}
```

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/iaoEKXcYDn4zck9yt/builds/bOYc7UhJiYHZxNaLn/openapi.json
