{
  "openapi": "3.0.1",
  "info": {
    "title": "BuildZoom Scraper - Contractors, Licenses, Permits & Leads",
    "description": "Scrape US contractors from BuildZoom by city and trade. Get phone, address, geo, licenses, BuildZoom score, building-permit history, ratings, reviews and ready-to-contact B2B leads. No login, no browser.",
    "version": "0.1",
    "x-build-id": "28ytdiQvGBUxABLbP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~buildzoom-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-buildzoom-scraper",
        "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/scrapesage~buildzoom-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-buildzoom-scraper",
        "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/scrapesage~buildzoom-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-buildzoom-scraper",
        "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": {
          "searchTerms": {
            "title": "Trades / categories",
            "type": "array",
            "description": "Contractor trades to search, combined with every location. Use friendly names ('general contractors', 'electricians', 'plumbers', 'roofers', 'hvac', 'painters', 'landscaping', 'handyman', 'architects', 'home builders', 'solar', 'remodeling') or a raw BuildZoom trade slug (e.g. 'general-contractors', 'kitchen-and-bathroom-remodeling').",
            "items": {
              "type": "string"
            },
            "default": [
              "general-contractors"
            ]
          },
          "locations": {
            "title": "Locations (cities)",
            "type": "array",
            "description": "US cities to search. Use a plain city ('Chicago', 'Los Angeles'), a 'City, ST' string ('Austin, TX', 'New York, NY') or a BuildZoom city slug ('austin-tx'). Each location is combined with every trade.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Paste any BuildZoom URL — a search page (https://www.buildzoom.com/chicago/general-contractors) or a contractor profile (https://www.buildzoom.com/contractor/<slug>). Auto-routed.",
            "items": {
              "type": "string"
            }
          },
          "contractorUrls": {
            "title": "Contractor profile URLs",
            "type": "array",
            "description": "Direct contractor profile URLs or slugs (e.g. 'https://www.buildzoom.com/contractor/bezruchuk-inc' or just 'bezruchuk-inc'). Always fetched with full profile detail.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort results by",
            "enum": [
              "",
              "rating",
              "reviews",
              "name"
            ],
            "type": "string",
            "description": "Optional BuildZoom result sort. Leave as default (BuildZoom relevance / BZ-score ranking) for the most useful order.",
            "default": ""
          },
          "minRating": {
            "title": "Minimum rating",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Only keep contractors with a star rating greater than or equal to this (0 = no filter). Note: many contractors have no reviews yet and will be dropped if you set this.",
            "default": 0
          },
          "includeProfileDetails": {
            "title": "Fetch profile details",
            "type": "boolean",
            "description": "Open each contractor's profile to add the BuildZoom Score + ranking, full license list (numbers, issuing authorities, jurisdictions), license-verified status, building-permit history sample (project type, address, date, valuation) and reviews. One extra request per contractor (billed as 'contractorDetail'). Turn off for a fast, cheap listing-only run.",
            "default": true
          },
          "includePermits": {
            "title": "Include permit history",
            "type": "boolean",
            "description": "Include a sample of the contractor's building-permit history (project type, address, date, description, job valuation) in each record. Requires profile details.",
            "default": true
          },
          "includeReviews": {
            "title": "Scrape reviews",
            "type": "boolean",
            "description": "Also output one record per customer review (author, date, star rating, title, body) for each contractor. Requires profile details.",
            "default": false
          },
          "maxReviewsPerContractor": {
            "title": "Max reviews per contractor",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Cap the number of review records emitted per contractor.",
            "default": 20
          },
          "enrichWebsiteContacts": {
            "title": "Enrich website contacts (best effort)",
            "type": "boolean",
            "description": "When a contractor's own website is linked on their profile, crawl it (home + contact/about) for emails, phone numbers and social links. BuildZoom only links a website on some claimed/premium profiles, so this is best-effort — the phone number is always available regardless.",
            "default": false
          },
          "deduplicateContractors": {
            "title": "Deduplicate contractors",
            "type": "boolean",
            "description": "Emit each contractor only once per run, even if they appear in several searches.",
            "default": true
          },
          "maxContractorsPerSearch": {
            "title": "Max contractors per search",
            "minimum": 1,
            "type": "integer",
            "description": "Upper limit of contractors collected per trade × location (or per start URL).",
            "default": 100
          },
          "maxPagesPerSearch": {
            "title": "Max pages per search",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of result pages to paginate per search (~25 contractors per page).",
            "default": 15
          },
          "monitorMode": {
            "title": "Monitor mode (only new / changed)",
            "type": "boolean",
            "description": "Remember contractors across runs in a named key-value store and emit only NEW contractors, plus existing ones whose permit count or BuildZoom score changed (changeType: new / new_permit / score_change). Combine with Apify Schedules to build a recurring contractor & permit feed. This is independent of (and complementary to) the platform scheduler.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Names the monitor memory so different saved searches don't collide (store: buildzoom-monitor-<key>).",
            "default": "default"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Maximum number of pages fetched in parallel.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. BuildZoom serves clean pages to Apify datacenter proxies (the default). If you ever hit Cloudflare challenges, switch the group to RESIDENTIAL.",
            "default": {
              "useApifyProxy": true
            }
          },
          "urlsFromFile": {
            "title": "Import URLs from a file",
            "type": "string",
            "description": "Paste a list of URLs (one per line), OR one link to a .txt/.csv file, Google Sheet or Google Drive file containing them. Lets you import many Start URLs at once instead of typing each. Google Sheet/Drive share links are handled automatically."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}