{
  "openapi": "3.0.1",
  "info": {
    "title": "MD Prince George's County Permits",
    "description": "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.",
    "version": "0.0",
    "x-build-id": "bVqWSuOGy7o2YvK8b"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~md-pg-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-md-pg-permits",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/j0401~md-pg-permits/runs": {
      "post": {
        "operationId": "runs-sync-j0401-md-pg-permits",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/j0401~md-pg-permits/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-md-pg-permits",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "permitNumber": {
            "title": "Permit case number",
            "type": "string",
            "description": "Exact permit case ID (e.g. 2623294).",
            "default": ""
          },
          "permitCategory": {
            "title": "Permit category",
            "type": "string",
            "description": "Filter by permit category: 'Building Permit' (~419k), 'Health Permit' (~32k) or 'Site Road Permit' (~10k).",
            "default": ""
          },
          "agency": {
            "title": "Agency",
            "enum": [
              "DPIE",
              "HEALTH",
              "DER",
              "DPW&T"
            ],
            "type": "string",
            "description": "County agency. DPIE (Permits & Inspections) issues the vast majority. Blank = all agencies."
          },
          "permitType": {
            "title": "Permit type code",
            "type": "string",
            "description": "DPIE type code substring (e.g. 'SGU', 'TGU', 'DPIE ER') or health-permit type words.",
            "default": ""
          },
          "caseName": {
            "title": "Project / case name",
            "type": "string",
            "description": "Project name substring (e.g. 'MEADE NEW SFD').",
            "default": ""
          },
          "address": {
            "title": "Street address",
            "type": "string",
            "description": "Street address substring (e.g. '9014 CHESTNUT').",
            "default": ""
          },
          "city": {
            "title": "City",
            "type": "string",
            "description": "City prefix (e.g. 'Bowie', 'College Park').",
            "default": ""
          },
          "zip": {
            "title": "ZIP",
            "type": "string",
            "description": "ZIP code (prefix match).",
            "default": ""
          },
          "yearFrom": {
            "title": "Case year from",
            "type": "string",
            "description": "Permit case year >= this (e.g. 2018). Archive is dense 2013-2023.",
            "default": ""
          },
          "yearTo": {
            "title": "Case year to",
            "type": "string",
            "description": "Permit case year <= this (e.g. 2020).",
            "default": ""
          },
          "issuedFrom": {
            "title": "Issued on or after",
            "type": "string",
            "description": "Only permits issued on/after this date (YYYY-MM-DD).",
            "default": ""
          },
          "issuedTo": {
            "title": "Issued on or before",
            "type": "string",
            "description": "Only permits issued on/before this date (YYYY-MM-DD).",
            "default": ""
          },
          "minCost": {
            "title": "Minimum construction cost ($)",
            "minimum": 0,
            "type": "integer",
            "description": "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.",
            "default": 0
          },
          "maxCost": {
            "title": "Maximum construction cost ($)",
            "minimum": 0,
            "type": "integer",
            "description": "Only permits with expected construction cost <= this (0 = no upper bound).",
            "default": 0
          },
          "aggregate": {
            "title": "Aggregate instead of records",
            "type": "boolean",
            "description": "When on, returns one summary record per group (see groupBy) with a count instead of individual permits.",
            "default": false
          },
          "groupBy": {
            "title": "Aggregate by",
            "enum": [
              "category",
              "agency",
              "permitType",
              "city",
              "year"
            ],
            "type": "string",
            "description": "Which dimension to aggregate over. year = permit case year (shows the 2013-2023 archive density).",
            "default": "category"
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 0,
            "type": "integer",
            "description": "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.",
            "default": 200
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}