{
  "openapi": "3.0.1",
  "info": {
    "title": "Granicus SmartGov Municipal Building Permits & Leads",
    "description": "Multi-tenant scraper for Granicus SmartGov municipal permitting portals (*.smartgovcommunity.com). Extracts commercial, residential, solar, roofing, HVAC, and planning permits with licensed contractor, parcel, fee, and coordinate enrichment plus stateful SEEN_PERMITS delta deduplication.",
    "version": "1.0",
    "x-build-id": "0fExDpfbTH5OrV80W"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zinky_atelier~smartgov-municipal-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zinky_atelier-smartgov-municipal-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/zinky_atelier~smartgov-municipal-permits/runs": {
      "post": {
        "operationId": "runs-sync-zinky_atelier-smartgov-municipal-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/zinky_atelier~smartgov-municipal-permits/run-sync": {
      "post": {
        "operationId": "run-sync-zinky_atelier-smartgov-municipal-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": {
          "jurisdictions": {
            "title": "Pre-Configured SmartGov Jurisdictions",
            "type": "array",
            "description": "Built-in verified SmartGov tenant slugs (e.g. 'co-spokane-wa', 'co-kitsap-wa', 'co-chelan-wa', 'co-coconino-az', 'co-mohave-az', 'co-campbell-va', 'dept-hbc-ky', 'ci-yakima-wa', 'ci-lynnwood-wa', 'ci-kingman-az', 'co-douglas-wa', 'co-graysharbor-wa', 'co-kittitas-wa', 'co-lewis-wa', 'co-sanjuan-wa', 'co-stevens-wa', 'ci-chehalis-wa').",
            "default": [
              "co-spokane-wa",
              "co-kitsap-wa"
            ],
            "items": {
              "type": "string"
            }
          },
          "customHostnames": {
            "title": "Custom SmartGov Hostnames or Slugs (*.smartgovcommunity.com)",
            "type": "array",
            "description": "Any additional *.smartgovcommunity.com portal hostnames, URLs, or tenant slugs (e.g. ['co-chelan-wa.smartgovcommunity.com']).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "title": "Keyword Search (Optional)",
            "type": "string",
            "description": "Full-text keyword query across permit numbers, site addresses, contractor names, and permit types (e.g. 'solar', 'commercial', 'roof', 'ACG BUILDS')."
          },
          "permitTypeFilter": {
            "title": "Permit / Application Type Filter (Optional)",
            "type": "string",
            "description": "Case-insensitive filter on permit type description (e.g. 'Commercial', 'Residential', 'Solar', 'Mechanical', 'Accessory Dwelling Unit')."
          },
          "processState": {
            "title": "Permit Process State (Optional)",
            "enum": [
              "",
              "Pending",
              "TechnicallyComplete",
              "Approved",
              "ReadyToIssue",
              "Issued",
              "Finaled",
              "Closed",
              "Inactive",
              "Expired"
            ],
            "type": "string",
            "description": "Filter by SmartGov workflow state.",
            "default": ""
          },
          "dateField": {
            "title": "Date Filter Field",
            "enum": [
              "SubmittedOn",
              "IssuedOn",
              "FinaledOn"
            ],
            "type": "string",
            "description": "Which milestone date field to filter on in SmartGov Advanced Search.",
            "default": "SubmittedOn"
          },
          "dateWindow": {
            "title": "Relative Date Window",
            "enum": [
              "1D",
              "7D",
              "30D",
              "90D",
              "CM",
              "PM",
              "CY",
              "PY",
              "all"
            ],
            "type": "string",
            "description": "SmartGov relative date range preset (ignored when explicit dateFrom or dateTo is set).",
            "default": "7D"
          },
          "dateFrom": {
            "title": "Custom Start Date (YYYY-MM-DD or MM/DD/YYYY)",
            "type": "string",
            "description": "Optional start date override for the selected dateField (e.g. '2026-10-01')."
          },
          "dateTo": {
            "title": "Custom End Date (YYYY-MM-DD or MM/DD/YYYY)",
            "type": "string",
            "description": "Optional end date override for the selected dateField (e.g. '2026-11-14')."
          },
          "city": {
            "title": "Site City Filter (Optional)",
            "type": "string",
            "description": "Restrict permits to a specific site city (e.g. 'SPOKANE', 'BREMERTON')."
          },
          "zipCode": {
            "title": "Site ZIP Code Filter (Optional)",
            "type": "string",
            "description": "Restrict permits to a 5-digit ZIP code."
          },
          "streetAddress": {
            "title": "Street Address Filter (Optional)",
            "type": "string",
            "description": "Restrict permits matching a street name or address."
          },
          "parcelNumber": {
            "title": "Parcel Number Filter (Optional)",
            "type": "string",
            "description": "Search permits associated with an exact parcel number."
          },
          "enrichPermitDetails": {
            "title": "Enrich Permit Landing Pages (Contractors, Licenses, Parcels, Fees, Lat/Lng)",
            "type": "boolean",
            "description": "When enabled, fetches each permit's public landing page to extract licensed contractor names & state license numbers, owner of record, parcel number, full ZIP, milestone dates, fees, and coordinates.",
            "default": true
          },
          "onlyNew": {
            "title": "Only Emit New Permits (Stateful SEEN_PERMITS Deduplication)",
            "type": "boolean",
            "description": "Tracks seen jurisdiction:permitNumber keys in the persistent Key-Value Store ('SEEN_PERMITS') across scheduled cron runs so webhooks/CRMs only receive brand-new permits.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum Total Permits to Emit",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on total permit records emitted in this run across all selected jurisdictions.",
            "default": 25
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}