{
  "openapi": "3.0.1",
  "info": {
    "title": "New Building Permit Leads: Roofing, Solar, HVAC & Contractors",
    "description": "New building permits from 7 US city open data portals (NYC, LA, Chicago, SF, Austin, Seattle, New Orleans), sorted by trade (roofing, solar, HVAC, pool, new build) and scored 0 to 100 with job value and contractor. $0.01 per permit. Agent-ready: MCP.",
    "version": "0.1",
    "x-build-id": "3VtTzuP6hJDs7F974"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nerolabs~building-permit-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nerolabs-building-permit-leads",
        "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/nerolabs~building-permit-leads/runs": {
      "post": {
        "operationId": "runs-sync-nerolabs-building-permit-leads",
        "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/nerolabs~building-permit-leads/run-sync": {
      "post": {
        "operationId": "run-sync-nerolabs-building-permit-leads",
        "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": "Which city permit feeds to read: chicago, nyc, los_angeles, san_francisco, austin, seattle, new_orleans. Empty means all 7. Each comes from that city's official open data portal and is updated daily or weekly.",
            "items": {
              "type": "string",
              "enum": [
                "chicago",
                "nyc",
                "los_angeles",
                "san_francisco",
                "austin",
                "seattle",
                "new_orleans"
              ],
              "enumTitles": [
                "Chicago, IL",
                "New York City, NY",
                "Los Angeles, CA",
                "San Francisco, CA",
                "Austin, TX",
                "Seattle, WA",
                "New Orleans, LA"
              ]
            }
          },
          "withinDays": {
            "title": "Days to look back",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "Permits issued in the last N days (1 to 90). Use 1 or 2 with monitor mode for a daily feed.",
            "default": 7
          },
          "trades": {
            "title": "Trades (optional)",
            "type": "array",
            "description": "Only permits that touch one of these trades, read from the permit type and work description (a kitchen remodel with new wiring counts for addition_remodel and electrical). Empty means every permit.",
            "items": {
              "type": "string",
              "enum": [
                "new_construction",
                "adu",
                "addition_remodel",
                "roofing",
                "solar",
                "hvac",
                "plumbing",
                "electrical",
                "ev_charger",
                "generator",
                "pool",
                "demolition",
                "windows_doors",
                "foundation",
                "fire_sprinkler",
                "elevator",
                "fence",
                "signs",
                "scaffold_shed"
              ],
              "enumTitles": [
                "New construction",
                "ADU (accessory dwelling unit)",
                "Addition or remodel",
                "Roofing",
                "Solar",
                "HVAC and mechanical",
                "Plumbing and gas",
                "Electrical",
                "EV charger",
                "Generator",
                "Pool and spa",
                "Demolition",
                "Windows and doors",
                "Foundation and excavation",
                "Fire sprinkler and alarm",
                "Elevator",
                "Fence and retaining wall",
                "Signs",
                "Scaffold and sidewalk shed"
              ]
            }
          },
          "propertyType": {
            "title": "Property type",
            "enum": [
              "any",
              "residential",
              "commercial"
            ],
            "type": "string",
            "description": "Residential or commercial, from the city's own class where it gives one, otherwise from the permit text. 'any' keeps permits whose type is unknown.",
            "default": "any"
          },
          "minJobValue": {
            "title": "Minimum job value (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip permits with a declared job value below this, e.g. 25000. Permits with no stated value are dropped when this is above 0.",
            "default": 0
          },
          "maxJobValue": {
            "title": "Maximum job value (USD, optional)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip permits above this value. Empty or 0 means no limit."
          },
          "keywords": {
            "title": "Must mention (optional)",
            "type": "array",
            "description": "Keep only permits whose type or description contains at least one of these words, e.g. 'tankless', 'metal roof', 'restaurant'. Case does not matter.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Skip if it mentions (optional)",
            "type": "array",
            "description": "Drop permits whose text contains any of these words, e.g. 'repair', 'temporary'.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes (optional)",
            "type": "array",
            "description": "Only permits in these 5 digit ZIP codes. Chicago and New Orleans feeds carry no ZIP, so they drop out when this is set.",
            "items": {
              "type": "string"
            }
          },
          "requireContractor": {
            "title": "Only permits with a contractor named",
            "type": "boolean",
            "description": "Keep only permits that name the contractor (for suppliers who sell to contractors). Chicago, NYC, Austin, Seattle and New Orleans name contractors; LA and San Francisco feeds do not.",
            "default": false
          },
          "excludeContractors": {
            "title": "Skip these contractors or permit numbers",
            "type": "array",
            "description": "Contractor company names or permit numbers to leave out, for example your existing customers. Names match loosely (Inc, LLC and case ignored).",
            "items": {
              "type": "string"
            }
          },
          "excludeListUrl": {
            "title": "Skip list from a CSV or Google Sheet (optional)",
            "type": "string",
            "description": "Public CSV or Google Sheet link (shared as 'Anyone with the link can view'); the first column holds contractor names or permit numbers to skip, such as your CRM export."
          },
          "minLeadScore": {
            "title": "Minimum lead score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only return permits scoring at least this (0 to 100). The score adds job value, job size (new build, remodel, roof, solar), how recent, and whether a contractor, phone and owner are named.",
            "default": 0
          },
          "maxLeads": {
            "title": "Maximum permits to return",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "The best scored permits up to this number are returned and charged; the rest are counted in the summary only.",
            "default": 100
          },
          "monitorMode": {
            "title": "Monitor mode (only new permits)",
            "type": "boolean",
            "description": "Remember permits already returned under 'watchName' and return only new ones on later runs. Schedule it daily for a fresh lead feed.",
            "default": false
          },
          "watchName": {
            "title": "Watch name",
            "type": "string",
            "description": "Name for this saved watch in monitor mode, so different searches keep separate memories (e.g. 'austin-roofing').",
            "default": "default"
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "POST the run summary (counts per city and trade, busiest contractors) here when the run ends. In monitor mode it is sent only when there are new permits."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}