# Better Business Bureau Email Scraper (`leads-scraper/better-business-bureau-email-scraper`) Actor

Better Business Bureau Email Scraper SD - Better Business Bureau Email Scraper is a lead generation tool that extracts leads with public contact emails, account names and profile URLs from Better Business Bureau results by keyword, location and email domain - Better Business Bureau email extractor.

- **URL**: https://apify.com/leads-scraper/better-business-bureau-email-scraper.md
- **Developed by:** [Leads Scraper](https://apify.com/leads-scraper) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 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

### Better Business Bureau Email Scraper

The Better Business Bureau Email Scraper extracts publicly indexed contact emails from BBB business profiles across the United States and Canada. It is built for teams that want prospects with a reputational signal attached, not just a name and a phone number.

A BBB listing tells you something a plain directory cannot: the business cared enough to be listed, and often to be accredited. The Better Business Bureau Email Scraper turns that filtered universe into a dataset you can work in minutes.

Every field the Better Business Bureau Email Scraper writes comes from publicly indexed Google results for `bbb.org`. Nothing is scraped from behind a login, and no BBB API is involved.

Marketing agencies, insurance brokerages, franchise developers and market researchers all use the Better Business Bureau Email Scraper for the same reason: the source pre-filters for businesses that take their reputation seriously.

#### What the Better Business Bureau Email Scraper does

The Better Business Bureau Email Scraper builds Google queries with the `site:` operator against `bbb.org`. It parses each result block structurally, locating the `<h3>` title and the smallest surrounding block.

A domain-filtered regex then pulls emails from the block text. Every match is normalised, deduplicated globally and pushed straight into your Apify dataset.

The Better Business Bureau Email Scraper never logs into BBB, never uses a BBB API and never opens the BBB website. There is no browser, no JavaScript rendering, no authentication and no cookies.

#### Why the Better Business Bureau Email Scraper produces higher-intent lists

Insurance brokers and franchise developers do not want every business in a ZIP code. They want the operators who invest in credibility, and BBB listing is a cheap proxy for exactly that.

The Better Business Bureau Email Scraper therefore returns a smaller but better-qualified pool than a mass consumer directory. Response rates on a BBB-sourced list tend to reflect that self-selection.

B2B SaaS teams selling compliance, bookkeeping, payroll or commercial insurance use it the same way. So do market researchers benchmarking how many accredited providers exist in a metro.

#### Features of the Better Business Bureau Email Scraper

Everything in this table is implemented in the Better Business Bureau Email Scraper today.

| Feature | What it means in practice |
|---|---|
| Google `site:` search over `bbb.org` | Covers US and Canadian BBB business profiles |
| Query expansion | Base, quoted and `intitle:` variants plus one query per modifier; base queries run first |
| Domain filtering | Only emails ending in your `customDomains` values are kept |
| Global deduplication | Each email is emitted once per run across every query and page |
| Email normalisation | Understands `name [at] domain [dot] com`, `name (at) domain`, `name @ domain.com`, `domain .com`, zero-width characters and the full-width `＠` |
| Junk filter | Rejects `email@`, `yourname@`, `test@`, `xxx@` and single-character locals |
| Boundary-correct matching | `@gmail.com` never matches inside `@gmail.company` or `@gmail.com.br` |
| Soft-wrap repair | Drops a hit that is only the tail of another email in the same block |
| Structural block parsing | Works from the `<h3>` title, not Google's CSS class names |
| Whole-page fallback parser | A markup change degrades to "emails without account details", not "no emails" |
| Concurrency control | `asyncio` worker pool with a shared stop signal on `maxEmails` |
| Retries and block detection | Up to 3 attempts per page, exponential backoff, a fresh proxy session per request, CAPTCHA and consent pages detected and retried |
| Failed-query requeue | Blocked or failed queries are retried once at the end of the run |
| Resumable state | Key-value store state keyed by an input hash, saved on `PERSIST_STATE`, `MIGRATING` and `ABORTING` |
| Run summary logging | Pages fetched, blocked pages, retries and emails per page |

#### How the Better Business Bureau Email Scraper works

A run of the Better Business Bureau Email Scraper always follows the same six steps.

1. Read your input: keywords, location, email domains and limits.
2. Build queries such as `site:bbb.org roofing contractor "@gmail.com" "Fort Worth"`.
3. Fetch Google result pages through the Apify GOOGLE_SERP proxy using async `aiohttp`.
4. Parse each result block structurally to isolate title, business label and snippet.
5. Extract and normalise emails with a domain-filtered regex.
6. Deduplicate globally and push each lead to the dataset immediately.

Because the Better Business Bureau Email Scraper streams results as it finds them, an aborted run keeps everything collected so far.

#### Input fields for the Better Business Bureau Email Scraper

These are the exact inputs the Better Business Bureau Email Scraper accepts, with shipped defaults.

| Field | Type | Default | Meaning |
|---|---|---|---|
| `keywords` | array (required) | `["contractor", "local business"]` | Search terms describing the businesses you want |
| `location` | string | `""` | Optional location phrase added to every query |
| `customDomains` | array | `["@gmail.com", "@yahoo.com"]` | Only emails on these domains are kept; `@` optional |
| `maxEmails` | integer 1-10000 | `20` | Stop after this many unique emails |
| `countryCode` | string | `""` | Two-letter country for the search proxy (US, GB, DE...) |
| `expandQueries` | boolean | `true` | Search each keyword x domain pair in several phrasings |
| `queryModifiers` | array | `["email", "contact", "enquiries", "owner", "get a quote"]` | Extra words combined with each keyword when expansion is on |
| `maxPagesPerQuery` | integer 1-50 | `30` | Page cap per query |
| `maxConcurrency` | integer 1-20 | `5` | Parallel queries |

#### Example input for the Better Business Bureau Email Scraper

```json
{
  "keywords": ["roofing contractor", "restoration company", "hvac contractor"],
  "location": "Fort Worth, TX",
  "customDomains": ["@gmail.com", "@yahoo.com", "@sbcglobal.net"],
  "maxEmails": 400,
  "countryCode": "US",
  "expandQueries": true,
  "queryModifiers": ["email", "contact", "owner", "get a quote"],
  "maxPagesPerQuery": 30,
  "maxConcurrency": 5
}
```

#### Location: the highest-leverage input in the Better Business Bureau Email Scraper

BBB organises itself around regional bureaus, so location phrasing maps unusually well onto how listings are written. The Better Business Bureau Email Scraper benefits directly from that structure.

Metro-level phrases work best. Try `"Fort Worth, TX"`, `"Plano, TX"`, `"Marietta, GA"`, `"Gwinnett County"`, `"Naperville, IL"` or `"Mississauga, ON"` for Canada.

Because Google caps a single query at roughly 300 results, one run per city out-produces one run per state every time. Ten Dallas-Fort Worth suburbs will beat a single `"Texas"` run comfortably.

For Canadian coverage, point the Better Business Bureau Email Scraper north: set `countryCode` to `CA` and use city names such as `"Hamilton, ON"`, `"Surrey, BC"` or `"Laval, QC"`.

Treat the Better Business Bureau Email Scraper as a per-metro tool and total coverage grows with every extra market you queue.

#### Output fields from the Better Business Bureau Email Scraper

Every dataset item written by the Better Business Bureau Email Scraper carries all fourteen fields.

| Field | Meaning |
|---|---|
| `network` | Platform name |
| `keyword` | The keyword that produced the lead |
| `query` | The exact Google query used |
| `title` | Raw result title |
| `accountName` | Account label Google prints |
| `fullName` | Display name parsed from a profile-style title; empty for post captions |
| `username` | URL-safe handle when the platform exposes one; otherwise `null` |
| `profileUrl` | Canonical account URL when a handle is known; otherwise empty |
| `url` | Direct platform link when exposed, else the profile URL |
| `description` | Bio snippet, cleaned of labels and engagement counters |
| `email` | Lower-cased email address |
| `emailDomain` | The matched domain |
| `possiblyTruncated` | `true` when Google's snippet ellipsis touched the email |
| `foundAt` | ISO 8601 UTC timestamp |

#### Example output from the Better Business Bureau Email Scraper

```json
[
  {
    "network": "Better Business Bureau",
    "keyword": "roofing contractor",
    "query": "site:bbb.org roofing contractor \"@gmail.com\" \"Fort Worth, TX\"",
    "title": "Lone Star Roofing & Restoration | BBB Business Profile",
    "accountName": "Lone Star Roofing & Restoration",
    "fullName": "Lone Star Roofing & Restoration",
    "username": "us-tx-fort-worth-lone-star-roofing",
    "profileUrl": "https://www.bbb.org/us-tx-fort-worth-lone-star-roofing",
    "url": "https://www.bbb.org/us-tx-fort-worth-lone-star-roofing",
    "description": "Accredited since 2014. Storm damage and re-roof specialists. Estimates: lonestarroofing.fw@gmail.com",
    "email": "lonestarroofing.fw@gmail.com",
    "emailDomain": "@gmail.com",
    "possiblyTruncated": false,
    "foundAt": "2026-08-31T11:20:07.442Z"
  },
  {
    "network": "Better Business Bureau",
    "keyword": "hvac contractor",
    "query": "site:bbb.org hvac contractor \"@yahoo.com\" \"Fort Worth, TX\"",
    "title": "Trinity Air Comfort - BBB Business Profile",
    "accountName": "Trinity Air Comfort",
    "fullName": "Trinity Air Comfort",
    "username": null,
    "profileUrl": "",
    "url": "",
    "description": "Residential and light commercial HVAC service. Contact trinityaircomfort@yahoo.com for scheduling.",
    "email": "trinityaircomfort@yahoo.com",
    "emailDomain": "@yahoo.com",
    "possiblyTruncated": false,
    "foundAt": "2026-08-31T11:21:35.909Z"
  }
]
```

#### Use cases for the Better Business Bureau Email Scraper

Teams pick the Better Business Bureau Email Scraper when list quality matters more than raw list size.

| Use case | Who runs it | Typical setup |
|---|---|---|
| Commercial insurance prospecting | Insurance brokerage | `["roofing contractor", "restoration company"]`, `location: "Fort Worth, TX"` |
| Franchise territory analysis | Franchise development team | `["cleaning service"]`, `location: "Gwinnett County"` |
| Accredited-only agency outreach | Local marketing agency | `["dentist", "chiropractor"]`, `location: "Marietta, GA"` |
| Payroll and HR software leads | B2B SaaS | `["landscaping", "staffing agency"]`, `location: "Plano, TX"` |
| Vendor due-diligence shortlists | Procurement team | `["electrical contractor"]`, `location: "Naperville, IL"` |
| Canadian market entry | Expanding SMB vendor | `["moving company"]`, `location: "Mississauga, ON"`, `countryCode: "CA"` |
| Reputation-led market research | Market researcher | Same keyword across 15 metros, compare unique counts |
| Partner recruitment | Home warranty provider | `["plumber", "hvac contractor"]`, multi-city runs |

#### Tuning the Better Business Bureau Email Scraper for better yield

Start with three to six closely related trade terms. `"roofing contractor"`, `"storm damage repair"` and `"restoration company"` reach different BBB profiles than `"roofing"` alone.

Widen `customDomains` beyond the defaults. Established US small businesses still use `@gmail.com`, `@yahoo.com`, `@aol.com`, `@sbcglobal.net`, `@bellsouth.net` and `@comcast.net` heavily.

Leave `expandQueries` on so the Better Business Bureau Email Scraper works around Google's per-query ceiling. Base queries run first, so the strongest results land early.

Keep `maxConcurrency` near the default of 5. Higher parallelism raises the share of blocked pages that need retrying without adding much throughput.

#### What to expect from a Better Business Bureau Email Scraper run

In our measured Google run, BBB parsed 10 result blocks, 6 of which carried a business identity and resolved to a profile URL, producing 8 unique emails. That is a solid result for this family.

The gap between 10 blocks and 6 identities is normal: BBB titles are sometimes rendered without a handle Google exposes. Those rows still deliver a usable email.

Volume from the Better Business Bureau Email Scraper varies with keyword, domain list and location. Narrow trades in small metros legitimately return a handful of rows.

If a run comes back thin, widen `customDomains` first, then add trade synonyms, then split the metro into suburbs.

#### Responsible use, GDPR and CAN-SPAM

The Better Business Bureau Email Scraper collects only emails businesses have published on a public BBB profile. Sending obligations remain yours, and this section is guidance rather than legal advice.

CAN-SPAM requires accurate headers, an honest subject line, a physical postal address and a working opt-out honoured promptly. GDPR and UK GDPR require a lawful basis, a privacy notice and a route to erasure - relevant if you also work European markets.

Canada's anti-spam legislation is stricter than CAN-SPAM, so check consent rules before mailing Canadian BBB contacts. Suppress opt-outs, record provenance, and do not resell the raw dataset.

#### Limitations of the Better Business Bureau Email Scraper

Read these before planning a campaign around the Better Business Bureau Email Scraper.

- Only finds businesses whose email is publicly visible in Google's index. Profiles that hide contact details behind a form will not appear.
- Google caps a single query at roughly 300 results, which is why query expansion exists.
- `possiblyTruncated: true` means Google's snippet ellipsis touched the address - verify before sending.
- `username` and `profileUrl` are populated only when Google's result exposes a handle. In our measured run 6 of 10 blocks resolved a handle; the rest still carried `accountName`, `fullName` and an email. This is a Google limitation, not a bug.
- Requires the Apify GOOGLE_SERP proxy; the Better Business Bureau Email Scraper cannot run without Apify proxy credentials.
- Free Apify plans are capped at 100 emails per run; paid plans are uncapped.
- Results vary with keywords, domains and location, and no volume is guaranteed.
- Accreditation status, ratings and complaint counts are not extracted - the output schema is the fourteen fields listed above.

#### Better Business Bureau Email Scraper FAQ

#### How many results should I expect from the Better Business Bureau Email Scraper?

Our measured run parsed 10 blocks, resolved 6 business identities and produced 8 unique emails. Real totals scale with how many cities and trades you queue.

#### Does the Better Business Bureau Email Scraper return BBB ratings or accreditation status?

No. It writes the fourteen output fields listed above. Rating and accreditation text sometimes appears inside `description`, but it is not a separate parsed field.

#### Does it log into BBB?

No. The Better Business Bureau Email Scraper never logs in, never uses a BBB API and never opens the BBB website. All data comes from publicly indexed Google results.

#### Does it cover Canada?

Yes, `bbb.org` includes Canadian bureaus. Set `countryCode` to `CA` and use Canadian city phrases in `location`.

#### Why do some rows have `username: null`?

Google sometimes prints a business name without a handle. Those rows have an empty `profileUrl` but still carry `accountName`, `fullName` and the email.

#### Can I target corporate domains instead of webmail?

Yes. Put any domain in `customDomains` and the Better Business Bureau Email Scraper turns each one into its own set of queries.

#### How is this different from a general BBB listing scraper?

A listing scraper collects addresses, phone numbers and ratings. The Better Business Bureau Email Scraper does one job: finding published email addresses on the domains you nominate.

#### What is `possiblyTruncated`?

A flag meaning Google's snippet ellipsis touched the email, so it may be cut short. Filter or verify those rows before sending.

#### Do I need Apify proxy credentials?

Yes. The Better Business Bureau Email Scraper runs on the Apify GOOGLE_SERP proxy and cannot operate without it.

#### Is the free plan enough to evaluate it?

Yes for testing. The free plan caps a run at 100 emails; paid plans remove the cap.

#### Can a run resume after a migration?

Yes. State lives in the key-value store keyed by an input hash, saved on `PERSIST_STATE`, `MIGRATING` and `ABORTING` events.

#### Which sibling Actors pair best with this one?

For US trades, add the [Yellow Pages Email Scraper](https://apify.com/leads-scraper/yellow-pages-email-scraper) and the [Manta Email Scraper](https://apify.com/leads-scraper/manta-email-scraper). For home-improvement specifically, the [Houzz Email Scraper](https://apify.com/leads-scraper/houzz-email-scraper) and [Angi Email Scraper](https://apify.com/leads-scraper/angi-email-scraper) cover adjacent ground.

### Related Actors

| Actor | What it collects |
|---|---|
| [Better Business Bureau Email and Phone Number Scraper](https://apify.com/leads-scraper/better-business-bureau-email-and-phone-number-scraper) | Emails and phone numbers from Better Business Bureau |
| [Better Business Bureau Phone Number Scraper](https://apify.com/leads-scraper/better-business-bureau-phone-number-scraper) | Public phone numbers from Better Business Bureau |
| [Angi Email Scraper](https://apify.com/leads-scraper/angi-email-scraper) | Public contact emails from Angi |
| [Bark Email Scraper](https://apify.com/leads-scraper/bark-email-scraper) | Public contact emails from Bark |
| [Bizapedia Email Scraper](https://apify.com/neuro-scraper/bizapedia-email-scraper) | Public contact emails from Bizapedia |
| [Brownbook Email Scraper](https://apify.com/neuro-scraper/brownbook-email-scraper) | Public contact emails from Brownbook |
| [Callupcontact Email Scraper](https://apify.com/neuro-scraper/callupcontact-email-scraper) | Public contact emails from CallUpContact |
| [Capterra Email Scraper](https://apify.com/leads-scraper/capterra-email-scraper) | Public contact emails from Capterra |
| [Clutch Email Scraper](https://apify.com/leads-scraper/clutch-email-scraper) | Public contact emails from Clutch |
| [Crunchbase Email Scraper](https://apify.com/leads-scraper/crunchbase-email-scraper) | Public contact emails from Crunchbase |
| [Cybo Email Scraper](https://apify.com/neuro-scraper/cybo-email-scraper) | Public contact emails from Cybo |
| [Cylex Email Scraper](https://apify.com/neuro-scraper/cylex-email-scraper) | Public contact emails from Cylex |
| [EC21 Email Scraper](https://apify.com/neuro-scraper/ec21-email-scraper) | Public contact emails from EC21 |
| [Europages Email Scraper](https://apify.com/leads-scraper/europages-email-scraper) | Public contact emails from Europages |
| [ExportHub Email Scraper](https://apify.com/neuro-scraper/exporthub-email-scraper) | Public contact emails from ExportHub |
| [FindUsLocal Email Scraper](https://apify.com/neuro-scraper/finduslocal-email-scraper) | Public contact emails from FindUsLocal |
| [Foursquare Email Scraper](https://apify.com/neuro-scraper/foursquare-email-scraper) | Public contact emails from Foursquare |
| [Fyple Email Scraper](https://apify.com/neuro-scraper/fyple-email-scraper) | Public contact emails from Fyple |
| [G2 Email Scraper](https://apify.com/neuro-scraper/g2-email-scraper) | Public contact emails from G2 |
| [Hotfrog Email Scraper](https://apify.com/leads-scraper/hotfrog-email-scraper) | Public contact emails from Hotfrog |
| [Houzz Email Scraper](https://apify.com/leads-scraper/houzz-email-scraper) | Public contact emails from Houzz |
| [Infobel Email Scraper](https://apify.com/neuro-scraper/infobel-email-scraper) | Public contact emails from Infobel |
| [Kompass Email Scraper](https://apify.com/leads-scraper/kompass-email-scraper) | Public contact emails from Kompass |
| [Lacartes Email Scraper](https://apify.com/neuro-scraper/lacartes-email-scraper) | Public contact emails from Lacartes |
| [Manta Email Scraper](https://apify.com/leads-scraper/manta-email-scraper) | Public contact emails from Manta |
| [MapQuest Email Scraper](https://apify.com/neuro-scraper/mapquest-email-scraper) | Public contact emails from MapQuest |
| [N49 Email Scraper](https://apify.com/neuro-scraper/n49-email-scraper) | Public contact emails from N49 |
| [Porch Email Scraper](https://apify.com/neuro-scraper/porch-email-scraper) | Public contact emails from Porch |
| [Scoot Email Scraper](https://apify.com/neuro-scraper/scoot-email-scraper) | Public contact emails from Scoot |
| [Thomasnet Email Scraper](https://apify.com/leads-scraper/thomasnet-email-scraper) | Public contact emails from Thomasnet |
| [Thumbtack Email Scraper](https://apify.com/leads-scraper/thumbtack-email-scraper) | Public contact emails from Thumbtack |
| [Touch Local Email Scraper](https://apify.com/leads-scraper/touch-local-email-scraper) | Public contact emails from Touch Local |
| [TradeIndia Email Scraper](https://apify.com/leads-scraper/tradeindia-email-scraper) | Public contact emails from TradeIndia |
| [Trustpilot Email Scraper](https://apify.com/leads-scraper/trustpilot-email-scraper) | Public contact emails from Trustpilot |
| [Tupalo Email Scraper](https://apify.com/leads-scraper/tupalo-email-scraper) | Public contact emails from Tupalo |
| [Yalwa Email Scraper](https://apify.com/leads-scraper/yalwa-email-scraper) | Public contact emails from Yalwa |
| [Yellow Pages Email Scraper](https://apify.com/leads-scraper/yellow-pages-email-scraper) | Public contact emails from Yellow Pages |
| [Angi Email and Phone Number Scraper](https://apify.com/neuro-scraper/angi-email-and-phone-number-scraper) | Emails and phone numbers from Angi |
| [Bark Email and Phone Number Scraper](https://apify.com/neuro-scraper/bark-email-and-phone-number-scraper) | Emails and phone numbers from Bark |
| [Bizapedia Email and Phone Number Scraper](https://apify.com/neuro-scraper/bizapedia-email-and-phone-number-scraper) | Emails and phone numbers from Bizapedia |
| [Brownbook Email and Phone Number Scraper](https://apify.com/neuro-scraper/brownbook-email-and-phone-number-scraper) | Emails and phone numbers from Brownbook |
| [CallUpContact Email and Phone Number Scraper](https://apify.com/neuro-scraper/callupcontact-email-and-phone-number-scraper) | Emails and phone numbers from CallUpContact |

### Leave a review

If the Better Business Bureau Email Scraper saved you time, please leave a star rating and a
short review on the Actor page.

Reviews are how other buyers judge whether a tool works, and they tell us which features to
build next.

If something did not work, email <neurodata.apify@gmail.com>
instead - bugs get fixed faster than they get complained about.

# Actor input Schema

## `keywords` (type: `array`):

Search terms describing the Better Business Bureau accounts you want (niche, job title, industry).

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

Optional location phrase added to every query (e.g. "New York").

## `customDomains` (type: `array`):

Only emails ending with one of these domains are collected. With or without the leading @. Each domain is searched separately, so more domains means more results but a longer run - remove some for a faster, narrower search, or add your own (e.g. @company.com).

## `maxEmails` (type: `integer`):

Stop once this many unique emails have been collected.

## `countryCode` (type: `string`):

Two-letter country code for the search proxy (e.g. US, GB, DE). Empty for any.

## `expandQueries` (type: `boolean`):

Search each keyword x domain pair with several phrasings. Recommended - Google caps a single query at ~300 results.

## `queryModifiers` (type: `array`):

Extra words combined with each keyword when Expand queries is on. Tuned for Better Business Bureau.

## `maxPagesPerQuery` (type: `integer`):

Google rarely returns more than ~30 pages for one query.

## `maxConcurrency` (type: `integer`):

How many queries run in parallel.

## Actor input object example

```json
{
  "keywords": [
    "contractor",
    "local business"
  ],
  "location": "",
  "customDomains": [
    "@gmail.com",
    "@yahoo.com"
  ],
  "maxEmails": 20,
  "countryCode": "",
  "expandQueries": true,
  "queryModifiers": [
    "email",
    "contact",
    "enquiries",
    "owner",
    "get a quote"
  ],
  "maxPagesPerQuery": 30,
  "maxConcurrency": 5
}
```

# Actor output Schema

## `results` (type: `string`):

Records produced by Better Business Bureau Email Scraper, stored in the run's default dataset.

# 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 = {
    "keywords": [
        "contractor",
        "local business"
    ],
    "location": "",
    "customDomains": [
        "@gmail.com",
        "@yahoo.com"
    ],
    "countryCode": "",
    "queryModifiers": [
        "email",
        "contact",
        "enquiries",
        "owner",
        "get a quote"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("leads-scraper/better-business-bureau-email-scraper").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 = {
    "keywords": [
        "contractor",
        "local business",
    ],
    "location": "",
    "customDomains": [
        "@gmail.com",
        "@yahoo.com",
    ],
    "countryCode": "",
    "queryModifiers": [
        "email",
        "contact",
        "enquiries",
        "owner",
        "get a quote",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("leads-scraper/better-business-bureau-email-scraper").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 '{
  "keywords": [
    "contractor",
    "local business"
  ],
  "location": "",
  "customDomains": [
    "@gmail.com",
    "@yahoo.com"
  ],
  "countryCode": "",
  "queryModifiers": [
    "email",
    "contact",
    "enquiries",
    "owner",
    "get a quote"
  ]
}' |
apify call leads-scraper/better-business-bureau-email-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,leads-scraper/better-business-bureau-email-scraper"
        }
    }
}
```

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/7rTPdR9ybkYKuCLAc/builds/gfVXJSha2abRfComc/openapi.json
