# Hamilton Building Permits 2017–2023 – Open Data (`loudtzu/hamilton-permits`) Actor

Hamilton, ON building & demolition permits from official open data (~51,800 source rows, 2017–Dec 2023): type, work type, status, issue date, community and more. One clean row per permit, JSON/CSV. City of Hamilton Open Data Licence. No addresses. $0.003 per permit, no start fee.

- **URL**: https://apify.com/loudtzu/hamilton-permits.md
- **Developed by:** [Travis M](https://apify.com/loudtzu) (community)
- **Categories:** Business, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 permit results

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

## Hamilton Building Permits 2017–2023 – Open Data

**Building & Demolition Permits for Hamilton only**, from the city's official open dataset (~51,800 source rows, 2017–Dec 2023), via the ArcGIS REST API — no website scraping. **Historical only: the City's feed ends at 2023-12-22.**

- **Key fields:** `permitNumber`, `permitType`, `workType`, `status`, `issuedDate`, `community`, `postalCode`.
- **Licence:** City of Hamilton Open Data Licence; every record carries the required credit and licence link.
- **Output:** structured JSON, or CSV / Excel from the Apify dataset. Filters run at the source (type, status, issued dates and more), up to 50,000 permits per run.
- **Privacy:** street addresses and free-text descriptions removed; postal codes cut to FSA and coordinates rounded to ~1 km where present.

**Why not build it yourself?** No ArcGIS/Socrata paging, field mapping, date normalising or de-duplication to write and maintain. You get one tidy row per permit with consistent field names and ISO dates.

**Price:** $0.003 per result (three-tenths of a cent; 1,000 results = $3.00), no start fee. You pay only for permits returned.

### What it does

This Actor reads **historical building and demolition permits** from the City of Hamilton's official open dataset ([Hamilton open data](https://open.hamilton.ca/datasets/12c2ec7de2d3458c861c699dd724f337), about 51,800 source rows) through the ArcGIS REST query API. It does **not** scrape any website. **Historical data:** the City's feed ends at 2023-12-22.

Rows are deduplicated so you get one record per permit number.

#### Free open data vs. this Actor

The dataset is free on the Hamilton open-data portal. Use that for a one-off download. This Actor is for:

- **Filters at the source:** permit type, status, issued dates, keyword
- **Clean JSON:** ISO dates, consistent field names, one row per permit
- **Privacy trimming:** no street addresses, no free-text descriptions, no names
- **Scheduled runs** and Apify API / Sheets / Make / Zapier exports

### Who it's for

- Planners, housing and urban researchers measuring construction and land-use activity
- Analysts and journalists tracking building and demolition permits over time
- Teams building dashboards on official municipal open data

### What data you get

| Field | Meaning |
|---|---|
| `permitNumber` | City permit number |
| `permitType` | Permit type / class |
| `workType` | Kind of work |
| `status` | Permit status |
| `applicationDate` | YYYY-MM-DD |
| `issuedDate` | YYYY-MM-DD |
| `completedDate` | YYYY-MM-DD |
| `community` | Community / former municipality |
| `postalCode` | Postal code |
| `source` | Source portal |
| `licence` | The City's required attribution statement, plus the licence link |

### Input

| Field | Key | Notes |
|---|---|---|
| Permit type contains | `permitType` | e.g. Single Family Dwelling, Multiple Dwelling (case-insensitive). |
| Work type contains | `workType` | e.g. Alteration, New Construction, Partial Demolition. |
| Status contains | `status` | e.g. Closed, Issued. |
| Issued on/after (YYYY-MM-DD) | `issuedFrom` | Optional start date. |
| Issued on/before (YYYY-MM-DD) | `issuedTo` | Optional end date. |
| Keyword | `keyword` | Server-side filter on permit class, work class and permit number. |
| Max permits | `maxItems` | Stop after this many permits. |

Bad dates or an inverted date range fail before any API call, with a clear error.

Example input:

```json
{"permitType": "Single Family Dwelling", "issuedFrom": "2022-01-01", "maxItems": 200}
```

### Pricing

Pay per result: **$0.003 per permit result** (one result = one permit), with no start fee. You pay only for permits returned.

### Licence and privacy

- **Licence:** [City of Hamilton Open Data Licence](https://www.hamilton.ca/city-council/data-maps/open-data/open-data-licence-terms-and-conditions). The licence grants a worldwide, royalty-free licence to use the Data "including for commercial purposes" and to copy, modify, publish, adapt and distribute it. You must include the attribution statement "Contains public sector Data made available under the City of Hamilton’s Open Data Licence", which every record carries. The licence does not cover personal information.
- **No endorsement:** this Actor is independent. It does not suggest any official status or City of Hamilton endorsement and does not use City names, crests or logos as branding.
- **Privacy:** The output is reduced, not anonymous: permit numbers can be looked up in City records and may be tied to a property, and a permit can still relate to an identifiable homeowner. Street addresses (civic number, street name and unit) and free-text work descriptions are removed. Postal codes, where present, are cut to the first 3 characters (FSA). Owner, applicant and contractor names are not exported. Records still include permit number, permit type, work type, status, application/issue/completion dates, community and postal FSA. Also not exported: the province column (always ON). The source has no owner, applicant or contractor name fields.

### Limits

- Coverage is the City of Hamilton only.
- **The source feed appears frozen:** despite its "2017 to Present" title, the newest issue date in the City's layer is 2023-12-22 (checked Oct 16, 2026). Treat this as a 2017–2023 historical dataset unless the City resumes updates.
- Data freshness and completeness match the Hamilton open-data feed. This Actor does not add or correct permits.
- Max 50,000 permits per run. Pages of 1,000 with a 1 s pause between pages.
- Fields can be null when the source left them blank.

### FAQ

**Is this scraping?** No. It queries the city's public ArcGIS REST API.

**Does it include owner or applicant names or addresses?** No. Street addresses and descriptions are removed to reduce the link to a specific home. The output is reduced, not anonymous.

**Can I use it commercially?** Yes. The City of Hamilton Open Data Licence allows commercial use with the City's attribution statement (in every record). Don't imply City endorsement or misrepresent the data.

# Actor input Schema

## `permitType` (type: `string`):

e.g. Single Family Dwelling, Multiple Dwelling (case-insensitive).

## `workType` (type: `string`):

e.g. Alteration, New Construction, Partial Demolition.

## `status` (type: `string`):

e.g. Closed, Issued.

## `issuedFrom` (type: `string`):

Optional start date.

## `issuedTo` (type: `string`):

Optional end date.

## `keyword` (type: `string`):

Server-side filter on permit class, work class and permit number.

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

Stop after this many permits.

## Actor input object example

```json
{
  "maxItems": 100
}
```

# Actor output Schema

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

All permits returned by the run, shown in the 'overview' table view of the default dataset.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("loudtzu/hamilton-permits").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("loudtzu/hamilton-permits").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 '{}' |
apify call loudtzu/hamilton-permits --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,loudtzu/hamilton-permits"
        }
    }
}
```

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/66vOy1nYuTExvULKu/builds/zVrxF8haSbsqJT9c6/openapi.json
