{
  "openapi": "3.0.1",
  "info": {
    "title": "US Building Permits Feed: SF, Austin, New Orleans",
    "description": "Newly issued building permits from official city open-data portals in one schema: type, value, address, status, coordinates, contractor company. Schedule it and get only permits you have not seen. No API key. No owner names, phones or e-mails.",
    "version": "0.0",
    "x-build-id": "JaS0p8Ao1uj8x9Xlf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/asunoki~us-building-permits-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-asunoki-us-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/asunoki~us-building-permits-feed/runs": {
      "post": {
        "operationId": "runs-sync-asunoki-us-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/asunoki~us-building-permits-feed/run-sync": {
      "post": {
        "operationId": "run-sync-asunoki-us-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": "Leave empty for all three cities. Each city is read from its own official open-data portal.",
            "items": {
              "type": "string",
              "enum": [
                "san-francisco",
                "austin",
                "new-orleans"
              ],
              "enumTitles": [
                "San Francisco, CA",
                "Austin, TX",
                "New Orleans, LA"
              ]
            }
          },
          "keywords": {
            "title": "Keywords (permit type, work type or description)",
            "type": "array",
            "description": "A permit matches if any keyword appears, e.g. \"solar\", \"roof\", \"ADU\", \"demolition\", \"pool\". Leave empty for all permits.",
            "items": {
              "type": "string"
            }
          },
          "permitTypeContains": {
            "title": "Permit type contains",
            "type": "array",
            "description": "Text in the permit type or work type, e.g. \"electrical\", \"plumbing\", \"new construction\".",
            "items": {
              "type": "string"
            }
          },
          "minValueUsd": {
            "title": "Minimum project value (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Skips permits whose declared value is below this or missing. Declared values are what the applicant reported; some cities use placeholders like 1."
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "5-digit ZIP codes. New Orleans does not publish a ZIP, so those permits are excluded when this is set.",
            "items": {
              "type": "string"
            }
          },
          "lookbackDays": {
            "title": "Days back (issue date)",
            "minimum": 1,
            "maximum": 31,
            "type": "integer",
            "description": "Portals publish with a lag of about 1 to 3 days. With \"only new\" on and a daily schedule, a 7-day window repeats nothing and catches every permit the city publishes within 7 days of its issue date.",
            "default": 7
          },
          "onlyNew": {
            "title": "Only permits not output before (for schedules)",
            "type": "boolean",
            "description": "Remembered per filter set in a named key-value store. Turn off to get the whole window every time.",
            "default": true
          },
          "includeDescription": {
            "title": "Include the work description",
            "type": "boolean",
            "description": "Free text from the permit, shortened to 800 characters. E-mail addresses and phone numbers typed into it are replaced by a marker.",
            "default": true
          },
          "includeContractorCompany": {
            "title": "Include the contractor company name",
            "type": "boolean",
            "description": "Austin and New Orleans only. A name is output only if it contains a business word (LLC, Inc, Roofing, ...); other names are dropped. This is a heuristic: a sole trader whose trade name has such a word can pass.",
            "default": true
          },
          "maxItems": {
            "title": "Max permits per run",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "You are charged per permit stored (plus Apify's small per-run start fee), so this caps the cost of a run. Permits cut by the limit stay new for the next run while they are still inside the window.",
            "default": 200
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Not needed. If the portals throttle you at high volume, a free token from the portal raises the limit."
          },
          "stateStoreName": {
            "title": "State store name (advanced)",
            "type": "string",
            "description": "Leave empty to use the 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}