# Chicago Open Data Portal Scraper (`parseforge/data-cityofchicago-scraper`) Actor

Scrapes Chicago Open Data Portal datasets by catalog or resource ID. Returns rows with selected columns, filtered by SoQL where, full-text search, and column equality.

- **URL**: https://apify.com/parseforge/data-cityofchicago-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Other, Real estate
- **Stats:** 1 total users, 0 monthly users, 89.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $15.00 / 1,000 result items

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?

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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### Chicago Open Data Portal Scraper

**Scrape Chicago Open Data Portal datasets, from building violations to crime reports, up to a million rows per run.** Each row comes with the exact columns you select, filtered by SoQL where clauses, full-text search, and column equality. No API key or login. Export to CSV, JSON, Excel, or XML.

Chicago's official data portal holds hundreds of public datasets, but downloading them means manual CSV exports or writing Socrata API calls. This Actor reads the portal directly, either listing every available dataset or pulling rows from a specific resource ID, and returns each match in one fixed schema.

| Who uses it | What they scrape Chicago Open Data Portal for |
|---|---|
| Urban planners | Which building violations are open in a specific ward this month |
| Journalists | Crime incident trends for a neighborhood over the last year |
| Data analysts | A clean dataset of 311 requests joined with ward boundaries |
| Civic hackers | Fresh data for a public dashboard or mapping project |

### What it does

This Actor collects Chicago Open Data Portal datasets by catalog browsing or resource ID, and returns each row as a flat record with the columns you select.

- 📋 **Catalog mode:** list all available Chicago datasets with their IDs, names, and descriptions.
- 📊 **Dataset mode:** pull rows from one specific dataset by its resource ID, like 22u3-xenr for Building Violations.
- 🔍 **Full-text search:** pass a $q query to search across all columns in a dataset.
- 🧮 **SoQL filtering:** use a $where clause for advanced conditions like violation\_date > '2024-01-01'.
- 📁 **Column projection:** select only the fields you need with a comma-separated $select list.
- ↕️ **Sorting:** order results with $order, for example violation\_date DESC.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with Chicago Open Data Portal data

**🏗️ Track building violations.**

A city inspector runs the Actor with resourceId 22u3-xenr and a filter for violation\_status OPEN to get a daily list of unresolved violations in their district.

**🚔 Monitor crime trends.**

A local newsroom pulls the Crimes 2001-Present dataset with a where clause for a specific community area and date range to build a monthly crime report.

**📞 Analyze 311 requests.**

A data analyst extracts the 311 Service Requests dataset, selects only the columns for type, ward, and created date, and exports to CSV for a performance dashboard.

**🗺️ Build a public map.**

A civic hacker uses catalog mode to find the latest dataset IDs, then pulls rows for a neighborhood map of pothole repairs, filtering by status and sorting by date.

### Why choose this scraper

|  | What you get |
|---|---|
| **No API key** | Reads the public Socrata endpoint directly, no registration or token needed |
| **Fixed schema** | Every row returns the same flat structure, ready for analysis or export |
| **Large volume** | Pull up to 1,000,000 rows per run on paid plans |
| **Flexible queries** | Combine column filters, SoQL where, full-text search, and sorting |

### How it compares

This Actor focuses on Chicago Open Data Portal datasets, while the competitors below target different sources like Tripadvisor, Booking.com, and Yelp.

| Feature | ParseForge | Tripadvisor Scraper | Booking Reviews Scraper | Yelp Scraper |
|---|---|---|---|---|
| Scrapes Chicago Open Data Portal | Yes | Not listed | Not listed | Not listed |
| Catalog mode to list all datasets | Yes | Not listed | Not listed | Not listed |
| SoQL where clause filtering | Yes | Not listed | Not listed | Not listed |
| Full-text search across columns | Yes | Not listed | Not listed | Not listed |
| Column projection with $select | Yes | Not listed | Not listed | Not listed |
| Sorting with $order | Yes | Not listed | Not listed | Not listed |

### Configure the run

Drive the Actor with a mode, a resource ID, and optional filters, where clauses, search queries, field selections, and sort expressions, all applied as the data is read so only matching rows reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "maxItems": 10,
  "mode": "dataset",
  "resourceId": "22u3-xenr"
}
```

A larger pull:

```json
{
  "maxItems": 200,
  "mode": "dataset",
  "resourceId": "22u3-xenr"
}
```

### Pricing

Pay-per-result: **$0.02 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $2.00 |
| 1,000 results | $20.00 |
| 10,000 results | $200.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [Chicago Open Data Portal Scraper](https://apify.com/parseforge/data-cityofchicago-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to Chicago Open Data Portal through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/data-cityofchicago-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check that your resourceId is correct and that your filters or where clause do not exclude all rows. Try running in catalog mode to verify the dataset exists.

**I get an error about invalid resource ID.**

Resource IDs are 4x4 format like '22u3-xenr'. Use catalog mode to find the exact ID for your dataset.

**The run stops at 10 items even though I set maxItems higher.**

Free users are limited to 10 items as a preview. Upgrade to a paid plan to pull more rows.

**My where clause returns an error.**

Ensure your SoQL expression is properly quoted and uses single quotes for string values, like "violation\_date > '2024-01-01'".

### FAQ

| Question | Answer |
|---|---|
| Do I need an API key or token? | No. The Actor reads the public Socrata endpoint directly, so no registration or authentication is required. |
| How do I find the resource ID for a dataset? | Run the Actor in catalog mode to list all datasets with their IDs, names, and descriptions. Then use the ID in dataset mode. |
| What is the maximum number of rows I can pull? | Free users are limited to 10 items as a preview. Paid users can set maxItems up to 1,000,000. |
| Can I filter rows by a specific column value? | Yes, use the filters input as a JSON object with column-equality pairs, like {"violation\_status":"OPEN"}. |
| What is a SoQL where clause? | SoQL is the Socrata Query Language. The where input accepts an expression like "violation\_date > '2024-01-01' AND ward = '42'" for advanced filtering. |
| Can I search across all columns? | Yes, the searchQuery input applies a full-text $q search across all columns in the dataset. |
| How do I select only certain columns? | Use the selectFields input with a comma-separated list, like 'id,violation\_date,ward,violation\_status'. |
| Can I sort the results? | Yes, the orderBy input accepts a sort expression like 'violation\_date DESC'. |
| What export formats are supported? | The Actor returns data in a fixed schema that can be exported to CSV, JSON, Excel, or XML from the Apify platform. |
| Is this an official City of Chicago API? | No, this is an unofficial scraper that reads the public data portal. It is not affiliated with or endorsed by the City of Chicago. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by City of Chicago. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `maxItems` (type: `integer`):

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## `mode` (type: `string`):

catalog = browse all available Chicago datasets (returns IDs, names, descriptions). dataset = pull rows from one specific dataset by its resource ID.

## `resourceId` (type: `string`):

Chicago dataset resource ID (4x4 format, e.g. '22u3-xenr' for Building Violations, 'ijzp-q8t2' for Crimes, '6zsd-86xi' for Crimes 2001-Present). Required when mode is 'dataset'. Find IDs via 'catalog' mode.

## `filters` (type: `object`):

Optional column-equality filters as key/value pairs. Example: {"violation\_status":"OPEN","ward":"42"}.

## `where` (type: `string`):

Optional SoQL $where expression for advanced filtering. Example: "violation\_date > '2024-01-01' AND ward = '42'".

## `searchQuery` (type: `string`):

Optional $q full-text search query applied across all columns.

## `selectFields` (type: `string`):

Optional comma-separated column list ($select). Example: 'id,violation\_date,ward,violation\_status'.

## `orderBy` (type: `string`):

Optional sort expression ($order). Example: 'violation\_date DESC'.

## Actor input object example

```json
{
  "maxItems": 10,
  "mode": "dataset",
  "resourceId": "22u3-xenr"
}
```

# Actor output Schema

## `overview` (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 = {
    "maxItems": 10,
    "mode": "dataset",
    "resourceId": "22u3-xenr"
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/data-cityofchicago-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 = {
    "maxItems": 10,
    "mode": "dataset",
    "resourceId": "22u3-xenr",
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/data-cityofchicago-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 '{
  "maxItems": 10,
  "mode": "dataset",
  "resourceId": "22u3-xenr"
}' |
apify call parseforge/data-cityofchicago-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/data-cityofchicago-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/om3Rm223V4pzqndqi/builds/RJ8YiffFUkJEIlnko/openapi.json
