# Los Angeles Open Data Scraper (`parseforge/la-open-data-scraper`) Actor

Scrapes any dataset from data.lacity.org by its 4x4 ID. Returns each row as a flat record with the dataset's native columns. Supports SoQL filtering, column selection, and full-text search.

- **URL**: https://apify.com/parseforge/la-open-data-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Developer tools, Automation
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $26.02 / 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?

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)

### Los Angeles Open Data Scraper

**Scrape any public dataset from data.lacity.org, from crime reports to building permits, up to a million rows per run.** Every row arrives in a clean, flat schema ready for CSV, JSON, Excel, or XML export. No API key, no registration, no rate-limit headaches.

The City of Los Angeles publishes hundreds of civic datasets on its Socrata portal, but downloading them one by one through the browser is slow and manual. This actor reads the public API directly, so you can pull the exact rows you need from any dataset by its 4x4 ID. It handles pagination, column selection, and SoQL filtering for you, returning a single structured dataset every time.

| Who uses it | What they scrape Los Angeles Open Data for |
|---|---|
| Data journalists | Pull the latest crime or traffic collision records for a story on neighborhood safety. |
| Urban planners | Download building permits and zoning data to analyze development patterns. |
| Policy analysts | Track 311 service requests or parking citations to measure city responsiveness. |
| Real estate researchers | Collect property, permit, and business registration data for market analysis. |

### What it does

This Actor collects rows from any dataset hosted on data.lacity.org and returns each row as a flat record with the dataset's native columns.

- 📋 **Preloaded dataset catalog:** Choose from over 200 datasets directly in the input editor, including crime, permits, 311 requests, and business listings.
- 🔍 **SoQL where filter:** Narrow results with Socrata's query language, for example to return only burglaries in a specific division.
- 📊 **Column selection:** Request only the columns you need with a comma-separated $select clause, reducing payload size and cost.
- 📈 **Custom sort order:** Pass an $order clause to sort rows by date, value, or any column before they reach your dataset.
- 🔎 **Full-text search:** Use the query parameter to search across all string columns in the dataset for a keyword or phrase.

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

### What you can do with Los Angeles Open Data data

**📰 Investigate crime trends.**

A data journalist pulls the latest year of crime data with a $where filter for a specific offense type and exports it to CSV for mapping in QGIS.

**🏗️ Monitor new construction.**

A real estate analyst scrapes building permits issued from 2020 to present weekly to track development activity by neighborhood.

**📞 Analyze 311 service patterns.**

A city performance team downloads MyLA311 service requests filtered by request type and council district to measure resolution times.

**🚗 Study traffic safety.**

A transportation researcher collects traffic collision data with a $where clause for pedestrian-involved incidents and orders by date descending.

### Why choose this scraper

| | What you get |
|---|---|
| **No API key required** | Reads the public Socrata endpoint directly with no registration or authentication. |
| **Over 200 datasets** | Preloaded catalog covers crime, permits, 311, business listings, budgets, and more. |
| **SoQL filtering** | Full support for $where, $select, $order, and $query to slice the data before download. |
| **Flat row output** | Every record arrives as a clean, flat object ready for analysis or export. |

### How it compares

No other Store actor targets Los Angeles Open Data the same way, so the honest comparison is with the alternatives teams actually weigh.

| | Los Angeles Open Data Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When Los Angeles Open Data changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |

### Configure the run

Drive the Actor with a dataset ID from the dropdown, then optionally narrow the results with SoQL where, select, order, and full-text query parameters so only matching rows land in your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
 "datasetId": "vygi-vxyg",
 "maxItems": 10
}
```

A larger pull:

```json
{
 "datasetId": "vygi-vxyg",
 "maxItems": 200
}
```

### Pricing

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

| Results collected | Approximate cost |
|---|---|
| 100 results | $3.47 |
| 1,000 results | $34.70 |
| 10,000 results | $347.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 [Los Angeles Open Data Scraper](https://apify.com/parseforge/la-open-data-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 Los Angeles Open Data 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/la-open-data-scraper"
```

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

### Troubleshooting

**Why am I getting no results?**

Check your $where clause for syntax errors. SoQL uses single quotes around string values and requires exact column names. Try removing the filter to confirm the dataset itself returns rows, then add conditions back one at a time.

**The run fails with an error about the dataset ID.**

Make sure the dataset ID is exactly 4 characters, a hyphen, and 4 more characters, like '2nrs-mtv8'. Copy it directly from the dataset URL on data.lacity.org. The preloaded dropdown values are validated.

**My $select columns are not appearing in the output.**

Column names are case-sensitive and must match the dataset's field names exactly. Check the dataset's metadata page on data.lacity.org for the correct column identifiers.

**The run is taking a long time.**

Large datasets with millions of rows will take time to paginate through. Reduce maxItems, add a tighter $where filter, or use $select to request fewer columns and speed up each page.

**I get a 'column not found' error in my $where clause.**

Verify the column name against the dataset's API field list. Some datasets use internal field names that differ from the human-readable labels shown on the portal. Check the dataset's API documentation page.

### FAQ

| Question | Answer |
|---|---|
| Do I need an API key or account to use this scraper? | No. The actor reads the public Socrata API at data.lacity.org, which does not require authentication or an API key. |
| How do I find the dataset ID I need? | Open the dataset on data.lacity.org and look at the URL. The 4x4 code after the domain is the dataset ID, for example '2nrs-mtv8' for crime data from 2020 to present. You can also pick from the preloaded dropdown in the input editor. |
| Can I filter rows before downloading? | Yes. Use the $where field with Socrata SoQL syntax, for example "crm\_cd\_desc='BURGLARY' AND area\_name='Central'". You can also use $select to pick columns, $order to sort, and $query for full-text search. |
| What is the maximum number of rows I can scrape? | You can set maxItems up to 1,000,000 rows per run. The Socrata API itself may impose a default limit, but the actor will paginate through all available pages up to your requested maximum. |
| Which datasets are available? | The input editor includes over 200 preloaded datasets covering crime, building permits, 311 requests, parking citations, business registrations, traffic collisions, budgets, and many more. You can also enter any valid 4x4 ID from data.lacity.org manually. |
| What format does the output come in? | The actor returns each row as a flat JSON object. You can export the full run to CSV, JSON, Excel, or XML from the Apify dataset tab. |
| Can I select only specific columns? | Yes. Use the $select field with a comma-separated list of column names, for example 'date\_occ,area\_name,crm\_cd\_desc'. This reduces the payload size and speeds up the run. |
| How do I sort the results? | Use the $order field with a column name and direction, for example 'date\_occ DESC' to get the most recent records first. |
| Does this actor update datasets automatically? | You can schedule the actor to run on a recurring basis from the Apify console. Pair it with a cron schedule to keep your copy of a dataset fresh. |
| Is there a rate limit on the city's open data portal? | The Socrata API has generous public limits. The actor makes sequential requests with built-in pagination and will not hammer the endpoint. |

### 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 Los Angeles. 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

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

Socrata 4x4 ID of any dataset hosted on data.lacity.org. Find the ID in the dataset URL (e.g. '2nrs-mtv8' for crime data from 2020 to present, 'nbyu-2ha9' for building & safety permits, '7my7-7vrt' for MyLA311 service requests, 'pvwu-3di3' for parking citations, '6rrh-rzua' for traffic collisions).

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

How many datasets to collect per run.

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

Optional Socrata SoQL $where clause. Example: "crm\_cd\_desc='BURGLARY' AND area\_name='Central'". See https://dev.socrata.com/docs/queries/where.html

## `select` (type: `string`):

Comma-separated list of columns to return. Default: all columns.

## `order` (type: `string`):

Sort order. Example: 'date\_occ DESC' or 'date\_rptd ASC'

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

Free-text search across all string columns of the dataset

## Actor input object example

```json
{
  "datasetId": "vygi-vxyg",
  "maxItems": 10
}
```

# Actor output Schema

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

Overview of scraped data

## `fullData` (type: `string`):

Complete dataset

# 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 = {
    "datasetId": "vygi-vxyg",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/la-open-data-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 = {
    "datasetId": "vygi-vxyg",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/la-open-data-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 '{
  "datasetId": "vygi-vxyg",
  "maxItems": 10
}' |
apify call parseforge/la-open-data-scraper --silent --output-dataset

```

## MCP server setup

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