Yelp Business Scraper
Under maintenancePricing
Pay per usage
Go to Apify Store
Yelp Business Scraper
Under maintenanceAn 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
Maintained by CommunityActor 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:
| Field | Description |
|---|---|
name | Business name |
phone | Business phone number |
website | Business website URL |
rating | Average Yelp rating (e.g., 4.5) |
reviews | Total number of Yelp reviews |
address | Business address |
sourceUrl | Yelp 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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
searchTerm | String | Yes | - | Business type or service to search for |
location | String | Yes | - | City, state, or area to search in |
maxItems | Number | No | 50 | Maximum number of businesses to extract |
Example Search Terms
Business Types:
dentistrestaurantplumberlawyergymsalon
Locations:
Los AngelesNew York, NYSan FranciscoChicago, ILMiami, 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
- URL Generation: Constructs Yelp search URLs based on search term and location
- Page Navigation: Navigates to Yelp search results pages
- Data Extraction: Uses specialized selectors to extract business information
- Contact Details: Extracts phone numbers, websites, and addresses
- Rating Analysis: Captures Yelp ratings and review counts
- Data Validation: Ensures only businesses with valid names and URLs are included
- 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
- Clone this repository
- Install dependencies:
npm install - Run the actor:
npm start
Development
npm start- Run the actornpm run format- Format code with Prettiernpm run lint- Run ESLintnpm run lint:fix- Fix ESLint issues
Architecture
src/main.js- Main entry point and input validationsrc/routes.js- Request routing and page type detectionsrc/handlers/yelpSearchResults.js- Yelp search results scraping logicsrc/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