# MD Prince George's County Permits (`j0401/md-pg-permits`) Actor

Prince George's County, MD permit register (~461k, 2013-present, open data): largest county permit record in Maryland. Building/health/site-road permits by DPIE agency, address, city, type, year, cost. Case number, project name, issue date, cost where recorded. Historical archive - dense 2013-2023.

- **URL**: https://apify.com/j0401/md-pg-permits.md
- **Developed by:** [Wenhao Yang](https://apify.com/j0401) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.30 / 1,000 md prince georges county permit records

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Prince George's County (MD) Permits

The largest county permit record in Maryland - the full Prince George's County
permit archive, 2013 to the present. One query API over what was permitted, by
which agency, at which address, and for how much.

### Data

Prince George's County, Maryland open data (public permit register). **~461,000
permits, 2013-present** - construction, health and site/road permits.

Each record is a permit case with:

- **Permit category** - Building Permit (~419k) / Health Permit (~32k) / Site
  Road Permit (~10k)
- **Agency** - DPIE (permits & inspections) issues the overwhelming majority;
  HEALTH / DER / DPW\&T the rest
- **DPIE type code** - the agency's own classification (SGU / TGU / DPIE ER /
  RW / FIRW ...) plus readable type on health permits
- **Case number, project name, address, city, ZIP**
- **Case year and issue date**
- **Expected construction cost** where the county recorded one - most building
  permits carry a value, and the register includes million-dollar projects

A note on the archive's shape, stated plainly: coverage is dense from 2013
through 2023 (tens of thousands of permits a year), then thins sharply - 2024
\~6,500, 2025 ~1,200. This register is the deep historical record of PG County
construction - ideal for property history, case lookups and archive research -
not a real-time feed of new permits. Query it for what it is.

### Low cost

**From $0.0003 per record.**

County permit data arrives as a text-heavy flat table where the construction
cost sits in a text column and most years carry tens of thousands of cases -
fine for the county's own portal, painful for anyone who wants to actually cut
it by type, place or value. We made the archive directly queryable: `category`
/ `agency` / `permitType` / `caseName` / `address` / `city` / `zip` / year
windows / issue-date windows all filter before a record returns, and `groupBy`
(counts by category / agency / type / city / year) comes back as clean server
counts. Cost-range queries sweep whole years and return only cases whose
recorded cost lands in range. You query a permit archive that behaves like a
database; the cleanup stays on our side.

**Every record is one flat JSON object** - no PDFs, no portal pagination, no
scraping.

### Use cases

- **Property / project history** - every permit at an address or for a case
  number, with cost and year
- **County construction analysis** - aggregate what was built, where and by
  which agency across the 2013-2023 archive
- **Diligence** - confirm whether a project was permitted, when, and its
  recorded value

### Inputs

| Field | What it does |
|---|---|
| `permitNumber` | exact case lookup |
| `permitCategory` / `agency` / `permitType` | filter by kind of permit |
| `caseName` / `address` / `city` / `zip` | find by project / place |
| `yearFrom` / `yearTo` | case-year window (archive density 2013-2023) |
| `issuedFrom` / `issuedTo` | issue-date window |
| `minCost` / `maxCost` | recorded-cost range (sweeps whole years; bounded) |
| `aggregate` + `groupBy` | counts by category / agency / type / city / year |

### Output fields

`permitNumber` / `permitCategory` / `countyAgency` / `permitType` /
`permitCaseYear` / `caseName` / `address` / `city` / `zip` / `issuanceDate` /
`cost` / `location`.

> Honesty note: the county records expected construction cost on only ~46% of
> building permits (health and site/road permits carry none). The `cost` field
> is returned only where the county recorded it, never filled in.

Source: Prince George's County open data (permit register, public records).

# Actor input Schema

## `permitNumber` (type: `string`):

Exact permit case ID (e.g. 2623294).

## `permitCategory` (type: `string`):

Filter by permit category: 'Building Permit' (~419k), 'Health Permit' (~32k) or 'Site Road Permit' (~10k).

## `agency` (type: `string`):

County agency. DPIE (Permits & Inspections) issues the vast majority. Blank = all agencies.

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

DPIE type code substring (e.g. 'SGU', 'TGU', 'DPIE ER') or health-permit type words.

## `caseName` (type: `string`):

Project name substring (e.g. 'MEADE NEW SFD').

## `address` (type: `string`):

Street address substring (e.g. '9014 CHESTNUT').

## `city` (type: `string`):

City prefix (e.g. 'Bowie', 'College Park').

## `zip` (type: `string`):

ZIP code (prefix match).

## `yearFrom` (type: `string`):

Permit case year >= this (e.g. 2018). Archive is dense 2013-2023.

## `yearTo` (type: `string`):

Permit case year <= this (e.g. 2020).

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

Only permits issued on/after this date (YYYY-MM-DD).

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

Only permits issued on/before this date (YYYY-MM-DD).

## `minCost` (type: `integer`):

Only permits with expected construction cost >= this. Cost is text in the source and absent on ~54% of permits; a cost query sweeps whole years (without a year window, 2018-present) so is bounded, not a full-corpus scan.

## `maxCost` (type: `integer`):

Only permits with expected construction cost <= this (0 = no upper bound).

## `aggregate` (type: `boolean`):

When on, returns one summary record per group (see groupBy) with a count instead of individual permits.

## `groupBy` (type: `string`):

Which dimension to aggregate over. year = permit case year (shows the 2013-2023 archive density).

## `maxResults` (type: `integer`):

Cap the number of records pushed (0 = up to ~10k per run; each record is metered individually, so there is no per-run charge cap). Aggregates have few hundred groups max.

## Actor input object example

```json
{
  "permitNumber": "",
  "permitCategory": "",
  "permitType": "",
  "caseName": "",
  "address": "",
  "city": "",
  "zip": "",
  "yearFrom": "",
  "yearTo": "",
  "issuedFrom": "",
  "issuedTo": "",
  "minCost": 0,
  "maxCost": 0,
  "aggregate": false,
  "groupBy": "category",
  "maxResults": 200
}
```

# Actor output Schema

## `recordsUrl` (type: `string`):

Prince George's County permit records or aggregates - as JSON

## `datasetUrl` (type: `string`):

No description

## `runUrl` (type: `string`):

No description

# 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("j0401/md-pg-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("j0401/md-pg-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 j0401/md-pg-permits --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,j0401/md-pg-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/XHIPBSaCuHysYqSmp/builds/bVqWSuOGy7o2YvK8b/openapi.json
