{
  "openapi": "3.0.1",
  "info": {
    "title": "Seattle Commercial Permit Pipeline — Ready and Issued Alerts",
    "description": "Get commercial building permits from Seattle's official daily open data when they are first seen or move from Ready for Issuance to Issued. Filter by project cost, permit class, and work description; schedule a named monitor for change-only rows.",
    "version": "0.1",
    "x-build-id": "KwnFsU3i1MlVann02"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/natstandridge~seattle-permit-pipeline/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-natstandridge-seattle-permit-pipeline",
        "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/natstandridge~seattle-permit-pipeline/runs": {
      "post": {
        "operationId": "runs-sync-natstandridge-seattle-permit-pipeline",
        "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/natstandridge~seattle-permit-pipeline/run-sync": {
      "post": {
        "operationId": "run-sync-natstandridge-seattle-permit-pipeline",
        "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": {
          "monitorId": {
            "title": "Monitor name (optional)",
            "pattern": "^$|^[A-Za-z0-9][A-Za-z0-9_-]{0,39}$",
            "maxLength": 40,
            "type": "string",
            "description": "Leave empty for a one-time snapshot. Set a unique name and schedule the same input to get only new permits or stage changes on later runs. Do not overlap runs using one monitor name."
          },
          "lookbackDays": {
            "title": "Ready-date lookback (days)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Only permits whose published ReadyToIssueDate falls within this rolling window are checked. The source is a daily snapshot and can lag.",
            "default": 14
          },
          "permitClasses": {
            "title": "Non-residential permit classes",
            "minItems": 1,
            "maxItems": 3,
            "uniqueItems": true,
            "type": "array",
            "description": "Seattle's published PermitClass values. The query always excludes residential permits.",
            "items": {
              "type": "string"
            }
          },
          "minProjectCostUsd": {
            "title": "Minimum published estimated project cost (USD)",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "0 includes permits with missing cost. A positive value excludes missing-cost permits. Applicant estimates are not verified contract values.",
            "default": 0
          },
          "keywords": {
            "title": "Work-description phrases (optional)",
            "maxItems": 8,
            "type": "array",
            "description": "Literal, case-insensitive OR matches in the published work description or permit type. Leave empty for all selected classes.",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 60
            }
          },
          "maxSourceRecords": {
            "title": "Maximum source records",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard source-read cap. If the source has more, the run fails with no paid rows or monitor advance; narrow the window or raise this cap.",
            "default": 200
          },
          "maxResults": {
            "title": "Maximum paid permit rows",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Hard delivery cap. If the filtered alert set exceeds it, the run fails with no charge or monitor advance.",
            "default": 100
          },
          "baselineMode": {
            "title": "First named-monitor run",
            "enum": [
              "emit-current",
              "baseline-only"
            ],
            "type": "string",
            "description": "Only used when monitorId is set. Baseline-only writes no paid rows on first setup, then later runs emit changes.",
            "default": "emit-current"
          },
          "requestTimeoutSeconds": {
            "title": "Source request timeout (seconds)",
            "minimum": 5,
            "maximum": 30,
            "type": "integer",
            "description": "Timeout for each attempt to read Seattle's public API.",
            "default": 20
          },
          "maxRunSeconds": {
            "title": "Maximum work time (seconds)",
            "minimum": 40,
            "maximum": 180,
            "type": "integer",
            "description": "Source collection reserves at least 30 seconds for checkpoints and dataset delivery.",
            "default": 120
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}