{
  "openapi": "3.0.1",
  "info": {
    "title": "BBB Scraper: Ratings, Accreditation, Complaints, Reviews",
    "description": "Search bbb.org (US and Canada) by keyword and city, state or ZIP, or paste BBB profile URLs. Get BBB rating, accreditation date, phone, website, years in business, complaint and review counts. Optional review and complaint text. Status rows are free.",
    "version": "0.1",
    "x-build-id": "r057OcesbO6EHh2il"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dottti~bbb-business-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dottti-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/dottti~bbb-business-scraper/runs": {
      "post": {
        "operationId": "runs-sync-dottti-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/dottti~bbb-business-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-dottti-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": "Search terms",
            "type": "array",
            "description": "Categories or keywords, the same as the BBB search box. Examples: roofing, plumber, dentist, auto repair, or a business name. Each term runs in each location. Leave empty if you only use profile URLs.",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "Locations",
            "type": "array",
            "description": "City and state, state, or ZIP / postal code. Examples: Austin, TX; 10001; Toronto, ON. Leave empty to search without a location.",
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country",
            "enum": [
              "USA",
              "CAN"
            ],
            "type": "string",
            "description": "USA or Canada. Profile URLs work for both, whatever you pick here.",
            "default": "USA"
          },
          "maxResultsPerSearch": {
            "title": "Max businesses per search",
            "minimum": 1,
            "maximum": 225,
            "type": "integer",
            "description": "Stops each term + location pair after this many businesses. BBB shows at most 225 results per search, so split big areas by city or ZIP code.",
            "default": 10
          },
          "maxResults": {
            "title": "Max businesses in total",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stops the whole run after this many business rows.",
            "default": 1000
          },
          "profileUrls": {
            "title": "BBB profile URLs",
            "type": "array",
            "description": "BBB business profile links, for example https://www.bbb.org/us/tx/austin/profile/roofing-contractors/fiducia-roofing-restoration-0825-90019908. Review and complaint sub-pages work too. A bad or missing profile gets a free status row.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Sort search results",
            "enum": [
              "Relevance",
              "Rating",
              "Distance",
              "AToZ",
              "ZToA"
            ],
            "type": "string",
            "description": "Order BBB uses for search results.",
            "default": "Relevance"
          },
          "accreditedOnly": {
            "title": "Accredited businesses only",
            "type": "boolean",
            "description": "Keep only BBB Accredited Businesses. Skipped businesses are not charged.",
            "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. Not rated (NR) businesses are dropped when this is set. Skipped businesses are not charged.",
            "default": ""
          },
          "includeCounts": {
            "title": "Add review and complaint counts",
            "type": "boolean",
            "description": "Adds the number of public customer reviews and complaints for each business, and the average review stars when the business has 15 reviews or fewer. Two small requests per business.",
            "default": true
          },
          "includeProfileDetails": {
            "title": "Try full profile pages (experimental)",
            "type": "boolean",
            "description": "Tries each BBB profile page for website, accreditation date, years in business and closed-complaint counts. bbb.org often refuses these pages to cloud servers. When it does, the row keeps search data (detailLevel = search) and you pay the same business price. After 3 refusals the run stops trying.",
            "default": false
          },
          "includeReviews": {
            "title": "Add customer reviews",
            "type": "boolean",
            "description": "Adds one row per public customer review: stars, date, text and business reply. Reviewer names are left out. Charged per row at the lower review/complaint price.",
            "default": false
          },
          "maxReviewsPerBusiness": {
            "title": "Max reviews per business",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Newest first. BBB serves 15 per page.",
            "default": 15
          },
          "includeComplaints": {
            "title": "Add complaints",
            "type": "boolean",
            "description": "Adds one row per public complaint: type, status, date, text and the business response. BBB masks personal details in complaint text. Charged per row at the lower review/complaint price.",
            "default": false
          },
          "maxComplaintsPerBusiness": {
            "title": "Max complaints per business",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Newest first. BBB serves 15 per page.",
            "default": 15
          },
          "proxyConfiguration": {
            "title": "Proxy (optional)",
            "type": "object",
            "description": "Leave off to use the automatic fallback below. If you set a proxy here, it is used for every request and the fallback is off."
          },
          "autoProxyFallback": {
            "title": "Automatic proxy fallback",
            "type": "boolean",
            "description": "Starts without a proxy. If bbb.org blocks or challenges requests, switches to Apify datacenter proxy, then residential. Proxy cost is included in the price.",
            "default": true
          },
          "allowResidentialFallback": {
            "title": "Allow residential proxy as the last step",
            "type": "boolean",
            "description": "Turn off to never use residential proxy. Profile details may then fall back to search data only.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Businesses in parallel",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Requests are still spaced out. Higher is faster and more likely to be rate-limited.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}