{
  "openapi": "3.0.1",
  "info": {
    "title": "US Building Permits: Construction Leads by Trade & Alerts",
    "description": "New building permits from 18 US cities' and counties' official open-data portals, NYC, LA, Chicago, Dallas, San Diego County and more: by trade (solar, roofing, HVAC, pool...), keyword, ZIP and value, with the work, cost and contractor. Alerts give only new permits. No API key.",
    "version": "0.1",
    "x-build-id": "Ct8w5KZahgaImccni"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pikoulas~us-building-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pikoulas-us-building-permits",
        "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/pikoulas~us-building-permits/runs": {
      "post": {
        "operationId": "runs-sync-pikoulas-us-building-permits",
        "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/pikoulas~us-building-permits/run-sync": {
      "post": {
        "operationId": "run-sync-pikoulas-us-building-permits",
        "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": "Empty for all of them.",
            "items": {
              "type": "string",
              "enum": [
                "nyc",
                "chicago",
                "los-angeles",
                "austin",
                "san-francisco",
                "seattle",
                "baton-rouge",
                "cincinnati",
                "mesa",
                "montgomery-county-md",
                "montgomery-county-md-commercial",
                "orlando",
                "marin-county",
                "new-orleans",
                "dallas",
                "san-diego-county",
                "pierce-county-wa",
                "collin-county-tx",
                "cambridge-ma"
              ],
              "enumTitles": [
                "New York City, NY",
                "Chicago, IL",
                "Los Angeles, CA",
                "Austin, TX",
                "San Francisco, CA",
                "Seattle, WA",
                "Baton Rouge, LA",
                "Cincinnati, OH",
                "Mesa, AZ",
                "Montgomery County (residential), MD",
                "Montgomery County (commercial), MD",
                "Orlando, FL",
                "Marin County, CA",
                "New Orleans, LA",
                "Dallas, TX",
                "San Diego County (unincorporated), CA",
                "Pierce County (unincorporated), WA",
                "Collin County (Plano, McKinney, Frisco...), TX",
                "Cambridge (additions and alterations), MA"
              ]
            }
          },
          "trades": {
            "title": "Trades",
            "type": "array",
            "description": "Permits for any of these trades, found by their words in the permit's description and type (roofing: reroof, roofing, shingle...). Each permit is tagged with all its trades either way; leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "solar",
                "roofing",
                "hvac",
                "electrical",
                "plumbing",
                "pool",
                "new-construction",
                "addition-adu",
                "remodel",
                "demolition",
                "windows-doors",
                "fence-deck"
              ],
              "enumTitles": [
                "Solar",
                "Roofing",
                "HVAC",
                "Electrical",
                "Plumbing",
                "Pools",
                "New construction",
                "Additions and ADUs",
                "Remodels and alterations",
                "Demolition",
                "Windows and doors",
                "Fences, decks and patios"
              ]
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Your own words, in the permit's description or type: battery, ADU, restaurant. A permit with any of them, or of a trade above, is kept.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Five-digit ZIP codes; a permit in any of them is kept. Chicago, Mesa, Orlando, New Orleans, Pierce County and Cambridge publish none, so they're left out when this is set.",
            "items": {
              "type": "string"
            }
          },
          "issuedWithinDays": {
            "title": "Issued within (days)",
            "minimum": 1,
            "type": "integer",
            "description": "Only permits issued in the last this many days. Los Angeles and Montgomery County publish one to two weeks behind; with New permits only, 30 days catches their late ones once.",
            "default": 30
          },
          "minValue": {
            "title": "Least value (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only permits whose estimated cost of work is at least this; permits without a cost are left out."
          },
          "maxResultsPerCity": {
            "title": "Max permits per city",
            "minimum": 0,
            "type": "integer",
            "description": "Newest first; 0 for all that match. With New permits only, the newest this many are checked and the new ones among them given.",
            "default": 1000
          },
          "withContractorOnly": {
            "title": "Only with a contractor",
            "type": "boolean",
            "description": "Only permits that name the contractor's company: leads you can call or sell to. Los Angeles, San Francisco, Dallas, Pierce County and Montgomery County name none.",
            "default": false
          },
          "trackChanges": {
            "title": "New permits only",
            "type": "boolean",
            "description": "Give, and charge for, only the permits no earlier run with the same memory gave, late-published ones too. Schedule it daily or weekly for lead alerts that don't repeat.",
            "default": false
          },
          "memory": {
            "title": "Memory name",
            "type": "string",
            "description": "One per alert, so two schedules don't share a memory. Kept in your account's key-value store us-building-permits-memory; a permit not seen for 60 days is forgotten.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}