# Calgary Electrical Permits Scraper (`coder_zoro/calgary-electrical-permits-scraper`) Actor

This Actor collects public electrical and building permit records from the City of Calgary open-data portal. It extracts permit numbers, property addresses, work descriptions, application and issue dates, statuses, and contractor details to support lead generation, market research

- **URL**: https://apify.com/coder_zoro/calgary-electrical-permits-scraper.md
- **Developed by:** [Zoro](https://apify.com/coder_zoro) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Calgary Electrical Permits Scraper

![Calgary Electrical Permits Scraper cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/calgary-electrical-permits-scraper-cover.png)

### Calgary Electrical Permits Scraper — Contractor and Permit Records

Collect publicly available electrical permit records from the City of Calgary open data portal. Retrieve permit numbers, addresses, inspection details, applicants, contractors, and permit statuses for contractor research, lead generation, and data analysis.

### What This Actor Does

The Calgary Electrical Permits Scraper collects records from the City's public Electrical Permits dataset.

It supports filtered searches and full dataset exports. You can search by keyword, apply custom filters, and control how many records are collected in each run.

The actor preserves available dataset fields and stores the source record identifier as `recordId` to avoid conflicts with reserved field names.

### Features

- Collect Calgary electrical permit records.
- Search records using full-text keywords.
- Filter records using custom conditions.
- Export the full dataset up to your configured limit.
- Retrieve contractor and applicant information.
- Collect permit statuses, addresses, and inspection details.
- Preserve additional available dataset fields.
- Control the maximum number of records per run.
- Export results in JSON, CSV, and Excel formats.
- Schedule recurring collections with Apify.

### Collection Modes

**1. Dataset Query (`query`)**

Searches and filters electrical permit records using optional conditions and keywords.

**2. Full Export (`full_export`)**

Collects records from the public dataset without requiring search filters, up to the configured maximum item limit.

### Input Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `mode` | String | Yes | `query` | Collection mode: `query` or `full_export`. |
| `where` | String | No | Empty | Optional filter condition for selecting records. |
| `search` | String | No | Empty | Full-text search keyword. |
| `orderBy` | String | No | `:id` | Field used to order collected records. |
| `maxItems` | Integer | No | 100 | Maximum number of records to collect. Up to 1,000. |
| `requestDelayMs` | Integer | No | 1000 | Delay between requests in milliseconds. |

### Example Input

Search by keyword:

```json
{
  "mode": "query",
  "search": "CRESTVIEW",
  "maxItems": 50,
  "orderBy": ":id",
  "requestDelayMs": 1000
}
```

Filter completed permits:

```json
{
  "mode": "query",
  "where": "statuscurrent='Completed'",
  "maxItems": 25,
  "requestDelayMs": 1000
}
```

Filter by contractor:

```json
{
  "mode": "query",
  "where": "contractor='CRESTVIEW ELECTRIC'",
  "maxItems": 50
}
```

Full dataset export:

```json
{
  "mode": "full_export",
  "maxItems": 100,
  "orderBy": ":id",
  "requestDelayMs": 1000
}
```

### What Data Does This Actor Extract?

Each dataset record can include the following fields:

| Field | Description |
|---|---|
| `permitnum` | Electrical permit number. |
| `workclassgroup` | Permit work classification. |
| `statuscurrent` | Current permit status. |
| `originaladdress` | Property or worksite address. |
| `issueddate` | Date the permit was issued. |
| `completeddate` | Permit completion date. |
| `inspectiontype` | Type of inspection. |
| `outcome` | Inspection outcome. |
| `recordId` | Unique source record identifier. |
| `applicant` | Applicant name. |
| `applicanttype` | Applicant classification. |
| `contractor` | Contractor name. |
| `inspectiontypecode` | Inspection type code. |
| `objectdefdescription` | Description of the inspection activity. |
| `scrapedAt` | Date and time the record was collected. |

Additional available source fields are preserved when present.

### Example Output

```json
{
  "permitnum": "EP2018-13089",
  "workclassgroup": "New",
  "statuscurrent": "Completed",
  "originaladdress": "4501 BRISEBOIS DR NW",
  "issueddate": "2018-07-30T00:00:00.000",
  "completeddate": "2019-01-18T09:16:05.000",
  "inspectiontype": "Rough",
  "outcome": "VOC",
  "recordId": "EP2018-13089-182915947",
  "applicant": "CRESTVIEW ELECTRIC",
  "applicanttype": "Contractor",
  "contractor": "CRESTVIEW ELECTRIC",
  "inspectiontypecode": "ElectricalRough",
  "objectdefdescription": "Perform Electrical Inspection",
  "scrapedAt": "2026-10-26T00:00:00+00:00"
}
```

### Use Cases

- **Contractor lead generation:** Identify electrical contractors and applicants associated with Calgary permits.
- **Permit status monitoring:** Find completed or other permit records using custom filters.
- **Address research:** Explore electrical permit activity by property address or neighborhood.
- **Inspection analysis:** Review inspection types, outcomes, and completion dates.
- **Bulk data research:** Export larger collections for offline analysis.
- **Scheduled monitoring:** Refresh permit records periodically using Apify Schedules.

### Working with Your Dataset

After the actor finishes, open the Apify Dataset tab to review your collected permit records.

Export the results in JSON, CSV, Excel, and other supported Apify dataset formats. Use the exported records for contractor research, reporting, lead management, and spreadsheet analysis.

You can also configure an Apify schedule to run the actor automatically.

### FAQ

**Who is this actor for?**

Contractor researchers, marketers, analysts, developers, and real estate professionals interested in Calgary electrical permit records.

**Can I search for a specific contractor?**

Yes. Use the `where` parameter to filter by contractor name or the `search` parameter for full-text searches.

**Can I filter permits by status?**

Yes. For example, use `statuscurrent='Completed'` in the `where` parameter.

**What is the difference between query and full export?**

Query mode lets you apply search terms and filters. Full export collects records without requiring those filters.

**How many records can I collect?**

The default maximum is 100 records per run, with a maximum of 1,000.

**Can I export the results to Excel?**

Yes. You can export your dataset in Excel, CSV, JSON, and other supported formats.

**Can I schedule automatic collections?**

Yes. Use Apify Schedules to refresh your dataset at your preferred intervals.

### Disclaimer

This actor is an independent tool and is not affiliated with, endorsed by, sponsored by, or officially associated with the City of Calgary. It collects information from publicly available sources. Users are responsible for complying with applicable source terms, licensing conditions, and attribution 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 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 scrape. Query applies optional SoQL filters. Full export pages the dataset until maxItems.

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

SoQL $where clause, e.g. statuscurrent='Completed' or contractor='CRESTVIEW ELECTRIC'.

## `search` (type: `string`):

Full-text $q search across text columns.

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

SoQL $order. Keep :id for stable paging.

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

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

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

Polite pacing in milliseconds. Default 1000 (~1 request/second).

## `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": "query",
  "where": "statuscurrent='Completed'",
  "search": "CRESTVIEW",
  "orderBy": ":id",
  "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 = {
    "search": "CRESTVIEW"
};

// Run the Actor and wait for it to finish
const run = await client.actor("coder_zoro/calgary-electrical-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 = { "search": "CRESTVIEW" }

# Run the Actor and wait for it to finish
run = client.actor("coder_zoro/calgary-electrical-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 '{
  "search": "CRESTVIEW"
}' |
apify call coder_zoro/calgary-electrical-permits-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,coder_zoro/calgary-electrical-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/yzoftDrndj35pOM35/builds/Za44dbfp8jTkoPKsj/openapi.json
