# Los Angeles Open Data Scraper (`bigibyte/los-angeles-open-data-scraper`) Actor

Export Los Angeles open data (crime, permits, 311, businesses) from data.lacity.org with SoQL filters and sorting. Search the portal’s dataset catalog too. Run it on a schedule, then download results as JSON, CSV, or Excel, or send them to Google Sheets, Make, or Zapier.

- **URL**: https://apify.com/bigibyte/los-angeles-open-data-scraper.md
- **Developed by:** [BigiByte](https://apify.com/bigibyte) (community)
- **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

### Los Angeles Open Data Scraper

<p align="center">
  <img src="https://imgur.com/Z98TWVr.png" alt="USA Automotive Leads Hub" style="max-width:100%; border-radius:14px; width:680px;" />
</p>

Los Angeles open data scraper for public portal datasets. It exports dataset rows and catalog search hits with SoQL filters, paging, and a hard cap.

Crime, permits, 311, business listings, and any other dataset on the portal can be pulled into an Apify dataset and downloaded as JSON, CSV, or Excel. Schedule the run when you want a fresh copy of the same query.

### What it does

- Rows mode reads dataset rows with $limit,$offset, $where, and$order.
- Catalog mode searches for portal datasets.
- Requests stay sequential at about one request every 0.75 seconds. HTTP 429 and 5xx responses retry up to three times and honor Retry-After.
- Duplicate source ids are skipped. A failed request becomes an error row instead of stopping the actor.
- The default dataset is Listing of Active Businesses (6rrh-rzua).

### Use cases

- City research: export business, permit, or 311 rows without writing a SODA client.
- Civic monitoring: schedule the same SoQL filter and compare new rows over time.
- Catalog lookup: search the portal for datasets such as permits, then keep the id, permalink, and owner.
- Spreadsheet delivery: download the Apify dataset as CSV, JSON, or Excel.
- Pipeline input: send the dataset downstream when the run finishes.

### Input

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| mode | string | rows | `rows` exports one dataset. `catalog` searches. |
| datasetId | string | 6rrh-rzua | 4x4 id for rows mode. |
| where | string | empty | SoQL $where filter for rows mode. |
| order | string | empty | SoQL $order clause for rows mode. |
| query | string | permits | Catalog search text. |
| maxItems | integer | 100 | Maximum saved rows. Hard cap 1000. |
| timeoutSecs | integer | 300 | Overall run time limit in seconds. |
| requestTimeoutSecs | integer | 30 | Per-request timeout in seconds. |
| proxyConfiguration | object | `{"useApifyProxy": false}` | Optional proxy. |

#### Example input

```json
{
  "mode": "rows",
  "datasetId": "6rrh-rzua",
  "where": "council_district = '10'",
  "order": "location_start_date DESC",
  "maxItems": 100,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": { "useApifyProxy": false }
}

```

#### Catalog example:

```json
{
  "mode": "catalog",
  "query": "permits",
  "maxItems": 20,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": { "useApifyProxy": false }
}

```

### What data does this actor extract?

```json
{
  "location_account": "0000000108-0001-3",
  "business_name": "PALACE OF VENICE GUEST HOME /C",
  "street_address": "1727 CRENSHAW BLVD",
  "city": "LOS ANGELES",
  "zip_code": "90019-6037",
  "location_description": "1727 CRENSHAW 90019-6037",
  "naics": "721310",
  "primary_naics_description": "Rooming & boarding houses",
  "council_district": "10",
  "location_start_date": "1991-05-15T00:00:00.000",
  "location_1": {
    "latitude": "34.0425",
    "longitude": "-118.3295",
    "human_address": "{\"address\": \"\", \"city\": \"\", \"state\": \"\", \"zip\": \"\"}"
  },
  "latitude": "34.0425",
  "longitude": "-118.3295",
  ":@computed_region_qz3q_ghft": "23080",
  ":@computed_region_kqwf_mjcx": "12",
  ":@computed_region_k96s_3jcv": "648",
  "scrapedAt": "2026-10-12T00:00:00+00:00"
}

```

| Field | Type | Description |
| --- | --- | --- |
| location_account | string | Source location account id. Used to skip duplicate rows. |
| business_name | string | Business name from the source row. |
| street_address | string | Street address from the source row. |
| city | string | City from the source row. |
| zip_code | string | ZIP code from the source row. |
| location_description | string | Location description from the source row. |
| naics | string | NAICS code from the source row. |
| primary_naics_description | string | NAICS description from the source row. |
| council_district | string | Council district from the source row. |
| location_start_date | string | Location start date from the source row. |
| location_1 | object | Original location object. |
| latitude | string | Latitude copied from location_1. |
| longitude | string | Longitude copied from location_1. |
| datasetName | string | Catalog dataset name. |
| datasetId | string | Catalog 4x4 id. |
| datasetSummary | string | Catalog summary text. |
| resourceKind | string | Catalog resource kind. |
| permalink | string | Dataset page link. |
| scrapedAt | string | UTC time the row was saved. |
| error | string | Set only when a request fails. |

### FAQ

#### How many rows can one run export?

The free cap is maxItems, default 100, maximum 1000. Raise the cap or schedule another run for the next slice.

#### What happens if the filter is invalid?

The actor saves an error row with the HTTP status and a short response snippet, then finishes without crashing.

#### Can I turn on a proxy?

The proxy input is optional and off by default. Leave it off.

### Related tools

If you plan to extract, map, or analyze Los Angeles datasets—such as active businesses, permits, or 311 service requests—a geocoding pass, location aggregation, or a quick CSV cleanup are the usual next steps. BigiByte also builds dedicated scrapers for other municipal open-data portals, business registries, and government catalogs when you need them as a separate job.

Need another city's open data, a scheduled monitor, or a custom pipeline? BigiByte builds custom scrapers and APIs: https://bigibyte.com

### Trademark Notice

Los Angeles Open Data and related names, logos, and trademarks belong to their respective owners. Their use in this documentation is solely to identify the source of the data and does not imply affiliation, sponsorship, endorsement, or partnership.

### Disclaimer

Disclaimer: This Actor is an independent tool and is not affiliated with, endorsed by, sponsored by, or otherwise officially associated with Los Angeles Open Data or its owners. All data is collected from publicly available sources. Users are responsible for complying with the source's terms of use, rate limits, and attribution or licensing requirements.

### Is web scraping legal?

This Actor only collects publicly available data without bypassing any access controls. Scraping public data is generally legal, but how you use it matters:

- Personal data: If the results include personal data (for example names, emails, or profile details), laws such as the GDPR in the EU and the CCPA in California may apply. Only collect and store personal data when you have a legitimate reason.
- Copyright: Some content (articles, images, descriptions) may be protected by copyright. Do not republish full copyrighted content without permission.
- Terms of use: Respect the source's terms, stated rate limits, and any attribution or non-commercial-use requirements listed in the Data source and licence section.
- Legal advice: This is general information, not legal advice. If you're unsure, consult a lawyer.

To learn more, read Apify's guide: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

# Actor input Schema

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

Choose dataset rows from a Socrata 4x4 id, or search the data.lacity.org catalog.

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

Socrata 4x4 dataset id used in rows mode. The default is the Listing of Active Businesses dataset on data.lacity.org.

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

Optional SoQL $where filter applied to dataset rows. Leave empty to export the dataset without a filter.

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

Optional SoQL $order clause for dataset rows. Leave empty to keep the source order.

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

Search text for catalog mode. Sent as the q parameter to the Socrata catalog API, limited to data.lacity.org.

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

Maximum rows to save in one run. Values above 1000 are clamped to 1000.

## `timeoutSecs` (type: `integer`):

Overall time limit for the run, in seconds. The actor stops requesting pages after this deadline.

## `requestTimeoutSecs` (type: `integer`):

Timeout for each HTTP request, in seconds.

## `proxyConfiguration` (type: `object`):

Optional proxy settings. Leave Apify Proxy off. The public SODA API is called directly, and proxies must not be used to bypass source rate limits.

## Actor input object example

```json
{
  "mode": "rows",
  "datasetId": "6rrh-rzua",
  "where": "council_district = '10'",
  "order": "location_start_date DESC",
  "query": "permits",
  "maxItems": 100,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Location account, business name, address, city, ZIP, location description, and NAICS code and description.

## `catalog` (type: `string`):

Dataset name, dataset id, category, attribution, permalink, and data updated timestamp.

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

Failed requests with the request URL and error message.

## `dataset` (type: `string`):

Every row from the run, without a table view applied.

# 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 = {
    "mode": "rows",
    "datasetId": "6rrh-rzua",
    "where": "",
    "order": "",
    "query": "permits",
    "maxItems": 100,
    "timeoutSecs": 300,
    "requestTimeoutSecs": 30,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("bigibyte/los-angeles-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 = {
    "mode": "rows",
    "datasetId": "6rrh-rzua",
    "where": "",
    "order": "",
    "query": "permits",
    "maxItems": 100,
    "timeoutSecs": 300,
    "requestTimeoutSecs": 30,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("bigibyte/los-angeles-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 '{
  "mode": "rows",
  "datasetId": "6rrh-rzua",
  "where": "",
  "order": "",
  "query": "permits",
  "maxItems": 100,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call bigibyte/los-angeles-open-data-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bigibyte/los-angeles-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/y2Qn7qNMoVCkpEJaJ/builds/XnPXmJr7UdUaNyCbn/openapi.json
