# Sonoma County Rebuild Permits Scraper (`bigibyte/sonoma-county-rebuild-permits-scraper`) Actor

Sonoma County Rebuild Permits Scraper is a Python tool to extract rebuild permit numbers, issue dates, fire damage recovery tags, parcel numbers, valuation estimates, and site addresses from county permit portals. It exports structured disaster recovery datasets into clean CSV or JSON format

- **URL**: https://apify.com/bigibyte/sonoma-county-rebuild-permits-scraper.md
- **Developed by:** [BigiByte](https://apify.com/bigibyte) (community)
- **Features:** Limited permissions
- **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

### Sonoma County Rebuild Permits Scraper — Rebuild Permit and Property Records

![Sonoma County Rebuild Permits Scraper cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/sonoma-county-rebuild-permits-scraper-cover.png)

Collect publicly available rebuild permit records from Sonoma County, California. Search records by keyword, apply custom filters, or retrieve the newest permits. Export the collected data as JSON, CSV, Excel, and other supported dataset formats.

### Overview

The Sonoma County Rebuild Permits Scraper collects records from the County of Sonoma open data portal.

It provides permit information such as record IDs, opening dates, permit types, statuses, categories, property addresses, parcel numbers, and associated rebuild events.

The actor supports three collection modes: search, filter, and latest.

### Features

- Collect Sonoma County rebuild permit records.
- Search across text fields using keywords.
- Filter records with custom conditions.
- Retrieve newest records first.
- Set a maximum number of records.
- Export results in JSON, CSV, Excel, and other supported formats.

### Collection Modes

| Mode | Description |
|---|---|
| `search` | Searches records using the supplied text across searchable text fields. |
| `filter` | Applies a custom filter condition to retrieve matching records. |
| `latest` | Sorts records by `date_opened` in descending order to retrieve the newest records first. |

### Input Parameters

| Parameter | Description |
|---|---|
| `mode` | Collection mode: `search`, `filter`, or `latest`. |
| `searchText` | Keyword used in search mode. |
| `where` | Custom filter condition used in filter mode. |
| `maxItems` | Maximum number of records to collect. |
| `requestDelayMs` | Delay between requests in milliseconds. |

### Input Examples

**Latest permits**

```json
{
  "mode": "latest",
  "maxItems": 50,
  "requestDelayMs": 1000
}
```

**Search by location**

```json
{
  "mode": "search",
  "searchText": "Santa Rosa",
  "maxItems": 25,
  "requestDelayMs": 1000
}
```

**Filter by permit status**

```json
{
  "mode": "filter",
  "where": "permit_status = 'Issued'",
  "maxItems": 25,
  "requestDelayMs": 1000
}
```

### What Data Does This Actor Extract?

The actor collects the following fields:

| Field | Description |
|---|---|
| `record_id` | Unique permit record identifier. |
| `date_opened` | Date the permit record was opened. |
| `record_type` | Type of permit record. |
| `permit_status` | Current recorded permit status. |
| `category` | Permit category. |
| `permit_description` | Description of the permitted work. |
| `units` | Number of units recorded. |
| `buildings` | Number of buildings recorded. |
| `total_square_feet` | Total recorded building area in square feet. |
| `situs_address` | Property address. |
| `area_id` | Associated area identifier. |
| `supervisors_district` | Supervisorial district. |
| `event_title` | Associated rebuild event or disaster title. |
| `parcel_number` | Property parcel number. |
| `scrapedAt` | Date and time the record was collected. |

### Example Output

```json
{
  "record_id": "BLD17-3907",
  "date_opened": "2017-08-14T00:00:00.000",
  "record_type": "Building Permit With Plan Check",
  "permit_status": "Expired",
  "category": "Accessory Dwelling Unit",
  "permit_description": "Second Unit",
  "units": "1",
  "buildings": "1",
  "total_square_feet": "998",
  "situs_address": "2017 REDWOOD HILL RD, SANTA ROSA, CA 95403",
  "area_id": "Mark West Springs [MWS]",
  "supervisors_district": "District 1",
  "event_title": "2017 Sonoma Complex Fire",
  "parcel_number": "079-100-026",
  "scrapedAt": "2026-10-26T00:00:00+00:00"
}
```

### Use Cases

- **Real Estate Research:** Identify properties associated with rebuild permits.
- **Rebuild Tracking:** Review permit records connected to major rebuilding events.
- **Property Analysis:** Examine permit categories, addresses, parcel numbers, and building details.
- **Market Research:** Analyze rebuilding activity across Sonoma County.
- **Data Analysis:** Export permit records for reporting, filtering, and spreadsheet analysis.

### Working with Your Dataset

After the actor finishes running, collected records are available in the Apify dataset.

You can:

- Preview the collected records.
- Export results as JSON, CSV, or Excel.
- Filter and sort records in your preferred analysis tool.
- Use the collected data for research and reporting.

### FAQ

**Who is this actor for?**

It is designed for analysts, real estate professionals, developers, and researchers who need Sonoma County rebuild permit records.

**What export formats are supported?**

You can export the dataset as JSON, CSV, Excel, and other supported Apify dataset formats.

**Can I run the actor on a schedule?**

Yes. You can configure an Apify schedule to run the actor at your preferred intervals.

**How can I collect the newest permits?**

Select `latest` mode. Records are ordered by `date_opened` in descending order.

**Can I search for permits in a specific location?**

Yes. Use `search` mode and provide a location or other keyword through `searchText`.

**Can I filter permits by status?**

Yes. Use `filter` mode with a condition such as `permit_status = 'Issued'`.

### Pricing and usage limits

Actor compute: The scraper itself is free to run. Usage is billed based on standard Apify compute unit (CU) consumption while running.
Custom limits: You can set maxItems to cap the total number of records processed per run, keeping your costs predictable.
Adjustable delays: Control request timing with requestDelaySecs to stay within rate limits and maintain smooth execution.

### Related tools

If you plan to map or join these rows, a geocoding pass or a quick CSV cleanup are the usual next steps. BigiByte also builds scrapers for other open-data portals when you need them as a separate job.

Need another portal, a scheduled monitor, or a custom pipeline? BigiByte builds custom scrapers and APIs: https://bigibyte.com

### Disclaimer

This actor is an independent tool and is not affiliated with, endorsed by, sponsored by, or officially associated with the County of Sonoma. The collected information comes from publicly available records. Users are responsible for using the data appropriately and respecting applicable terms and requirements.

### Is Web Scraping Legal?

Collecting information that is already public is generally legal. There is no single law that bans all forms of web scraping. The limits are the usual ones: do not break into accounts, do not take private or confidential data, and be careful with personal data and copyrighted works. A site's terms can also restrict how you access it. Facts such as a public name, price, or rating are not the same thing as republishing someone's article or photo.

This actor collects information from public pages. It does not log in and it does not bypass access controls.

For a longer explanation, see Apify's article [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

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

What to fetch. Search uses full-text $q, filter uses SoQL $where, latest orders by date opened descending.

## `searchText` (type: `string`):

Full-text query sent as $q (search mode).

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

Raw SoQL $where clause, e.g. date_opened > '2017-01-01' (filter mode).

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

SoQL $order override, e.g. date_opened DESC. Latest mode defaults to date_opened DESC.

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

Stop after this many successful rows. Hard max is 1000.

## `requestDelayMs` (type: `integer`):

Polite pacing in milliseconds. Raise if you see HTTP 429.

## `userAgent` (type: `string`):

User-Agent header sent with each request.

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

Overall run budget in seconds.

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

Per-request timeout in seconds.

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

Optional proxy. Leave off unless you need it.

## Actor input object example

```json
{
  "mode": "latest",
  "searchText": "Santa Rosa",
  "where": "permit_status = 'Issued'",
  "orderBy": "",
  "maxItems": 100,
  "requestDelayMs": 1000,
  "userAgent": "ActorResearch/1.0",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Dataset rows in the overview table.

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

Full dataset for this run.

## `items` (type: `string`):

Dataset items as JSON.

# 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 = {
    "searchText": "Santa Rosa"
};

// Run the Actor and wait for it to finish
const run = await client.actor("bigibyte/sonoma-county-rebuild-permits-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 = { "searchText": "Santa Rosa" }

# Run the Actor and wait for it to finish
run = client.actor("bigibyte/sonoma-county-rebuild-permits-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 '{
  "searchText": "Santa Rosa"
}' |
apify call bigibyte/sonoma-county-rebuild-permits-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bigibyte/sonoma-county-rebuild-permits-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/Rr9akyNxwaGwkifxc/builds/zn1vIqaqM0eIrUBfn/openapi.json
