{
  "openapi": "3.0.1",
  "info": {
    "title": "Building Permit Lead Feed - 11 US Cities, Daily",
    "description": "New building permits from 11 official US city/county open-data portals (NYC, LA, Chicago, SF, Austin, Seattle and more) in one clean schema. Filter by work type, value and contractor; monitor mode returns only new permits.",
    "version": "1.0",
    "x-build-id": "MtdUUjHJzZhQM7gvC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jonboyd544~building-permits-lead-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jonboyd544-building-permits-lead-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/jonboyd544~building-permits-lead-feed/runs": {
      "post": {
        "operationId": "runs-sync-jonboyd544-building-permits-lead-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/jonboyd544~building-permits-lead-feed/run-sync": {
      "post": {
        "operationId": "run-sync-jonboyd544-building-permits-lead-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": {
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Which official portals to query. Leave empty to query all of them.",
            "items": {
              "type": "string",
              "enum": [
                "chicago_il",
                "nyc_ny",
                "los_angeles_ca",
                "san_francisco_ca",
                "austin_tx",
                "seattle_wa",
                "cincinnati_oh",
                "montgomery_county_md",
                "new_orleans_la",
                "cambridge_ma",
                "baton_rouge_la"
              ],
              "enumTitles": [
                "City of Chicago, IL",
                "New York City, NY",
                "City of Los Angeles, CA",
                "City and County of San Francisco, CA",
                "City of Austin, TX",
                "City of Seattle, WA",
                "City of Cincinnati, OH",
                "Montgomery County, MD, MD",
                "City of New Orleans, LA",
                "City of Cambridge, MA",
                "East Baton Rouge Parish, LA"
              ]
            },
            "default": []
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "How many days of records to fetch when no 'Date from' is set. 0 = no date limit.",
            "default": 7
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Earliest date (YYYY-MM-DD) or relative like '30 days'. Overrides 'Days back'."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Latest date (YYYY-MM-DD). Leave empty for today."
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Only keep permits whose description, type or contractor contains any of these words (e.g. roof, solar, pool, HVAC, demolition, new construction).",
            "items": {
              "type": "string"
            }
          },
          "propertyClass": {
            "title": "Property class",
            "enum": [
              "any",
              "residential",
              "commercial"
            ],
            "type": "string",
            "description": "Filter by residential or commercial where the city provides it.",
            "default": "any"
          },
          "minValuation": {
            "title": "Minimum job value (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Drop permits with a declared job value below this (permits without a value are dropped too when set)."
          },
          "maxValuation": {
            "title": "Maximum job value (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Drop permits above this job value."
          },
          "onlyWithContractor": {
            "title": "Only permits with a named contractor company",
            "type": "boolean",
            "description": "Keep only permits where a contractor business is listed.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum records saved (and charged) in this run, newest first.",
            "default": 1000
          },
          "maxResultsPerSource": {
            "title": "Max results per source",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Optional cap per source so one big city can't crowd out the others."
          },
          "monitorMode": {
            "title": "Monitor mode (only new records)",
            "type": "boolean",
            "description": "Remember what was already returned and only output records you haven't seen. Schedule the actor daily to get a fresh lead feed. State is kept per filter combination.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Optional name for the monitor state, so different saved tasks never share history."
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Free token from any Socrata portal (dev.socrata.com) for higher rate limits on very large pulls. Not required."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}