# Socrata Dataset Schema Change Monitor (`quietdatatools/socrata-dataset-schema-change-monitor`) Actor

Monitor public Socrata dataset schemas for API column renames, type changes, additions and removals. Stable column IDs, exact previous/current metadata, required-field checks and persistent history. No dataset row download.

- **URL**: https://apify.com/quietdatatools/socrata-dataset-schema-change-monitor.md
- **Developed by:** [QuietDataTools](https://apify.com/quietdatatools) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 successful schema checks

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

## Socrata Dataset Schema Change Monitor

Keep public-data pipelines aware of API column renames, type changes and removals. Give this Actor a public Socrata portal hostname and dataset ID. It checks column metadata, saves a baseline, and returns exact previous/current schema values on later checks. It does not download dataset rows.

Designed for civic data pipelines, journalists maintaining recurring datasets, and analysts integrating government open data into spreadsheets or warehouses. Unlike a row exporter, this Actor monitors the contract those exports depend on.

### Quick start

```json
{"domain":"data.cityofnewyork.us","datasetId":"43nn-pn8j","monitorName":"default","requiredFields":[],"includeUnchanged":true}
```

The default checks NYC restaurant inspection metadata. Use a distinct monitorName for an independent baseline. Schedule the same input for periodic checks. Run only one check at a time for each monitor.

### Output

BASELINE, ADDED, CHANGED, REMOVED and optional UNCHANGED rows contain columnId, fieldName, dataType, displayName, changes, previous, current and sourceUrl. Matching uses Socrata column IDs: a rename keeps its identity; a replacement ID is reported as removal plus addition. API name/type changes and removals have compatibilityRisk REVIEW_REQUIRED. This is a review signal, not proof your particular query breaks. Display-label changes are distinguished from API names.

OUTPUT in the run key-value store includes counts, previousCheckedAt, checkedAt, columnCount, requiredFieldsSatisfied and missingRequiredFields. Required fields are exact API names, not display labels. Missing required fields remain visible even on baseline. A successful metadata fetch with missing required fields still costs one check.

### Pricing

$0.01 per successful schema check, including baseline and unchanged checks, with platform usage included. No startup or per-column charge. Failed source checks are not charged and preserve the last good schema. Set a run charge cap and bounded timeout.

### Boundaries

Public unauthenticated tabular Socrata metadata only; no credentials, private data or row download. HTTPS, public IPs, 20-second source deadline, 2MB response cap, up to500 columns, up to100 required names. Does not validate row values, data freshness, query results, geometry payloads, derived-view correctness, nullability or complete compatibility. Mutable cached row statistics and column ordering are ignored. Column metadata is the portal's representation and can lag actual publication.

A malformed, empty or mismatched metadata response fails without treating it as column removal. Genuine removals are reported after one complete successful metadata response. State is isolated by Apify user, Actor, portal, dataset and monitor name. Keep one concurrent run: the best-effort lease is not an atomic distributed lock. Output then billing then state commit provides at-least-once behavior: interruption can repeat output or a charge on retry. Different monitor names create different baselines; no reset/deletion operation is offered.

Independent tool, not affiliated with Tyler Technologies/Socrata or the source agency. Respect each portal's terms and API rate limits. No profitability or zero-error guarantee.

# Actor input Schema

## `domain` (type: `string`):

Public Socrata hostname without https or path.

## `datasetId` (type: `string`):

Four-by-four public dataset identifier.

## `monitorName` (type: `string`):

Use the same name for persistent history; one concurrent run per monitor.

## `requiredFields` (type: `array`):

Exact API column names that must appear in declared schema.

## `includeUnchanged` (type: `boolean`):

Include unchanged columns. Baseline and unchanged checks are charged.

## Actor input object example

```json
{
  "domain": "data.cityofnewyork.us",
  "datasetId": "43nn-pn8j",
  "monitorName": "default",
  "requiredFields": [],
  "includeUnchanged": true
}
```

# Actor output Schema

## `columns` (type: `string`):

No description

## `summary` (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 = {
    "domain": "data.cityofnewyork.us",
    "datasetId": "43nn-pn8j"
};

// Run the Actor and wait for it to finish
const run = await client.actor("quietdatatools/socrata-dataset-schema-change-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 = {
    "domain": "data.cityofnewyork.us",
    "datasetId": "43nn-pn8j",
}

# Run the Actor and wait for it to finish
run = client.actor("quietdatatools/socrata-dataset-schema-change-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 '{
  "domain": "data.cityofnewyork.us",
  "datasetId": "43nn-pn8j"
}' |
apify call quietdatatools/socrata-dataset-schema-change-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,quietdatatools/socrata-dataset-schema-change-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/HrF0z5gFC88SI5CLZ/builds/7fi1IyWbyuSBUFfFX/openapi.json
