{
  "openapi": "3.0.1",
  "info": {
    "title": "Seattle WA Building Permits - New Permit Feed",
    "description": "New City of Seattle building permits since your last run: residential and non-residential new builds, additions, alterations, tenant improvements and demolitions, filtered by type, ZIP, work type, cost or keyword. Each permit has the city's estimated project cost, address and coordinates.",
    "version": "0.1",
    "x-build-id": "pxlLmKol0TEgUp6Uh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/themartygriffin~seattle-building-permits-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-themartygriffin-seattle-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/themartygriffin~seattle-building-permits-feed/runs": {
      "post": {
        "operationId": "runs-sync-themartygriffin-seattle-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/themartygriffin~seattle-building-permits-feed/run-sync": {
      "post": {
        "operationId": "run-sync-themartygriffin-seattle-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "backfill",
              "new"
            ],
            "type": "string",
            "description": "'backfill' returns permits issued in the last N days and saves the state; it is the default, so a first run returns real results. 'new' returns only permits not reported by an earlier run and needs saved state - it exits with an empty dataset if you have never run 'backfill'.",
            "default": "backfill"
          },
          "lookback_days": {
            "title": "Lookback days (backfill)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Backfill only. Return permits issued in the last this many days (1 to 365, the same span the Actor remembers reported permits for). Seattle issues permits on weekdays only, so the newest 1-3 days can be missing on a Monday.",
            "default": 30
          },
          "include_already_reported": {
            "title": "Re-report permits already reported (backfill only)",
            "type": "boolean",
            "description": "Backfill only. Controls whether permits an earlier run already reported appear in the dataset again. Off (the default): they are left out. On: they are returned again. It never changes what you are charged: a permit is billed once, the first time it is reported, and re-reported permits are free. Permits are remembered for 365 days of issue dates, which covers the longest lookback.",
            "default": false
          },
          "permit_types": {
            "title": "Permit types",
            "type": "array",
            "description": "Exact dataset values: 'Building', 'Demolition', 'Roof', 'Grading'. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "permit_classes": {
            "title": "Residential or non-residential",
            "type": "array",
            "description": "Exact dataset values: 'Residential' or 'Non-Residential'. Empty = both.",
            "items": {
              "type": "string"
            }
          },
          "work_types": {
            "title": "Work types",
            "type": "array",
            "description": "Exact dataset values: 'New', 'Addition/Alteration', 'Demolition', 'Tenant Improvment' (the city's spelling), 'Temporary', 'Change of Use Only - No Construction'. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "min_valuation": {
            "title": "Minimum estimated project cost (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip permits whose estimated project cost is below this. Seattle publishes a cost on every permit, so this filter rarely drops rows."
          },
          "max_valuation": {
            "title": "Maximum estimated project cost (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip permits whose estimated project cost is above this."
          },
          "zip_codes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "5-digit ZIP codes, e.g. 98118. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Description keywords",
            "type": "array",
            "description": "Return a permit if its work description contains ANY of these text fragments (case-insensitive), e.g. solar, ADU, restaurant, tenant improvement. This is a substring match, so 'ADU' also matches longer words that contain it.",
            "items": {
              "type": "string"
            }
          },
          "max_results": {
            "title": "Maximum permits per run",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Safety cap on charged permits (never reported before) per run. Permits returned again for free do not count. Default 1000. Oldest first. The rest are picked up on the next 'new' run.",
            "default": 1000
          },
          "state_key": {
            "title": "State name",
            "type": "string",
            "description": "Name of the saved watermark. Use a different name for each filter set you schedule, because 'already reported' is tracked per name, not per filter set.",
            "default": "default"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}