# BBB Better Business Directory Scraper (No Coding Required) (`rosweltvofficial/my-actor`) Actor

The BBB Business Scraper quickly finds and collects info on businesses from the BBB website. Enter a business type and location, and the tool gathers names, addresses, ratings, and more for all matching businesses—fast and easy!

- **URL**: https://apify.com/rosweltvofficial/my-actor.md
- **Developed by:** [Roswel](https://apify.com/rosweltvofficial) (community)
- **Categories:** Lead generation, Automation, Other
- **Features:** Limited permissions
- **Stats:** 51 total users, 0 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## BBB Business Scraper

This Apify actor scrapes business listings and (optionally) detailed business profiles from the Better Business Bureau (BBB) website for any business type and location in the USA or Canada.

### Features

- **Concurrent scraping:** Scrapes up to 5 business profiles at a time for fast results.
- **Flexible search:** Search by business type, location, and country.
- **Detailed output:** Extracts business name, phone, website, accreditation status, BBB rating, years in business, owner info, license numbers, categories, and more.
- **Clean address:** The `address` field is always formatted as `Address, City, State, Zip Code` (if available). There are no separate `city`, `state`, or `zip_code` fields in the output.
- **Robust extraction:** Uses both structured data (JSON-LD) and visible page content for maximum coverage.

### Input Schema

- `business_type` (string): Type of business to search for (e.g. "Garage Door Repair").
- `location` (string): City and state (e.g. "Jacksonville, FL").
- `country` (string): Country ("USA" or "Canada").
- `max_pages` (integer): Maximum number of search result pages to crawl.
- `scrape_profiles` (boolean): Whether to scrape detailed business profiles.
- `include_non_accredited` (boolean): Include non-accredited businesses in results.

### Output Fields

- `business_name`
- `profile_url`
- `phone`
- `address` (always formatted as `Address, City, State, Zip Code`)
- `website`
- `accreditation_status`
- `bbb_rating`
- `business_started`
- `business_incorporated`
- `bbb_file_opened`
- `entity_type`
- `owners`
- `license_numbers`
- `categories`

### Usage

1. Set your search criteria in the Apify input UI or via API.
2. Run the actor.
3. Download the results from the Apify dataset tab.

### Local Development

1. Install dependencies:
   ```sh
   pip install -r requirements.txt
   playwright install
   ```
2. Run the actor locally:
   ```sh
   python src/main.py
   ```

### Notes

- The actor is optimized for Apify's cloud environment but can also be run locally with Docker.
- If you increase the number of concurrent profiles above 5, you may encounter browser crashes or rate limits.
- The address parser is robust for most US/CA addresses, but edge cases may still occur. If you find a problematic address, please report it.

***

MIT License

# Actor input Schema

## `business_type` (type: `string`):

Enter the type of business or service you want to find. Examples: 'Garage Door Repair', 'Plumber', 'Restaurant', 'Dentist', 'Roofing Contractor'

## `location` (type: `string`):

Enter the city and state where you want to find businesses. Examples: 'Jacksonville, FL', 'New York, NY', 'Los Angeles, CA'

## `country` (type: `string`):

The country to search in. Leave as 'USA' for most searches.

## `max_pages` (type: `integer`):

Maximum number of pages to search. Each page shows about 20 businesses.

## `scrape_profiles` (type: `boolean`):

If enabled, I'll visit each business profile to get detailed information like BBB rating, years in business, owner info, and more. This takes longer but gives you much more data.

## `include_non_accredited` (type: `boolean`):

BBB Accredited businesses have higher ratings and more information. Non-accredited businesses may have limited data.

## Actor input object example

```json
{
  "business_type": "Garage Door Repair",
  "location": "Jacksonville, FL",
  "country": "USA",
  "max_pages": 2,
  "scrape_profiles": true,
  "include_non_accredited": true
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("rosweltvofficial/my-actor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("rosweltvofficial/my-actor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call rosweltvofficial/my-actor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rosweltvofficial/my-actor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/cjNYD5fVDvi9w9QzY/builds/FLCI7Ydfw7lcxsSiT/openapi.json
