{
  "openapi": "3.0.1",
  "info": {
    "title": "GovData Labs — US Building Permits Feed",
    "description": "GovData Labs normalizes building permits from official US city, county, and state open-data APIs.",
    "version": "1.0",
    "x-build-id": "CRbb4sOuZQuHzbSKJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/govdatalabs~govdata-labs-building-permits-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-govdatalabs-govdata-labs-building-permits-feed",
        "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/govdatalabs~govdata-labs-building-permits-feed/runs": {
      "post": {
        "operationId": "runs-sync-govdatalabs-govdata-labs-building-permits-feed",
        "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/govdatalabs~govdata-labs-building-permits-feed/run-sync": {
      "post": {
        "operationId": "run-sync-govdatalabs-govdata-labs-building-permits-feed",
        "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": {
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Source ids. Choose all for every configured source, including the large New Jersey feed. Omit this field and the run uses Chicago, Seattle, Dallas, Austin, and Cincinnati.",
            "items": {
              "type": "string",
              "enum": [
                "all",
                "chicago",
                "seattle",
                "dallas",
                "los-angeles",
                "cincinnati",
                "austin",
                "san-francisco",
                "new-york",
                "new-york-dob-now",
                "new-orleans",
                "mesa",
                "marin-county",
                "baton-rouge",
                "boston",
                "philadelphia",
                "montgomery-residential",
                "montgomery-commercial",
                "cambridge",
                "cambridge-new",
                "kansas-city",
                "corona",
                "gainesville",
                "honolulu",
                "new-jersey",
                "collin-county",
                "somerville"
              ],
              "enumTitles": [
                "All sources",
                "Chicago",
                "Seattle",
                "Dallas",
                "Los Angeles",
                "Cincinnati",
                "Austin",
                "San Francisco",
                "New York DOB issuance",
                "New York DOB NOW",
                "New Orleans",
                "Mesa",
                "Marin County",
                "Baton Rouge",
                "Boston",
                "Philadelphia",
                "Montgomery County residential",
                "Montgomery County commercial",
                "Cambridge alterations",
                "Cambridge new construction",
                "Kansas City",
                "Corona",
                "Gainesville",
                "Honolulu (snapshot through 2025-06-30)",
                "New Jersey municipalities",
                "Collin County",
                "Somerville"
              ]
            },
            "default": [
              "chicago",
              "seattle",
              "dallas",
              "austin",
              "cincinnati"
            ]
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Inclusive YYYY-MM-DD. Defaults to 7 days before the to-date. In change-tracking mode the watermark can move this later."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Inclusive YYYY-MM-DD. Defaults to today."
          },
          "permitTypes": {
            "title": "Permit types",
            "type": "array",
            "description": "Case-insensitive substrings. A row is kept when its permit type contains any of them.",
            "items": {
              "type": "string"
            }
          },
          "tradeKeywords": {
            "title": "Trade keywords",
            "type": "array",
            "description": "Keep rows whose type, description, or trade tag contains a keyword. Tags include solar, roofing, hvac, electrical, plumbing, new construction, demolition, and pool.",
            "items": {
              "type": "string"
            }
          },
          "minValuation": {
            "title": "Minimum valuation",
            "minimum": 0,
            "type": "number",
            "description": "Drop permits below this amount. Rows with no published valuation are dropped when this is set."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Cap on output rows across all cities. Each row is billed as permit-result. Default 100.",
            "default": 100
          },
          "onlyChangesSinceLastRun": {
            "title": "Only changes since last run",
            "type": "boolean",
            "description": "Each city keeps its own snapshot. The first run stores a baseline and bills permit-result only. Later runs emit new or changed permits and also bill change-detected.",
            "default": false
          },
          "snapshotStoreName": {
            "title": "Snapshot store name",
            "type": "string",
            "description": "Named key-value store. One record per city.",
            "default": "building-permits-snapshots"
          },
          "requestSpacingMs": {
            "title": "Request spacing (ms)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Minimum delay between SODA requests to the same host. Default 200.",
            "default": 200
          },
          "socrataAppToken": {
            "title": "Socrata app token",
            "type": "string",
            "description": "Optional. Anonymous access works for light runs. You can also set SOCRATA_APP_TOKEN. Boston uses CKAN and Philadelphia uses Carto; the token does not apply to them."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}