This example shows how to extract business listings from the Better Business Bureau (BBB) using the BBB Advanced Scraper Apify actor — no scraper code required. Just call the actor via the Apify API and get structured business data back.
- Calls the BBB Advanced Scraper actor with a search keyword and location
- Waits for the run to complete
- Fetches all results from the actor's dataset
- Prints each business record to the console
- Node.js v18 or higher
- An Apify account (free tier available)
- Your Apify API token
npm installCopy .env.example to .env and add your Apify API token:
cp .env.example .envThen edit .env:
APIFY_TOKEN=your_apify_token_herenpm startimport { ApifyClient } from 'apify-client';
import 'dotenv/config';
// Initialize the ApifyClient with your Apify API token
// Set APIFY_TOKEN in your .env file (copy .env.example to get started)
const client = new ApifyClient({
token: process.env.APIFY_TOKEN,
});
// Prepare Actor input
const input = {
"search": "Home Improvement",
"location": "Los Angeles, CA"
};
// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/bbb-advanced-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/docsSee sample-output.json for a full example. Each result includes:
businessName— the business nameaddress,city,state,postalcode— full addresstobText— type of business (matches your search term)rating— BBB letter rating (e.g.A+,A,B)ratingScore— numeric rating score (0–100)bbbMember— whether the business is a BBB memberphone— array of phone numberslocation— latitude/longitude stringdistance— distance from the searched locationcategories— array of business category tagsbbbName— name of the local BBB chapterreportUrl— path to the full BBB business profileleaveReviewUrl— path to the review submission pageaccreditationStatus— BBB accreditation status (if applicable)hasServiceArea/serviceArea— service area info
- Lead generation — build targeted lists of local businesses by industry and BBB rating for sales outreach
- Market research — analyze the competitive landscape in any category and geography
- Reputation monitoring — track BBB ratings and accreditation status for businesses over time
- Directory enrichment — supplement CRM or business databases with BBB ratings, contact info, and categories
- Compliance screening — verify vendor or partner accreditation status before onboarding
Open the BBB Advanced Scraper on Apify
- How to Scrape BBB Business Listings — step-by-step blog post
- YouTube tutorial — video walkthrough
MIT
