# San Francisco Commercial Building Permits (`cemented_jest/sf-commercial-permit-watchlist`) Actor

Export San Francisco commercial building permits by filing date, business use and estimated cost. Includes work descriptions, addresses, source links and CSV.

- **URL**: https://apify.com/cemented_jest/sf-commercial-permit-watchlist.md
- **Developed by:** [CRNO](https://apify.com/cemented_jest) (community)
- **Categories:** Real estate
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 permits

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## San Francisco Commercial Building Permits

Find commercial building permits filed in San Francisco. Filter by business use, filing date and estimated project cost, then export the work descriptions and addresses to CSV or JSON.

**$1 per 1,000 permits exported, plus $0.00005 per run.** A 100-permit export costs $0.10005. Run compute is included; no proxy or external API key is needed.

[Download a 5-row sample CSV](https://api.apify.com/v2/key-value-stores/sIDbDUCBGe0ZANUTx/records/sample.csv?signature=1q4Qws1AlWEkCBONp5j7V) · [View the same rows as JSON](https://api.apify.com/v2/key-value-stores/sIDbDUCBGe0ZANUTx/records/sample.json?signature=15l3SiN2sXtkxOP69pOku)

### What the results look like

These are real records retrieved on November 15, 2026. Work descriptions below are shortened; the downloads contain the source wording. Costs are estimates declared in the permit applications.

| Filed | Project address | Work described | Estimated cost |
| --- | --- | --- | ---: |
| Nov 13, 2026 | 30 02nd St | Service counters, bakery display, refrigeration and plumbing | $100,000 |
| Nov 13, 2026 | 4138 03rd St | New cafe in a vacant commercial space | $125,000 |
| Nov 12, 2026 | 1360 04th St | Grocery store fit-out, refrigeration and lighting | $120,000 |
| Nov 12, 2026 | 1856 Union St | Cafe and retail fit-out, restroom and kitchen | $60,000 |
| Nov 9, 2026 | 100 01st St | Restaurant renovation with new equipment and finishes | $125,000 |

### Run a search

Start with the prefilled input, or paste this into the JSON editor to look for food and retail projects with an estimated cost of at least $50,000:

```json
{
  "lookbackDays": 30,
  "categories": ["food", "retail"],
  "minEstimatedCost": 50000,
  "maxItems": 100
}
```

Click **Start**. When the run finishes, open **Output** for the permit dataset, CSV download and run summary. The CSV opens in Excel or Google Sheets.

For office interior work, use:

```json
{
  "lookbackDays": 30,
  "categories": ["office"],
  "minEstimatedCost": 100000,
  "keywords": ["tenant", "interior"],
  "maxItems": 100
}
```

To search a specific filing period, replace `lookbackDays` with `dateFrom` and `dateTo`, both in `YYYY-MM-DD` format. Both dates are included. For example, `"dateFrom": "2026-11-01", "dateTo": "2026-11-15"` reproduces the sample period, though later source corrections can change the results.

### Filters

| Input | Default | How it works |
| --- | --- | --- |
| `lookbackDays` | `30` | Filing dates in the last 30 days, including today in UTC. Used when `dateFrom` is absent. |
| `dateFrom`, `dateTo` | Automatic | Inclusive filing-date range, up to 366 days. End date defaults to today. |
| `categories` | All eight | `office`, `retail`, `food`, `fitness`, `beauty`, `medical`, `hospitality`, `industrial`. |
| `minEstimatedCost` | `10000` | Minimum declared cost in USD. Set `0` to include unknown costs. |
| `statuses` | `filed`, `approved`, `issued` | Current permit status. Also accepts `plancheck` and `triage`. |
| `keywords` | None | Matches any of the supplied phrases in the work description, ignoring case. |
| `maxItems` | `100` | Maximum permits to export, newest filing first. Maximum allowed: 1,000. |
| `maxSourceRows` | `5000` | Maximum source rows to scan before filtering. Raise to 10,000 or narrow the dates if the run reaches this limit. |

Categories come from the city's use codes. Proposed use takes priority; existing use is used when proposed use is missing. The codes can be broader than the business described in the work text. For example, a grocery store can be classified as `food`.

### Files and fields

Each result includes the permit number, filing date, current status, category, estimated cost, project address, full work description and a link to the source record. JSON also includes all associated addresses, source record IDs, the original use labels and source update time.

- **Dataset:** one row per permit within the run. Multiple source addresses are grouped under the same permit number.
- **CSV:** the exported permits in a spreadsheet format. Text that could be treated as a formula is escaped.
- **Summary:** applied filters, source rows scanned, duplicates merged, exclusions and any output or spending limit reached.

A missing or conflicting cost is returned as `null`. Those permits are excluded when the minimum cost is greater than zero. Records with conflicting latest statuses are excluded as well.

### Pricing and limits

You pay $0.001 for each permit saved, plus the $0.00005 start fee. A run with no matches has no permit charge. The same permit returned in two separate runs is charged in each run. You can set **Maximum cost per run** in Apify; the dataset and CSV stop at that limit.

A scan that exceeds `maxSourceRows` fails with a request to narrow the dates. It does not export a partially grouped list. There is no permit charge for that failed scan; the start fee still applies. Apify may charge standard storage and data-access fees after a run.

### Before using the list

A filing can describe a new fit-out, routine repairs or work that already has a contractor. It does not establish an open tender, an available contract or an opening date. Estimated cost is not a confirmed budget. This Actor does not provide owner or contractor contact details.

Results cover San Francisco only. Statuses reflect the source at collection time, even when you search older filing dates. Overlapping date ranges can return the same permits again; there is no cross-run change tracking in this version.

### Data source

Records come from the city's [DataSF Building Permits dataset](https://data.sf.gov/Housing-and-Buildings/Building-Permits/i98e-djp9), published under the [Public Domain Dedication and License](https://opendatacommons.org/licenses/pddl/1-0/). The data is publicly available for free; this Actor charges for filtering, grouping and exporting it.

The city refreshes the dataset regularly, but records can be delayed or corrected. Check the linked source before acting on a result. This is an independent tool, not an official City and County of San Francisco service.

If a result looks wrong, open an issue with the run ID and permit number so the source record can be checked.

# Actor input Schema

## `lookbackDays` (type: `integer`):

Used when dateFrom is omitted. Includes the end date.

## `dateFrom` (type: `string`):

Optional YYYY-MM-DD. Uses the filing date, not the issue date.

## `dateTo` (type: `string`):

Optional YYYY-MM-DD; defaults to today in UTC. Both dates are inclusive.

## `categories` (type: `array`):

Uses the proposed building use; falls back to existing use only when proposed use is absent.

## `statuses` (type: `array`):

Completed, withdrawn, canceled, and ambiguous statuses are excluded.

## `minEstimatedCost` (type: `number`):

Unknown or conflicting costs are excluded when positive. Set 0 to include them, marked as null.

## `keywords` (type: `array`):

Optional literal text matches. Any keyword can match. Case insensitive.

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

Maximum unique permits returned after all filters, newest filing first.

## `maxSourceRows` (type: `integer`):

Safety bound before deduplication. Exceeding it fails the run with instructions to narrow dates; no partial results are emitted.

## Actor input object example

```json
{
  "lookbackDays": 30,
  "categories": [
    "office",
    "retail",
    "food",
    "fitness",
    "beauty",
    "medical",
    "hospitality",
    "industrial"
  ],
  "statuses": [
    "filed",
    "approved",
    "issued"
  ],
  "minEstimatedCost": 10000,
  "keywords": [],
  "maxItems": 100,
  "maxSourceRows": 5000
}
```

# Actor output Schema

## `permits` (type: `string`):

No description

## `csv` (type: `string`):

No description

## `summary` (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 = {
    "lookbackDays": 30,
    "categories": [
        "office",
        "retail",
        "food",
        "fitness",
        "beauty",
        "medical",
        "hospitality",
        "industrial"
    ],
    "statuses": [
        "filed",
        "approved",
        "issued"
    ],
    "minEstimatedCost": 10000,
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("cemented_jest/sf-commercial-permit-watchlist").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 = {
    "lookbackDays": 30,
    "categories": [
        "office",
        "retail",
        "food",
        "fitness",
        "beauty",
        "medical",
        "hospitality",
        "industrial",
    ],
    "statuses": [
        "filed",
        "approved",
        "issued",
    ],
    "minEstimatedCost": 10000,
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("cemented_jest/sf-commercial-permit-watchlist").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 '{
  "lookbackDays": 30,
  "categories": [
    "office",
    "retail",
    "food",
    "fitness",
    "beauty",
    "medical",
    "hospitality",
    "industrial"
  ],
  "statuses": [
    "filed",
    "approved",
    "issued"
  ],
  "minEstimatedCost": 10000,
  "maxItems": 100
}' |
apify call cemented_jest/sf-commercial-permit-watchlist --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cemented_jest/sf-commercial-permit-watchlist"
        }
    }
}
```

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/e7cEkc4frdT2DVHlP/builds/wmDjdwYjlaK6EK3iI/openapi.json
