Municode Records Scraper
Pricing
from $5.00 / 1,000 municode records
Municode Records Scraper
Search public Municode Library pages for municipal code sections, ordinances, and documents. Return source URLs, titles, sections, excerpts, and optional full text for legal research and compliance workflows.
Pricing
from $5.00 / 1,000 municode records
Rating
0.0
(0)
Developer
Muhammad Afzal
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
1
Monthly active users
9 days ago
Last modified
Categories
Share
Search the public Municode Library for code sections, ordinances, and municipal documents, or scrape known public Municode pages. Built for legal researchers, local-government teams, compliance analysts, and data pipelines that need source-attributed municipal records.
Example
{"searchQueries": ["short-term rental"],"municipality": "Riverside","state": "CA","maxItems": 10,"includeFullText": false}
startUrls accepts public https://library.municode.com/… pages and can be used without a search query. Each dataset item includes the source URL, municipality/state when inferable, content type, title, section, matched excerpt, and optional visible full text.
Pricing
| Event | Price | When charged |
|---|---|---|
| Actor start | $0.01 | Once per run, with platform usage rules applying |
| Municode record | $0.005 | Each unique record successfully written to the dataset |
maxItems is a hard result and cost ceiling. For example, maxItems: 25 allows at most $0.125 in result-event charges, plus the start event and any platform usage passed through by Apify. The run status and SUMMARY record report saved versus charged records.
The Actor only accesses public Municode Library pages. It does not bypass authentication, CAPTCHAs, paywalls, robots controls, or access restrictions. Municode pages may contain legal text that is amended or incomplete; verify important conclusions against the municipality and the source page.
Local development
npm installnpm test
Use cases
- Schedule repeatable collection and export results to downstream workflows.
- Run a one-off research job and export the structured result as JSON, CSV, Excel, XML, or RSS from Apify.
- Schedule the same input to monitor changes over time and send completed datasets to a webhook or integration.
- Feed schema-shaped records into a database, spreadsheet, BI tool, or AI workflow with the source URL retained for verification.
Input
| Field | Type | Description |
|---|---|---|
searchQueries | array | Keywords, phrases, or section numbers to search in the public Municode Library. Example: short-term rental. |
municipality | string | Optional municipality name used to narrow search results, for example Riverside. Leave blank to search across the Municode Library. |
state | string | Optional two-letter US state abbreviation used with the municipality filter, for example CA. |
startUrls | array | Optional direct public Municode Library URLs, such as https://library.municode.com/ca/riverside/codes/code_of_ordinances. These are scraped in addition to search results. |
maxItems | integer | Maximum unique records to save. Start small; each result is one source-attributed record. |
includeFullText | boolean | When enabled, include the visible text of each linked code or ordinance page. This can make records larger and slower. |
Output example
{"municipality": "Example municipality","state": "Example state","contentType": "Example contentType","title": "Example title","section": "Example section","matchedText": "Example matchedText","fullText": "Example fullText","url": "Example url","searchQuery": "Example searchQuery","source": "Example source","scrapedAt": "Example scrapedAt"}
The exact fields depend on the selected input and what the public source exposes. Use the dataset schema as the machine-readable contract and retain source URLs for verification.
Run Municode Records Scraper with the Apify API
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const run = await client.actor('muhammadafzal/municode-records-scraper').call({"searchQueries": ["short-term rental"],"startUrls": [],"maxItems": 25,"includeFullText": false});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items);
You can also run the Actor from Apify Console, schedules, webhooks, the REST API, Make, Zapier, n8n, or the hosted Apify MCP server.
Reliability and limitations
Public websites and upstream APIs change over time. Start with a small result limit, inspect the dataset and run log, and keep a known-good input for scheduled canary runs. A valid query can return no records when the source has no matches. If a run is blocked, rate-limited, or missing an expected field, reduce concurrency or scope where the input supports it and include the run ID in a support report.
The Actor does not guarantee that every optional field is present on every record. Treat absent values as unavailable from that source response, not as proof that the real-world value does not exist.
Frequently asked questions
Can I schedule Municode Records Scraper?
Yes. Use an Apify schedule to run the same saved input at a chosen interval, then connect a webhook or integration to process the dataset when the run finishes.
How should I test a new input?
Begin with the prefilled example or a small limit. Confirm that the output fields, source coverage, runtime, and live charges match your workflow before increasing the scope.
How do I export the results?
Open the run's default dataset in Apify Console and export JSON, CSV, Excel, XML, or RSS. Applications can retrieve the same records through the Apify API client or REST dataset endpoint.
Can an AI agent call this Actor?
Yes. Add muhammadafzal/municode-records-scraper through the hosted Apify MCP server or call it through the API. The Actor's input and dataset schemas help agents construct valid requests and interpret returned records.