Skip to content

piotrv1001/bbb-scraper-nodejs-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Scrape BBB (Better Business Bureau) in Node.js

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.

BBB scraper results

What this example does

  • 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

Prerequisites

Installation

npm install

Environment setup

Copy .env.example to .env and add your Apify API token:

cp .env.example .env

Then edit .env:

APIFY_TOKEN=your_apify_token_here

Usage

npm start

Code example

import { 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/docs

Example output

See sample-output.json for a full example. Each result includes:

  • businessName — the business name
  • address, city, state, postalcode — full address
  • tobText — 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 member
  • phone — array of phone numbers
  • location — latitude/longitude string
  • distance — distance from the searched location
  • categories — array of business category tags
  • bbbName — name of the local BBB chapter
  • reportUrl — path to the full BBB business profile
  • leaveReviewUrl — path to the review submission page
  • accreditationStatus — BBB accreditation status (if applicable)
  • hasServiceArea / serviceArea — service area info

Use cases

  • 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

Try the actor on Apify

Open the BBB Advanced Scraper on Apify

Related resources

License

MIT

About

Node.js example showing how to scrape BBB (Better Business Bureau) business listings using the Apify BBB Advanced Scraper actor

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors