Yelp Business Scraper avatar

Yelp Business Scraper

Under maintenance

Pricing

Pay per usage

Go to Apify Store
Yelp Business Scraper

Yelp Business Scraper

Under maintenance

An Apify actor that extracts business listings from Yelp based on search terms and locations with comprehensive structured data including contact information, ratings, and reviews.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

HappiTap

HappiTap

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

4 days ago

Last modified

Categories

Share

An Apify actor that extracts business listings from Yelp based on search terms and locations with comprehensive structured data including contact information, ratings, and reviews.

What It Does

This scraper extracts structured data from Yelp search results including:

FieldDescription
nameBusiness name
phoneBusiness phone number
websiteBusiness website URL
ratingAverage Yelp rating (e.g., 4.5)
reviewsTotal number of Yelp reviews
addressBusiness address
sourceUrlYelp page URL for this business

Supported Search Types

  • Business Types: Any business category (e.g., 'dentist', 'restaurant', 'plumber')
  • Locations: Cities, states, or specific areas (e.g., 'Los Angeles', 'New York, NY')
  • Combined Searches: Business type + location combinations

Use Cases

  • Lead Generation: Find potential business leads in specific locations
  • Market Research: Analyze business density and competition in areas
  • Contact Information: Gather business contact details for outreach
  • Competitive Analysis: Research competitors in specific markets
  • Local Business Discovery: Find businesses in target locations

Input

The actor accepts the following input format:

{
"searchTerm": "dentist",
"location": "Los Angeles",
"maxItems": 50
}

Input Parameters

ParameterTypeRequiredDefaultDescription
searchTermStringYes-Business type or service to search for
locationStringYes-City, state, or area to search in
maxItemsNumberNo50Maximum number of businesses to extract

Example Search Terms

Business Types:

  • dentist
  • restaurant
  • plumber
  • lawyer
  • gym
  • salon

Locations:

  • Los Angeles
  • New York, NY
  • San Francisco
  • Chicago, IL
  • Miami, FL

Output

The actor outputs structured data for each business found:

{
"name": "Dr. Sarah Johnson Dental Practice",
"phone": "(555) 123-4567",
"website": "https://www.drsarahjohnson.com",
"rating": 4.8,
"reviews": 127,
"address": "123 Main St, Los Angeles, CA 90210",
"sourceUrl": "https://www.yelp.com/biz/dr-sarah-johnson-dental-practice-los-angeles",
"scrapedAt": "2024-01-01T00:00:00.000Z"
}

Example Usage

Search for Dentists in Los Angeles

{
"searchTerm": "dentist",
"location": "Los Angeles",
"maxItems": 50
}

Search for Restaurants in New York

{
"searchTerm": "restaurant",
"location": "New York, NY",
"maxItems": 25
}

Search for Plumbers in San Francisco

{
"searchTerm": "plumber",
"location": "San Francisco",
"maxItems": 30
}

How It Works

  1. URL Generation: Constructs Yelp search URLs based on search term and location
  2. Page Navigation: Navigates to Yelp search results pages
  3. Data Extraction: Uses specialized selectors to extract business information
  4. Contact Details: Extracts phone numbers, websites, and addresses
  5. Rating Analysis: Captures Yelp ratings and review counts
  6. Data Validation: Ensures only businesses with valid names and URLs are included
  7. Structured Output: Returns clean, structured data ready for analysis

Features

  • Flexible Search: Support for any business type and location combination
  • Comprehensive Data: Extracts all essential business information
  • Stealth Mode: Uses Puppeteer with stealth plugins to avoid detection
  • Proxy Support: Built-in proxy rotation for reliable scraping
  • Error Handling: Graceful error handling with detailed logging
  • Data Validation: Ensures data quality with validation checks
  • Contact Information: Extracts phone numbers and website URLs
  • Rating Data: Captures Yelp ratings and review counts

Installation

  1. Clone this repository
  2. Install dependencies: npm install
  3. Run the actor: npm start

Development

  • npm start - Run the actor
  • npm run format - Format code with Prettier
  • npm run lint - Run ESLint
  • npm run lint:fix - Fix ESLint issues

Architecture

  • src/main.js - Main entry point and input validation
  • src/routes.js - Request routing and page type detection
  • src/handlers/yelpSearchResults.js - Yelp search results scraping logic
  • src/puppeteerLauncher.js - Puppeteer browser configuration with stealth mode

Notes

  • The scraper is designed to be respectful of Yelp's servers and includes appropriate delays
  • Results may vary based on Yelp's page structure changes
  • The scraper automatically handles different Yelp page layouts
  • All extracted data is timestamped for tracking purposes
  • Website URLs are cleaned from Yelp redirect links when possible
  • Phone numbers are extracted in various formats and cleaned for consistency