{
  "openapi": "3.0.1",
  "info": {
    "title": "BBB Scraper: Better Business Bureau Leads, Ratings & Phones",
    "description": "Scrape Better Business Bureau (BBB) business listings by category and city: names, phone numbers, addresses, BBB letter ratings, accreditation, categories and profile links. Free filters. No login.",
    "version": "0.1",
    "x-build-id": "Ll9Y7mlpUqilkZrT2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/techliondev~bbb-business-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-techliondev-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/techliondev~bbb-business-scraper/runs": {
      "post": {
        "operationId": "runs-sync-techliondev-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/techliondev~bbb-business-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-techliondev-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": "🔎 What to search for",
            "type": "array",
            "description": "Business types or names, one per line, for example roofing, plumber, dentist, auto repair or a company name. Each one is searched in every location below.",
            "default": [
              "roofing"
            ],
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "📍 Locations",
            "type": "array",
            "description": "City and state, ZIP code, or province, one per line. Examples: Denver, CO; 78701; Toronto, ON. Leave empty to search the whole country.",
            "default": [
              "Denver, CO"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerSearch": {
            "title": "💯 Maximum businesses per search",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many businesses for each search term and location pair. Businesses removed by your filters are not counted or charged. BBB shows at most 225 results per search; turn on Deep search to get more.",
            "default": 50
          },
          "startUrls": {
            "title": "🔗 Or paste BBB search links",
            "type": "array",
            "description": "Optional. Paste links of BBB search result pages (they contain find_text= and find_loc=). Category and state filters in the link are kept.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "Relevance",
              "Rating",
              "AToZ",
              "ZToA",
              "Distance"
            ],
            "type": "string",
            "description": "Order in which BBB returns results. Best match is what the BBB website shows by default.",
            "default": "Relevance"
          },
          "deepSearch": {
            "title": "Deep search (more than 225 results)",
            "type": "boolean",
            "description": "BBB returns at most 225 businesses per search. When this is on, the Actor repeats the search in other sort orders and keeps only businesses it has not seen yet (in our test, plumbers in Chicago went from 225 to more than 700). You pay only for businesses saved, not for extra requests.",
            "default": false
          },
          "country": {
            "title": "Country",
            "enum": [
              "USA",
              "CAN"
            ],
            "type": "string",
            "description": "Which country's BBB listings to search.",
            "default": "USA"
          },
          "onlyAccredited": {
            "title": "Only BBB Accredited Businesses",
            "type": "boolean",
            "description": "Keep only businesses that are BBB Accredited (they paid to join BBB and agreed to its standards).",
            "default": false
          },
          "minRating": {
            "title": "Minimum BBB rating",
            "enum": [
              "",
              "A+",
              "A",
              "A-",
              "B+",
              "B",
              "B-",
              "C+",
              "C",
              "C-",
              "D+",
              "D",
              "D-",
              "F"
            ],
            "type": "string",
            "description": "Keep only businesses with this BBB letter grade or better. Businesses with no rating are removed when this is set.",
            "default": ""
          },
          "requirePhone": {
            "title": "Only businesses with a phone number",
            "type": "boolean",
            "description": "Remove businesses that have no phone number on BBB.",
            "default": false
          },
          "excludeOutOfBusiness": {
            "title": "Remove businesses marked out of business",
            "type": "boolean",
            "description": "Skip listings that BBB marks as out of business.",
            "default": true
          },
          "states": {
            "title": "Only these states or provinces",
            "type": "array",
            "description": "Two-letter state or province codes, for example CO, WY. Useful because BBB results near a state border include neighboring states.",
            "items": {
              "type": "string"
            }
          },
          "includeKeywords": {
            "title": "Name or category must contain",
            "type": "array",
            "description": "Keep only businesses whose name or BBB category contains at least one of these words, for example commercial or metal. Short words such as HVAC match whole words only.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Name or category must not contain",
            "type": "array",
            "description": "Remove businesses whose name or category contains any of these words, for example gutter or siding.",
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "Only new businesses since the last run",
            "type": "boolean",
            "description": "Remember every business this search has found and save only ones not seen on earlier runs. The first run saves everything and remembers it.",
            "default": false
          },
          "stateName": {
            "title": "Tracking name",
            "type": "string",
            "description": "Optional name for the memory used by new-business tracking. Use a different name for each separate schedule. Leave empty to create one from your searches."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}