# LA Business Licenses Scraper (`muhammadafzal/la-business-licenses-scraper`) Actor

Search official City of Los Angeles active business registrations by business name, DBA, account, address, ZIP, NAICS, council district, or start date. Returns structured registration records with address, industry, dates, coordinates, and source metadata.

- **URL**: https://apify.com/muhammadafzal/la-business-licenses-scraper.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 business registration records

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## LA Business Licenses Scraper

Search and export active City of Los Angeles business registrations from the official Office of Finance open dataset. Use it for local-market research, lead discovery, compliance screening, territory analysis, and business-directory enrichment without browser automation or private credentials.

> **What “license” means here:** the source is the City's Listing of Active Businesses. A record means the owner has registered with the LA Office of Finance and has not reported ceasing operations. It is not proof of a California professional, contractor, health, alcohol, or other regulatory license.

### What the Actor extracts

| Field | Description |
|---|---|
| `locationAccount` | Stable Office of Finance account for the business location |
| `businessName`, `dbaName` | Legal and Doing Business As names |
| `streetAddress`, `city`, `zipCode` | Registered business-location address |
| `mailingAddress`, `mailingCity`, `mailingZipCode` | Public mailing address when present |
| `naics`, `primaryNaicsDescription` | Self-reported 2007 NAICS code and City-provided industry description |
| `councilDistrict` | Current LA council district; `0` means outside the City |
| `locationStartDate`, `locationEndDate` | First activity start date and most recent activity end date when present |
| `latitude`, `longitude` | City-provided coordinates when the location was geocoded |
| `sourceDatasetId`, `sourceUrl`, `scrapedAt` | Provenance and retrieval timestamp |

Every dataset item has a stable shape. Unavailable optional source values are returned as `null`, not omitted. Run diagnostics are stored separately in the `SUMMARY` key-value record.

### When to use it

Use this Actor when you need active LA business-registration data filtered by:

- a broad keyword;
- legal name or DBA name;
- exact location account;
- street address, city, or five-digit ZIP prefix;
- exact self-reported NAICS code;
- LA council district; or
- location activity start-date range.

Do not use it to verify a regulated occupation, determine whether taxes are current, infer that a business is physically open today, or obtain statewide California entities. The City updates the source monthly and defines “active” by whether the owner has reported ceasing business operations.

### Input

All filters are combined with `AND`. Text name/address matching is case-insensitive.

| Input | Type | Default | Notes |
|---|---:|---:|---|
| `query` | string | — | Broad full-text search across the source record |
| `businessName` | string | `STARBUCKS` | Legal business name contains |
| `dbaName` | string | — | DBA name contains |
| `locationAccount` | string | — | Exact account such as `0000008207-0001-5` |
| `streetAddress` | string | — | Business-location street address contains |
| `city` | string | — | Exact city name |
| `zipCode` | string | — | Five digits; includes matching ZIP+4 values |
| `naics` | string | — | Exact 2–6 digit NAICS code |
| `councilDistrict` | integer | — | `0` through `15` |
| `startDateFrom` | date | — | Inclusive `YYYY-MM-DD` |
| `startDateTo` | date | — | Inclusive `YYYY-MM-DD` |
| `maxResults` | integer | `25` | From 1 to 10,000 |

#### Console example

```json
{
  "businessName": "STARBUCKS",
  "city": "LOS ANGELES",
  "maxResults": 25
}
```

#### API example

```bash
curl -X POST "https://api.apify.com/v2/acts/YOUR_USERNAME~la-business-licenses-scraper/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"zipCode":"90012","naics":"722211","maxResults":100}'
```

Keep API tokens in headers or a secret manager in production rather than committing them to source control.

### Output example

```json
{
  "locationAccount": "0000008207-0001-5",
  "businessName": "STARBUCKS CORPORATION",
  "dbaName": "STARBUCKS #5759",
  "streetAddress": "22815 VICTORY BLVD #A",
  "city": "CANOGA PARK",
  "zipCode": "91307-3953",
  "locationDescription": "22815 VICTORY 91307-3953",
  "mailingAddress": "POST OFFICE BOX #34067",
  "mailingCity": "SEATTLE",
  "mailingZipCode": "98124-1067",
  "naics": "722211",
  "primaryNaicsDescription": "Limited-service eating places",
  "councilDistrict": 3,
  "locationStartDate": "2000-04-08",
  "locationEndDate": null,
  "latitude": 34.1864,
  "longitude": -118.6236,
  "sourceDatasetId": "6rrh-rzua",
  "sourceUrl": "https://data.lacity.org/d/6rrh-rzua",
  "scrapedAt": "2026-08-27T12:00:00.000Z"
}
```

### Pay-per-event pricing

| Event | Price |
|---|---:|
| Actor start | $0.00005 per run |
| Business registration record | $0.0005 per delivered record |

A default 25-record run costs at most **$0.01255** in event charges. A 100-record run costs at most **$0.05005**. The Actor writes and validates a record before charging its record event, stops after `maxResults`, and stops promptly when the platform reports that the event spending limit was reached.

### Reliability and limits

The Actor reads the first-party `data.lacity.org` Socrata endpoint directly. It uses stable account-number ordering, bounded 1,000-row pages, output validation, account-level deduplication, a 30-second request timeout, and four bounded attempts with backoff for transient failures. No proxy, browser, login, cookie, or third-party data provider is required.

- Maximum 10,000 results per run.
- Source updates are controlled by the City and currently described as monthly.
- A valid no-match query returns zero dataset items plus an `EMPTY` summary.
- A bad date range or malformed input returns an actionable `REJECTED` summary without result charges.
- A source outage preserves any already delivered records and writes a `FAILED` summary; no fabricated records are added.
- Broad text and contains filters may take longer than exact account, ZIP, NAICS, city, or district filters.

### Responsible use

This Actor processes public government records. Mailing and location fields can still contain personal or home-address information for sole proprietors. Use the data only for a lawful purpose, minimize retention, honor applicable privacy and marketing rules, and independently verify records before making eligibility, enforcement, credit, employment, housing, insurance, or other high-impact decisions. The City of Los Angeles remains the authoritative source.

### Support

When reporting an issue, include the Actor run ID, redacted input, expected result, and the relevant public Office of Finance account number. Do not post API tokens or non-public personal data.

# Actor input Schema

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

Use this for a broad full-text search across the official record, such as `coffee shop`. Leave empty when using precise filters. Maximum 100 characters.

## `businessName` (type: `string`):

Use this to match part of the legal business name, such as `STARBUCKS`. Matching is case-insensitive. Maximum 100 characters.

## `dbaName` (type: `string`):

Use this to match part of a Doing Business As name, such as `COFFEE`. Matching is case-insensitive; this is not the legal name field.

## `locationAccount` (type: `string`):

Use this for one exact Office of Finance location account, such as `0000008207-0001-5`. Do not enter a state professional-license number.

## `streetAddress` (type: `string`):

Use this to match part of the registered location address, such as `SUNSET BLVD`. Matching is case-insensitive. Maximum 100 characters.

## `city` (type: `string`):

Use this for an exact city name, such as `LOS ANGELES`. Matching is case-insensitive. Records outside city limits can appear in the source.

## `zipCode` (type: `string`):

Use this for a five-digit ZIP prefix, such as `90012`; ZIP+4 source values are included. This filters the business location, not the mailing address.

## `naics` (type: `string`):

Use this for an exact self-reported NAICS code, such as `722211`. The City source currently uses 2007 NAICS classifications.

## `councilDistrict` (type: `integer`):

Use this for an exact current LA council district from 1 to 15, or 0 for locations outside the City. Leave empty for all districts.

## `startDateFrom` (type: `string`):

Use this for registrations whose first business activity started on or after an ISO date, such as `2024-01-01`. This is not an expiration date.

## `startDateTo` (type: `string`):

Use this for registrations whose first business activity started on or before an ISO date, such as `2024-12-31`. Must not precede the from date.

## `maxResults` (type: `integer`):

Use this to cap delivered records and pay-per-event cost. Default 25; minimum 1 and maximum 10,000 per run.

## Actor input object example

```json
{
  "businessName": "STARBUCKS",
  "maxResults": 25
}
```

# Actor output Schema

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

Default dataset items matching the supplied filters.

## `summary` (type: `string`):

Outcome, delivered count, query diagnostics, warnings, and source metadata.

# 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 = {
    "businessName": "STARBUCKS",
    "maxResults": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/la-business-licenses-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 = {
    "businessName": "STARBUCKS",
    "maxResults": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/la-business-licenses-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 '{
  "businessName": "STARBUCKS",
  "maxResults": 25
}' |
apify call muhammadafzal/la-business-licenses-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,muhammadafzal/la-business-licenses-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/24N1svkDDUeJ97FJb/builds/va889OnzGkEXfcavC/openapi.json
