{
  "openapi": "3.0.1",
  "info": {
    "title": "BBB Scraper — Better Business Bureau Ratings, Complaints, Leads",
    "description": "Scrape Better Business Bureau business profiles (bbb.org, US & Canada): BBB rating, accreditation, complaints and reviews closed, years in business, entity type, owners, phone, website, address and coordinates. 76 fields per business, read from BBB's own sitemaps. No login, no proxy, no browser.",
    "version": "0.1",
    "x-build-id": "dPqflGNrKk7lcpYBR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/oswaldocarabano~bbb-business-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-oswaldocarabano-bbb-business-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/oswaldocarabano~bbb-business-scraper/runs": {
      "post": {
        "operationId": "runs-sync-oswaldocarabano-bbb-business-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/oswaldocarabano~bbb-business-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-oswaldocarabano-bbb-business-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": "Category or trade",
            "type": "array",
            "description": "What kind of business to look for, e.g. `plumber`, `roofing`, `dentist`, `auto repair`. Matches BBB's own category names.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "Cities",
            "type": "array",
            "description": "Cities as `City, ST`, e.g. `Austin, TX` or `Chicago, IL`. Leave empty to cover whole states, or everything.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "States or provinces",
            "type": "array",
            "description": "Two-letter codes, e.g. `TX`, `CA`, `ON`. Used when you want a whole state rather than single cities.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country",
            "enum": [
              "USA",
              "CAN"
            ],
            "type": "string",
            "description": "BBB covers the United States and Canada.",
            "default": "USA"
          },
          "maxItems": {
            "title": "Maximum businesses",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "How many businesses to return. You are charged per business delivered — never for rows that failed. Hard cap: 50,000 per run.",
            "default": 100
          },
          "onlyAccredited": {
            "title": "Only BBB Accredited businesses",
            "type": "boolean",
            "description": "Restricts the run to accredited businesses, using BBB's own accredited listings. This is a real filter: measured on Austin plumbers it goes from 2,409 businesses to 505. (BBB's search API has an `accredited` parameter that is silently ignored — this actor does not use it.)",
            "default": false
          },
          "fetchProfiles": {
            "title": "Include full profile data",
            "type": "boolean",
            "description": "Fetches each business's BBB profile page and adds ~35 fields the listing does not have: website, years in business, legal form, incorporation dates, complaint and review counts, owners and officers, alternate names, every location. Costs one extra request per business and is charged as a separate event.",
            "default": true
          },
          "mode": {
            "title": "How to find businesses",
            "enum": [
              "auto",
              "sitemap",
              "category",
              "search"
            ],
            "type": "string",
            "description": "`auto` picks for you and is almost always right. `sitemap` sweeps BBB's own profile sitemaps — 575 files of 10,000 profiles, the only path that reaches the whole directory. `category` reads BBB's category pages, which return 15 businesses per page and up to 225 per query. `search` uses BBB's search API, which allows rating filters and sort orders.",
            "default": "auto"
          },
          "ratings": {
            "title": "Only these BBB letter ratings",
            "type": "array",
            "description": "BBB accepts single letters only: A, B, C, D or F, and a letter covers its family (A also returns A+ and A−). It does NOT accept `A+`: asking for `A+` returns zero results even though 90.8% of businesses in BBB's search are rated A+. Leave empty for every rating.",
            "items": {
              "type": "string",
              "enum": [
                "A",
                "B",
                "C",
                "D",
                "F"
              ],
              "enumTitles": [
                "A (includes A+ and A−)",
                "B",
                "C",
                "D",
                "F"
              ]
            },
            "default": []
          },
          "onlyQuoteRequests": {
            "title": "Only businesses that accept quote requests",
            "type": "boolean",
            "description": "Keeps only businesses that take quote requests through BBB — a commercial-intent signal. Measured to change results.",
            "default": false
          },
          "sortOrders": {
            "title": "Sort orders to sweep (search mode)",
            "type": "array",
            "description": "BBB caps every query at 15 pages × 15 results = 225. A-Z and Z-A sweep the same set from opposite ends, so running both returns up to 450 distinct businesses per query instead of 225.",
            "items": {
              "type": "string",
              "enum": [
                "AToZ",
                "ZToA",
                "Rating",
                "Distance"
              ],
              "enumTitles": [
                "A-Z",
                "Z-A",
                "Rating",
                "Distance"
              ]
            },
            "default": [
              "AToZ",
              "ZToA"
            ]
          },
          "includeCategories": {
            "title": "Also export BBB's category taxonomy",
            "type": "boolean",
            "description": "Writes BBB's own category tree (code, name, family, where it was seen) to a separate `categories` dataset. It travels in the same responses, so it costs no extra requests and is charged at $0.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Kept deliberately low. BBB served 20 consecutive requests without a single block in testing, and this actor starts well under that ceiling rather than hunting for it.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}