{
  "openapi": "3.0.1",
  "info": {
    "title": "US Building Permits Watch",
    "description": "Search or watch building permits from New York, Chicago, Los Angeles, Austin, Seattle, San Francisco, Cincinnati, and Baton Rouge. No API key. No start fee.",
    "version": "0.1",
    "x-build-id": "BgcGnOMJrUXuDANoO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mikee368~us-building-permits-watch/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mikee368-us-building-permits-watch",
        "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/mikee368~us-building-permits-watch/runs": {
      "post": {
        "operationId": "runs-sync-mikee368-us-building-permits-watch",
        "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/mikee368~us-building-permits-watch/run-sync": {
      "post": {
        "operationId": "run-sync-mikee368-us-building-permits-watch",
        "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": "City open-data portals to read. Empty means all eight.",
            "items": {
              "type": "string",
              "enum": [
                "new_york",
                "chicago",
                "los_angeles",
                "austin",
                "seattle",
                "san_francisco",
                "cincinnati",
                "baton_rouge"
              ],
              "enumTitles": [
                "New York",
                "Chicago",
                "Los Angeles",
                "Austin",
                "Seattle",
                "San Francisco",
                "Cincinnati",
                "Baton Rouge"
              ]
            },
            "default": [
              "new_york",
              "chicago",
              "los_angeles",
              "austin",
              "seattle",
              "san_francisco",
              "cincinnati",
              "baton_rouge"
            ]
          },
          "issuedFrom": {
            "title": "Issued from",
            "type": "string",
            "description": "First issued date to include (YYYY-MM-DD). Together with Issued to, this is a search and does not move the watch cursor. Leave both empty to run incremental watch mode."
          },
          "issuedTo": {
            "title": "Issued to",
            "type": "string",
            "description": "Last issued date to include (YYYY-MM-DD). Leave both date fields empty for watch mode (only permits new since the previous run with the same Watch ID)."
          },
          "permitTypes": {
            "title": "Permit categories",
            "type": "array",
            "description": "Normalised categories to keep. Empty means every category. A permit can also carry trade tags (solar, roof, hvac, pool, adu, ev) besides its one category.",
            "items": {
              "type": "string",
              "enum": [
                "new_construction",
                "addition_alteration",
                "demolition",
                "electrical",
                "mechanical",
                "plumbing",
                "roofing",
                "solar",
                "pool",
                "adu",
                "ev_charger",
                "other"
              ],
              "enumTitles": [
                "New construction",
                "Addition or alteration",
                "Demolition",
                "Electrical",
                "Mechanical",
                "Plumbing",
                "Roofing",
                "Solar",
                "Pool",
                "ADU",
                "EV charger",
                "Other"
              ]
            },
            "default": []
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Case-insensitive words matched against the work description and permit type. A permit matches if any keyword is found.",
            "items": {
              "type": "string"
            }
          },
          "minValuation": {
            "title": "Minimum valuation (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Drop permits below this job value. Cities publish different fields (estimated cost, reported cost, valuation), so do not compare values across cities. Leave empty for no minimum."
          },
          "includePersonNames": {
            "title": "Include owner and applicant names",
            "type": "boolean",
            "description": "Off by default. When on, rows may include ownerName and applicantName where the city publishes a person's name. Contractor companies are included either way.",
            "default": false
          },
          "watchId": {
            "title": "Watch ID",
            "type": "string",
            "description": "Name of the saved cursor in the permits-watch-state store. Use different IDs for different watches.",
            "default": "default"
          },
          "maxItemsPerCity": {
            "title": "Max permits per city",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Cap per city per run (1-5000). Watch mode walks issued dates oldest-first so the next run continues after the saved cursor.",
            "default": 200
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional Socrata application token (X-App-Token) from a Tyler/Socrata account you create yourself. Requests work without one; a token uses your own quota instead of the shared IP pool."
          },
          "resetState": {
            "title": "Reset watch cursor",
            "type": "boolean",
            "description": "Ignore the saved cursor for this Watch ID and look back from scratch (3 days, or 14 days for Los Angeles).",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}