{
  "openapi": "3.0.1",
  "info": {
    "title": "BBB Business Leads Scraper — Phones, Ratings & Accreditation",
    "description": "Turn any trade and city into a BBB lead list: business name, phone, address, category, BBB rating and accreditation, $0.80 per 1,000. Run it daily, weekly or monthly on autopilot with Apify schedules, n8n, Make or Zapier. Closed businesses are skipped free of charge.",
    "version": "1.0",
    "x-build-id": "lRftTMUHA1lbAGrNO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fermaja~bbb-business-leads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fermaja-bbb-business-leads-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/fermaja~bbb-business-leads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fermaja-bbb-business-leads-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/fermaja~bbb-business-leads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fermaja-bbb-business-leads-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": "What businesses to find",
            "type": "array",
            "description": "A trade, category or business name, one per line or comma-separated: plumber, roofing, HVAC, dentist, \"Acme Movers\". You can also paste a BBB search URL here.",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "Where",
            "type": "array",
            "description": "City and state, ZIP code or province, one per line (or one line with ; or | between places): \"Austin, TX\", 80202, \"Toronto, ON\". Every search term is run in every location. Leave empty to search the whole country.",
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "BBB covers the United States and Canada.",
            "default": "USA"
          },
          "maxResultsPerSearch": {
            "title": "Max leads per search",
            "type": "integer",
            "description": "Leads for each search term in each location (up to 1,000; 0 = all, up to 1,000). BBB shows 225 per list, so above that the scraper also reads the list in other sort orders and categories.",
            "default": 50
          },
          "accreditedOnly": {
            "title": "Only BBB-accredited businesses",
            "type": "boolean",
            "description": "Keep only businesses that pay for BBB accreditation (often established firms that invest in their reputation).",
            "default": false
          },
          "minRating": {
            "title": "Minimum BBB rating",
            "type": "string",
            "description": "Keep only businesses rated this grade or better. Businesses without a rating are dropped when you set a grade.",
            "default": "any"
          },
          "includeOutOfBusiness": {
            "title": "Include businesses marked out of business",
            "type": "boolean",
            "description": "BBB keeps closed businesses in search. Off = they are skipped and you are not charged for them.",
            "default": false
          },
          "maxResults": {
            "title": "Max leads in total",
            "type": "integer",
            "description": "Stop after this many leads across all searches. 0 = no total limit (each search still stops at Max leads per search).",
            "default": 0
          },
          "startUrls": {
            "title": "BBB search URLs",
            "type": "array",
            "description": "Optional. Paste searches you made on bbb.org, e.g. https://www.bbb.org/search?find_text=roofing&find_loc=Denver%2C%20CO, or category pages like https://www.bbb.org/us/tx/austin/category/plumber.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Or: locations from another Actor's dataset",
            "type": "string",
            "description": "Pick a dataset (or pass its ID, e.g. {{ $json.defaultDatasetId }} in n8n) whose rows hold cities or ZIP codes. Every search term is run in every location from it. Paste the bare dataset ID, not the Console URL."
          },
          "datasetField": {
            "title": "Location column in that dataset",
            "type": "string",
            "description": "Field with the city or ZIP code. If it is empty, a location / city / zip / postalCode column is used. A city column is combined with a state column automatically.",
            "default": "location"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed normally: the scraper calls BBB directly and switches to a datacenter proxy by itself if BBB starts limiting requests.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}