{
  "openapi": "3.0.1",
  "info": {
    "title": "US Building Permits API & Contractor Leads",
    "description": "Building permits issued in New York City, Chicago, San Francisco, Seattle, Austin, Cincinnati and Baton Rouge: project value, work type, contractor (with phone in Austin), owner and address. Find solar, roofing, remodel and new construction jobs.",
    "version": "1.0",
    "x-build-id": "baP6h9S6qqVIRd01O"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/digital_influx~us-building-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-digital_influx-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/digital_influx~us-building-permits/runs": {
      "post": {
        "operationId": "runs-sync-digital_influx-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/digital_influx~us-building-permits/run-sync": {
      "post": {
        "operationId": "run-sync-digital_influx-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": {
          "sources": {
            "title": "Cities",
            "type": "array",
            "description": "Building departments to read. Empty = all seven.",
            "items": {
              "type": "string",
              "enum": [
                "new-york-city",
                "chicago",
                "san-francisco",
                "seattle",
                "cincinnati",
                "austin",
                "baton-rouge"
              ],
              "enumTitles": [
                "New York City, NY",
                "Chicago, IL",
                "San Francisco, CA",
                "Seattle, WA",
                "Cincinnati, OH",
                "Austin, TX",
                "Baton Rouge, LA"
              ]
            }
          },
          "issuedWithinDays": {
            "title": "Issued within (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Permits issued in the last N days. Most cities publish them within a day or two.",
            "default": 30
          },
          "workTypes": {
            "title": "Work types",
            "type": "array",
            "description": "Keep permits whose type or description mentions one of these. Empty = every permit.",
            "items": {
              "type": "string",
              "enum": [
                "new-construction",
                "addition-remodel",
                "roofing",
                "solar",
                "adu",
                "pool",
                "hvac",
                "electrical",
                "plumbing",
                "demolition",
                "signs"
              ],
              "enumTitles": [
                "New construction",
                "Addition, alteration or remodel",
                "Roofing",
                "Solar",
                "ADU (accessory dwelling unit)",
                "Pool or spa",
                "HVAC and mechanical",
                "Electrical",
                "Plumbing and water heaters",
                "Demolition",
                "Signs and awnings"
              ]
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Other words to find in the permit type or description, e.g. kitchen, restaurant, elevator, EV charger.",
            "items": {
              "type": "string"
            }
          },
          "minProjectValue": {
            "title": "Minimum project value (USD)",
            "minimum": 1,
            "type": "integer",
            "description": "Keep permits whose declared project cost is at least this much. Permits without a declared cost are left out when this is set."
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "5-digit ZIP codes, or their first 3 digits for a wider area (e.g. 787 for Austin). Chicago does not publish the ZIP code of the work site and is skipped.",
            "items": {
              "type": "string"
            }
          },
          "onlyWithContractor": {
            "title": "Only permits that name a contractor",
            "type": "boolean",
            "description": "Leave out permits pulled without a contractor's name (homeowner permits, or cities that do not publish it).",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Newest permits first, across all cities. You also never pay more than the spending limit you set for the run.",
            "default": 1000
          },
          "onlyNew": {
            "title": "Only new or updated permits (for scheduled runs)",
            "type": "boolean",
            "description": "Save only permits that earlier runs of this same search did not save, or whose status, value or contractor changed since (each row says which). Schedule it daily or weekly. The memory lives in a key-value store named \"us-building-permits-state\" in your account.",
            "default": false
          },
          "memoryName": {
            "title": "Memory name (optional)",
            "type": "string",
            "description": "By default each search has its own memory. Give a name to share one memory between tasks, or a new name to start over."
          },
          "appToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Without a token, the portals share a request limit per IP address. A free app token from any Socrata portal gives you your own limit. Only needed if a run reports a refused request."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}