{
  "openapi": "3.0.1",
  "info": {
    "title": "BBB Scraper: Business Details, Complaints & Reviews",
    "description": "BBB scraper for full Better Business Bureau profiles: search by keyword, business name and location or paste profile URLs. Principals, phone, email, websites, hours, BBB rating, accreditation, licenses, plus complaints and reviews, for lead qualification and vendor vetting.",
    "version": "0.0",
    "x-build-id": "gdlmwXN8N859oBL1d"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/piotrv1001~bbb-business-details-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-piotrv1001-bbb-business-details-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/piotrv1001~bbb-business-details-scraper/runs": {
      "post": {
        "operationId": "runs-sync-piotrv1001-bbb-business-details-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/piotrv1001~bbb-business-details-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-piotrv1001-bbb-business-details-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": {
          "startUrls": {
            "title": "BBB profile URLs",
            "type": "array",
            "description": "Business profile pages on bbb.org, e.g. https://www.bbb.org/us/tx/plano/profile/security-system-monitors/smith-thompson-home-security-0875-9237. The /details, /complaints and /customer-reviews variants of a profile URL work too, and a BBB search page URL (bbb.org/search?find_text=...) is searched with its own filters, and a BBB category page (bbb.org/us/tx/austin/category/plumber) as that category in that city. Leave empty to find businesses with the search terms below. Tip: feed the profile URLs from the BBB Advanced Scraper's results.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchTerms": {
            "title": "Search terms or business names",
            "type": "array",
            "description": "Find businesses on BBB instead of pasting URLs: a category or keyword (\"plumber\", \"roofing contractors\") or a business name (\"Fox Service Company\"). Each term is searched in the location below and every matching business gets the full profile. BBB shows up to 225 results per search.",
            "items": {
              "type": "string"
            }
          },
          "location": {
            "title": "Location",
            "type": "string",
            "description": "City and state, ZIP code or province for the search terms, e.g. \"Austin, TX\" or \"90210\". Leave empty to search all of BBB (US and Canada). Spellings like \"Austin, Texas\", \"NYC\" or \"Washington, D.C.\" are rewritten the way BBB reads them; a state or province alone (\"Texas\") is searched statewide, \"USA\" or \"Canada\" the whole country. A location BBB places somewhere else (an unknown town, a county) or does not recognise is skipped, nothing charged, and the status says so. A city without a state is the one BBB picks (named in the status)."
          },
          "locations": {
            "title": "More locations",
            "type": "array",
            "description": "Extra locations: every search term is searched in the location above and in each of these (e.g. \"Dallas, TX\", \"Houston, TX\", \"77002\"). A business found in several is scraped once.",
            "items": {
              "type": "string"
            }
          },
          "accreditedOnly": {
            "title": "BBB Accredited businesses only",
            "type": "boolean",
            "description": "Only return businesses that are BBB Accredited (search terms only).",
            "default": false
          },
          "country": {
            "title": "Country",
            "enum": [
              "USA",
              "CAN"
            ],
            "type": "string",
            "description": "Search BBB in the US or Canada (search terms only). Empty = BBB's choice from the location."
          },
          "sort": {
            "title": "Sort search results by",
            "enum": [
              "Relevance",
              "Distance",
              "Rating",
              "AToZ",
              "ZToA"
            ],
            "type": "string",
            "description": "Order of BBB's search results (search terms only). Decides which businesses come first when Max businesses cuts the list."
          },
          "distance": {
            "title": "Search radius (miles)",
            "minimum": 1,
            "type": "integer",
            "description": "Only businesses within this many miles of the location (search terms only)."
          },
          "maxResultsPerSearch": {
            "title": "Max businesses per search term",
            "minimum": 1,
            "type": "integer",
            "description": "Cap per search term. Set 1 to look up the best match for each business name. Empty = up to Max businesses."
          },
          "includeComplaints": {
            "title": "Include complaints",
            "type": "boolean",
            "description": "Also collect the business's complaint history (type, status, date, text, business responses). Charged per complaint.",
            "default": false
          },
          "includeReviews": {
            "title": "Include customer reviews",
            "type": "boolean",
            "description": "Also collect customer reviews (stars, text, date, reviewer, business response). Charged per review.",
            "default": false
          },
          "maxItems": {
            "title": "Max businesses",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many businesses in total, counted over profile URLs and all searches together.",
            "default": 50
          },
          "maxComplaintsPerBusiness": {
            "title": "Max complaints per business",
            "minimum": 1,
            "type": "integer",
            "description": "Cap on complaints collected per business when 'Include complaints' is on.",
            "default": 100
          },
          "maxReviewsPerBusiness": {
            "title": "Max reviews per business",
            "minimum": 1,
            "type": "integer",
            "description": "Cap on reviews collected per business when 'Include customer reviews' is on.",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "BBB profile pages require US residential proxies. Keep the default.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}