San Francisco Open Data Scraper
Pricing
from $25.72 / 1,000 results
San Francisco Open Data Scraper
Scrapes any dataset from data.sfgov.org by its 4x4 ID. Returns each row as a flat record with optional SoQL filtering, column selection, and full-text search.
Pricing
from $25.72 / 1,000 results
Rating
0.0
(0)
Developer
ParseForge
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
0
Monthly active users
14 days ago
Last modified
Categories
Share
San Francisco Open Data Scraper
Scrape any dataset from San Francisco's open data portal, up to a million rows per run. Pull building permits, 311 cases, police incidents, business registrations, and hundreds more. Filter with SoQL, select columns, and export to CSV, JSON, Excel, or XML.
San Francisco's open data portal holds thousands of public datasets, but downloading them manually means clicking through a browser, hitting row limits, and repeating for every update. This Actor reads directly from the Socrata API behind data.sfgov.org, so you can pull the exact rows you need with a single run. No browser, no manual exports, no API key registration.
| Who uses it | What they scrape San Francisco Open Data for |
|---|---|
| Urban planners | Tracking new building permits and development pipeline changes across neighborhoods. |
| Data journalists | Pulling police incident reports or 311 cases for public safety investigations. |
| Real estate analysts | Monitoring eviction notices and registered business locations for market trends. |
| Civic hackers | Feeding live city data into dashboards and community tools. |
What it does
This Actor collects any dataset hosted on data.sfgov.org by its 4x4 ID and returns each row as a flat record.
- 📋 Any public dataset: choose from over 500 datasets including building permits, 311 cases, police incidents, parking citations, food trucks, and business registrations.
- 🔍 SoQL filtering: pass a $where clause to filter rows server-side before they reach your dataset.
- 📊 Column selection: specify a $select list to return only the fields you need.
- 📈 Sort control: add an $order clause to sort results by any column, ascending or descending.
- 🔎 Full-text search: use the query parameter to search across all string columns in the dataset.
Results export to CSV, JSON, Excel, or XML, or straight from the API.
What you can do with San Francisco Open Data data
🏗️ Monitor new construction.
A real estate analyst pulls the building permits dataset weekly, filters by 'issued' status and neighborhood, and feeds the results into a market report.
📰 Investigate public safety trends.
A data journalist scrapes police incident reports filtered by date range and category to map crime patterns for a story.
📞 Track city service requests.
A neighborhood advocate collects 311 cases by district and complaint type to measure response times and identify recurring issues.
🚚 Find food truck locations.
A developer pulls the mobile food facility permit dataset to power a real-time map of active food trucks in the city.
Why choose this scraper
| What you get | |
|---|---|
| No API key | Reads public Socrata endpoints directly, no registration needed |
| Server-side filters | SoQL $where, $select, $order, and $query reduce data before transfer |
| Fixed schema | Every row from a given dataset arrives with the same columns every run |
| Multi-format export | Download as CSV, JSON, Excel, XML, or push to a database |
How it compares
No other Store actor targets San Francisco Open Data the same way, so the honest comparison is with the alternatives teams actually weigh.
| San Francisco Open Data Scraper | Build it in-house | By hand | |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When San Francisco 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, and optionally narrow 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:
{"datasetId": "3pee-9qhc","maxItems": 10}
A larger pull:
{"datasetId": "3pee-9qhc","maxItems": 200}
Pricing
Pay-per-result: $0.0343 per result collected. You pay only for the results written to your dataset.
| Results collected | Approximate cost |
|---|---|
| 100 results | $3.43 |
| 1,000 results | $34.30 |
| 10,000 results | $343.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 to collect up to 1,000,000 results per run.
Run it
- Create a free Apify account with $5 in credit.
- Open the San Francisco Open Data Scraper.
- Set your inputs and any filters, then click Start.
- Export the results as CSV, Excel, JSON, or XML from the Dataset tab.
Run it programmatically through the Apify API (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.
Use with AI agents (MCP)
Give an AI agent live access to San Francisco Open Data through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:
$claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/sf-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 is case-sensitive and uses single quotes for strings. Try removing the filter to confirm the dataset itself returns rows, then add conditions back one at a time.
Why does my run time out?
Large datasets with many columns can take time. Try reducing maxItems, using $select to request fewer columns, or adding a $where filter to narrow the result set.
Why are some columns missing from my output?
If you used the $select parameter, only those columns are returned. Remove $select to get all columns. Also note that some datasets have computed columns that only appear when requested by name.
Why do I get an error about an invalid dataset ID?
The 4x4 ID must match exactly. Copy it from the dataset URL on data.sfgov.org. The ID is the part after '/d/' in the URL, like 'i98e-djp9'.
Why is my $order clause not working?
Column names in $order are case-sensitive. Check the exact column name from the dataset's metadata. Use 'column_name ASC' or 'column_name DESC' syntax.
FAQ
| Question | Answer |
|---|---|
| Do I need an API key or token to use this? | No. The Actor reads from the public Socrata API endpoints, so no registration or authentication is required. |
| How do I find the dataset ID I need? | Browse data.sfgov.org, open the dataset you want, and copy the 4x4 ID from the URL. It looks like 'i98e-djp9' for building permits. The input dropdown also lists over 500 common datasets by name. |
| Can I filter rows before downloading? | Yes. Use the $where field with a SoQL clause like "status='issued'" to filter server-side. You can also use $select to pick columns and $order to sort. |
| What is the maximum number of rows I can get? | You can set maxItems up to 1,000,000 per run. The Socrata API itself may impose its own limits on very large datasets, but the Actor will fetch as many as allowed. |
| Which datasets are available? | Over 500 datasets from data.sfgov.org, including building permits, 311 cases, police incidents, business registrations, eviction notices, parking citations, food trucks, and many more. The input dropdown lists them all. |
| Can I search within a dataset for specific text? | Yes. The query parameter performs a full-text search across all string columns in the dataset, returning only rows that match. |
| What output formats are supported? | You can export results as CSV, JSON, Excel, or XML from the dataset tab, or push them directly to a database or storage integration. |
| Does this work with datasets that have geographic columns? | Yes. Geographic columns like points and polygons are returned in their native format. You can filter them with SoQL spatial functions in the $where clause. |
| How often is the data updated? | The Actor pulls live data from the Socrata API on every run. The freshness depends on how often the City updates each dataset, which varies by department. |
| Can I scrape multiple datasets in one run? | The Actor processes one dataset ID per run. To collect multiple datasets, run the Actor multiple times with different dataset IDs, or use an Apify workflow. |
Related actors
Browse the full ParseForge collection 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 and County of San Francisco. 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.
