# Open Data Portals Dataset Catalog (Socrata) (`plain-build/open-data-portals-scraper`) Actor

Dataset metadata from Socrata's US catalog of open data portals; turn on Only new datasets for daily runs. Search by keyword and portal (data.cityofnewyork.us), 10 datasets by default: title, publisher, category, tags, license, dates, columns, views, downloads, link. No dataset rows. No key.

- **URL**: https://apify.com/plain-build/open-data-portals-scraper.md
- **Developed by:** [Plain Build](https://apify.com/plain-build) (community)
- **Categories:** Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.28 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Open Data Portals Dataset Catalog (Socrata)

This open data portals scraper returns the dataset catalog of Socrata open data portals, the platform behind data.cityofnewyork.us, data.wa.gov and hundreds of other North American city, county, state and agency portals. Search by words and portal; each row is one dataset with its title, publisher, category, tags, licence, update dates, columns, views, downloads and link. No login, no key. USD 1.50 per 1,000 results (USD 1.28 on Silver and above); errors and empty runs are not charged.

### What it does

The dataset catalog of North American Socrata open data portals (US cities, states and agencies such as data.cityofnewyork.us) by keyword and portal: title, publisher, category, tags, licence, update dates, columns, views, downloads, link. Metadata only, not the rows. No key.

The data comes from Socrata Discovery through its official API (https://dev.socrata.com/docs/other/discovery). This Actor is not affiliated with, endorsed by or sponsored by Socrata Discovery. It reads only that API, at most 2 requests at a time, and it checks robots.txt before the first request to each host.

### Who it is for

- Data journalists and researchers: find every dataset a city or state publishes on a topic, with its update date and a link, before you download one.
- Civic tech and GovTech teams: monitor which portals publish new datasets on permits, inspections, budgets or 311 requests, on a schedule.
- Data engineers: build an index of open datasets by portal, category and columns to pick sources for a pipeline.
- Analysts comparing cities: one table of the datasets several portals offer, with views and downloads as a signal of use.

### Key features

- One search across every North American Socrata portal, or only the portals you name
- Columns include title, description, portal, publisher, category, tags, licence, created and updated dates, data update date, column names, views and downloads
- Only-new-datasets option: with new_since_last_run on, only datasets not delivered before for the same search are delivered and charged
- Newest update first, 1,000 datasets a request
- No login, no key; the official Discovery API only, at most 2 requests at a time
- No owner, creator or contact email in the output

### How it works

The Actor calls the official Socrata Discovery API at api.us.socrata.com/api/catalog/v1, which lists the public dataset catalog of the Socrata open data portals in North America (portals elsewhere are in Socrata's EU catalog, which this version does not read). It sends your search words and portal domains, asks for datasets only, newest update first, and reads 1,000 datasets a page. It returns the catalog record of each dataset, not the dataset's rows. Owner and creator accounts, contact emails and portal-specific metadata are never read into the output, and the free-text fields are cleaned the same way as all free text. The API serves this sorted order for the first 10,000 datasets of a search; past that the Actor writes an uncharged error item that says to narrow the search.

### How to try it

1. Open the Input tab. The prefilled input returns the 25 most recently updated New York City datasets about building permits.
2. Click Start. A run usually finishes in under a minute.
3. Open the Output tab to see the results as a table, or export them as JSON, CSV or Excel.

Datasets come newest update first. To follow new datasets, schedule a daily run with `new_since_last_run` on. A dataset you got before is not delivered again when it is updated; turn the option off to get the current metadata of all.

- Each combination of `query` and `domains` has its own memory.
- The memory is a key-value store named `open-data-portals-scraper-state` in your account. Delete it to start again.
- Two runs at the same time can deliver and charge the same dataset, so leave a gap between scheduled runs.

This Actor reads the catalog newest update first, and the API serves that sorted order for the first 10,000 datasets of one search only (its unsorted scroll mode, which goes further, is not used). A wider search ends with a `result_cap` item in the errors dataset: add search words or portals. With `new_since_last_run` on, the older datasets past the first 10,000 are not reached by later runs either.

A portal domain Socrata's North American catalog does not know, including a portal outside North America, fails the run after one request with `Invalid input` and one uncharged `unknown_domain` item. Use the address the portal has in your browser, for example data.cityofnewyork.us, not www.nyc.gov.

Only datasets are read: charts, maps, filtered views, stories and files on the same portals are not. The owner and creator accounts, contact emails and portal-specific metadata are not delivered. A publisher that reads as a person's name is left empty.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `query` | string | "" | Words to look for in dataset names, descriptions, tags and columns, for example permits or water quality. Leave empty for all datasets of the portals. |
| `domains` | array | \[] | Portal addresses without https://, for example data.cityofnewyork.us or data.wa.gov. Leave empty to search every portal in Socrata's North American catalog. Portals outside North America are in Socrata's EU catalog, which this version does not read. |
| `new_since_last_run` | boolean | false | Deliver and charge only datasets this Actor has not delivered to you before for the same search words and portals. A dataset held back by Maximum results or your spending limit comes in the next run. Delivered datasets are remembered in a key-value store named open-data-portals-scraper-state in your account. |
| `max_items` | integer | 10 | How many results to return at most, from 1 to 10000. |

### Output

Each result has these fields. Missing values are `null`, never a different type.

| Field | Type | Description |
|---|---|---|
| `item_type` | string | Always `public_record` |
| `source_id` | string | The portal domain, a slash and the dataset's four-by-four id, for example data.cityofnewyork.us/ipu4-2q9a |
| `title` | string | Dataset name |
| `description_snippet` | string or null | The first 300 characters of the description |
| `domain` | string | The portal the dataset is on |
| `publisher` | string or null | The department or organisation the portal names as the source (Socrata's attribution). Empty when none is named or it reads as a person's name |
| `category` | string or null | The portal's category for the dataset |
| `tags` | string or null | The portal's tags, comma separated: the first 200, at most 5,000 characters |
| `license` | string or null | Licence as the portal states it. Empty when the portal states none |
| `created_at` | string or null | When the dataset was created, ISO time in UTC, to the second |
| `updated_at` | string or null | When the dataset or its metadata last changed, ISO time in UTC. Datasets come sorted by it, newest first |
| `data_updated_at` | string or null | When the dataset's rows last changed, ISO time in UTC |
| `columns` | string or null | Column names, comma separated: the first 200, at most 5,000 characters. column_count has the full number |
| `column_count` | number or null | Number of columns, all of them |
| `views_total` | number or null | Page views since the dataset was created |
| `views_last_month` | number or null | Page views in the last month |
| `downloads` | number or null | Downloads since the dataset was created |
| `url` | string | The dataset's page on its portal |
| `source_url` | string | The record on the source site |
| `fetched_at` | string | When the record was fetched, ISO 8601 UTC |
| `actor_version` | string | The build that produced the record |

Example item:

```json
{
  "item_type": "public_record",
  "source_id": "<source_id>",
  "title": "<title>",
  "description_snippet": "<description_snippet>",
  "domain": "<domain>",
  "publisher": "<publisher>",
  "category": "<category>",
  "tags": "<tags>",
  "license": "<license>",
  "created_at": "<created_at>",
  "updated_at": "<updated_at>",
  "data_updated_at": "<data_updated_at>",
  "columns": "<columns>",
  "column_count": 0,
  "views_total": 0,
  "views_last_month": 0,
  "downloads": 0,
  "url": "<url>",
  "source_url": "<source_url>",
  "fetched_at": "2026-11-04T09:30:00Z",
  "actor_version": "0.1.1"
}
```

Free-text fields are cleaned before delivery: email addresses, phone numbers, @handles and person names introduced by words such as "contact", "recruiter", "founder" or "manager" are replaced with `[removed]`. The cleaning follows fixed rules, so a name written elsewhere in the text, or in lower case, can remain.

### What it does not do

- Socrata portals only. CKAN portals (data.gov.uk, open.canada.ca, data.gov.au and others) and data.gov are not read in this version.
- Metadata only: the dataset's rows are not downloaded. Charts, maps, filtered views, stories and files are not listed.
- North American Socrata portals only (api.us.socrata.com); portals in Socrata's EU catalog are not read.
- One search stops at 10,000 datasets, the limit of the API's sorted order; an updated dataset you already got is not delivered again while new_since_last_run is on. Tags and column names stop at the first 200.

### How much it costs

You pay per result delivered to the default dataset. Errors and empty results are written to a separate `errors` dataset and are never charged.

| Plan tier | Price per 1,000 results |
|---|---|
| Free and Bronze | USD 1.50 |
| Silver and above | USD 1.28 |

Example: a run that delivers 1,000 results costs USD 1.50 on the Free and Bronze tiers and USD 1.28 on Silver and above, plus the platform's start event of USD 0.00005. If you set a maximum cost per run, the Actor stops before it would go over it and delivers nothing it cannot charge for.

### Other Actors in this family

This Actor is part of a family of job and public-data scrapers built on the same core: one result per charge, a separate uncharged errors dataset, and no person fields. Links follow as the other Actors are published.

### FAQ and support

- **Is there personal data in the output?** No personal data by design. One row is a dataset's catalog record, never a person. Owner and creator accounts, contact emails and portal-specific metadata are never read. A publisher that reads as a person's full name is left empty, and emails, phones and names after words such as contact are removed from the title, description, tags, category, licence and column names. The name check uses a list of common given names, so it can miss a rare name.
- **Is the data accurate?** Accuracy is not guaranteed. The data is parsed from free text written by many people, and fields can be missing or wrong.
- **Who runs this Actor?** It is not affiliated with Socrata Discovery.
- **How is the data collected?** The official API or open data is used where the source offers it. This Actor uses only the official Socrata Discovery API.
- **Which portals does it cover?** Every portal on the Socrata platform (now Tyler Technologies Data & Insights) that lists its public datasets in Socrata's North American catalog (api.us.socrata.com), for example data.cityofnewyork.us, data.cityofchicago.org, data.wa.gov and data.cdc.gov. Socrata portals outside North America are in its EU catalog, which this version does not read. CKAN portals such as data.gov.uk, open.canada.ca and data.gov.au are not covered in this version.
- **Does it download the data of a dataset?** No. Each row is the catalog record of one dataset - title, description, publisher, category, tags, licence, dates, column names, views, downloads and the link. Open the link, or the portal's own API, for the rows.
- **How do I get only new datasets every day?** Schedule a daily run with new_since_last_run on. Only datasets not delivered before for the same search words and portals are delivered and charged. A dataset you already got is not delivered again when its data is updated; turn the option off for the current metadata of all.
- **What happens if my search finds more than 10,000 datasets?** The Discovery API serves its sorted order, newest update first, for the first 10,000 datasets of a search; its unsorted scroll mode goes further, but this Actor does not use it. The Actor then writes an uncharged result_cap item to the errors dataset; add search words or portal domains to narrow it.
- **Why is the publisher empty for some datasets?** Some datasets name no publisher. When the publisher reads as a person's name, it is left empty, so the output holds no personal data. Owner and creator accounts and contact emails are never delivered.
- **Is it legal to use the Socrata catalog?** The Discovery API is public, needs no login and no key, and its documentation offers the catalog for automated searching, research and exploration. Tyler Technologies' general website terms forbid robots and commercial reuse of its online services; whether they cover this API is not stated. Each portal sets its own terms and licence for its data; the licence column shows it when the portal states one. This is an open reading, not a legal opinion. Not affiliated with Socrata, Tyler Technologies or any portal.
- **What may I do with the data?** You are responsible for complying with the law and with the source's terms when you use the data.
- **Something is broken.** Open an issue on the Issues tab with the run link and your input. Issues are answered by the automated maintainer.

# Changelog

This Actor's version history is a separate document: https://apify.com/plain-build/open-data-portals-scraper/changelog.md

# Actor input Schema

## `query` (type: `string`):

Words to look for in dataset names, descriptions, tags and columns, for example permits or water quality. Leave empty for all datasets of the portals.

## `domains` (type: `array`):

Portal addresses without https://, for example data.cityofnewyork.us or data.wa.gov. Leave empty to search every portal in Socrata's North American catalog. Portals outside North America are in Socrata's EU catalog, which this version does not read.

## `new_since_last_run` (type: `boolean`):

Deliver and charge only datasets this Actor has not delivered to you before for the same search words and portals. A dataset held back by Maximum results or your spending limit comes in the next run. Delivered datasets are remembered in a key-value store named open-data-portals-scraper-state in your account.

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

How many results to return at most. You pay per result delivered.

## Actor input object example

```json
{
  "query": "building permits",
  "domains": [
    "data.cityofnewyork.us"
  ],
  "new_since_last_run": false,
  "max_items": 25
}
```

# Actor output Schema

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

One item per public record.

## `errors` (type: `string`):

Records that could not be delivered, and queries with no results. Not charged.

# 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 = {
    "query": "building permits",
    "domains": [
        "data.cityofnewyork.us"
    ],
    "max_items": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("plain-build/open-data-portals-scraper").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 = {
    "query": "building permits",
    "domains": ["data.cityofnewyork.us"],
    "max_items": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("plain-build/open-data-portals-scraper").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 '{
  "query": "building permits",
  "domains": [
    "data.cityofnewyork.us"
  ],
  "max_items": 25
}' |
apify call plain-build/open-data-portals-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,plain-build/open-data-portals-scraper"
        }
    }
}
```

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/NQPHVDep01ZXDkfgF/builds/1i04DqaMc2a5Rz1WP/openapi.json
