
Ultimate Yelp Scraper
- epctex/yelp-scraper
- Modified
- Users 58
- Runs 4.5k
- Created by
epctex
Gather info on millions of businesses, events, and reviews. Scrape businesses and extract descriptions, images, menus, addresses, and all other properties.. Customize with search terms, filters, and mappings for limitless insights. Ultimate Yelp scraper you need. No limits! No limits!
To run the code examples, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token. For a more detailed explanation, please read about running Actors via the API in Apify Docs.
from apify_client import ApifyClient
# Initialize the ApifyClient with your API token
client = ApifyClient("<YOUR_API_TOKEN>")
# Prepare the Actor input
run_input = {
"search": "grill",
"searchLocation": "Los Angeles",
"reviewSort": "relevance_desc",
"startUrls": [
"https://www.yelp.com/biz/maxs-restaurant-glendale-glendale-3",
"https://www.yelp.com/user_details?userid=a_UbCGv_MTAHFs3P_zxUDA",
"https://www.yelp.com/search?find_desc=max&find_loc=Los+Angeles%2C+CA",
"https://www.yelp.com/collection/qGqt9YpsLBCH5nruuVCK2A/Food",
"https://www.yelp.com/collections/user?userid=a_UbCGv_MTAHFs3P_zxUDA",
"https://www.yelp.com/events/la/browse?start_date=20230215",
"https://www.yelp.com/events/monterey-park-monterey-park-strong-star-ballroom-shooting-community-resources",
],
"maxItems": 20,
"endPage": 1,
"endPageForReviews": 1,
"extendOutputFunction": "($) => { return {} }",
"customMapFunction": "(object) => { return {...object} }",
"proxy": { "useApifyProxy": True },
}
# Run the Actor and wait for it to finish
run = client.actor("epctex/yelp-scraper").call(run_input=run_input)
# Fetch and print Actor results from the run's dataset (if there are any)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)