# Yelp Business Search & Review Scraper (`nimbryxo-studio/yelp-business-search-and-review-scraper`) Actor

Search Yelp by keyword and location, or scrape specific business pages directly, to collect business details, ratings, categories, contact details, and customer reviews.

- **URL**: https://apify.com/nimbryxo-studio/yelp-business-search-and-review-scraper.md
- **Developed by:** [Nimbryxo-studio](https://apify.com/nimbryxo-studio) (community)
- **Categories:** Lead generation, Automation, Travel
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Yelp Business Search & Review Scraper

Search Yelp by keyword and location, or paste specific business page URLs, and get back structured business profiles with ratings, categories, contact details, and the customer reviews shown on each business page.

### What this actor does

- Searches Yelp for every keyword × location pair, or scrapes specific business URLs directly (both can be combined)
- Returns business name, rating, review count, price range, categories, phone, address, and website
- Collects the customer reviews shown on the business page with star rating, date, text, photos, and Useful/Funny/Cool reaction counts
- Loads more search results automatically up to your configured limit (at most 10 result pages per query)
- If the input is unusable or Yelp blocks every attempt, emits a single status record instead of failing the whole run
- Every field below is always present on each business record; fields the business page doesn't show come back as an empty string or empty array rather than being left out

### Output per business

- `directUrl` — full Yelp URL of the business page
- `bizId` — Yelp business slug identifier
- `name` — business name
- `description` — business description from the page's metadata
- `categories` — array of business categories (e.g. `"Pizza"`, `"Italian"`)
- `type` — business type from structured data (e.g. `"Restaurant"`)
- `phone` — business phone number
- `reviewCount` — total number of reviews
- `aggregatedRating` — average star rating (e.g. `"4.5"`)
- `priceRange` — price level (e.g. `"$"`, `"$$"`, `"$$$"`)
- `cuisine` — cuisine type, for restaurants
- `website` — business website URL
- `images` — array of business image URLs
- `address` — object: `streetAddress`, `addressLocality`, `addressRegion`, `postalCode`, `addressCountry`
- `reviews` — array of review objects (empty when `reviewLimit` is 0), each with:
  - `date` — review date
  - `rating` — star rating (1–5; a number or a numeric string depending on how the page delivered it)
  - `text` — review text
  - `photos` — array of photo URLs attached to the review
  - `isUsefulCount`, `isFunnyCount`, `isCoolCount` — reaction counts

#### Status record

Instead of businesses, the dataset holds a single record with `type: "yelp_blocked"`, `reason`, `message` and `scrapedAt` when:

- `reason: "invalid_input"` — the proxy is switched off, or neither `searchTerms` nor `directUrls` was given
- `reason: "upstream_error"` — no business pages could be found or loaded (usually a Yelp block); this record may also list up to 10 `requestedUrls`

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `searchTerms` | array of strings | – | Search queries (e.g. `"pizza"`, `"plumber"`, `"hair salon"`) |
| `locations` | array of strings | – | Locations to search (e.g. `"New York, NY"`); each term is combined with each location. Without locations, terms are searched with no location; locations without terms do nothing |
| `directUrls` | array | – | Direct Yelp business page URLs to scrape instead of searching |
| `searchLimit` | integer | `10` | Maximum business results per term × location pair (1–100) |
| `reviewLimit` | integer | `5` | Maximum reviews per business (0–50; set `0` to skip reviews). Only reviews on the business page itself are read, so fewer may come back |
| `runTimeoutSecs` | integer | `1800` | Wall-clock cap on the run, in seconds (60–7,200); lower it for quick test runs, raise it for large searches |
| `proxy` | object | `{"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}` | **Required.** Residential proxy configuration; Yelp blocks non-residential traffic |

At least one of `searchTerms` or `directUrls` is required, along with `proxy`.

#### Example: keyword search across two cities

```json
{
  "searchTerms": ["pizza", "sushi"],
  "locations": ["New York, NY", "San Francisco, CA"],
  "searchLimit": 5,
  "reviewLimit": 3,
  "proxy": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

#### Example: scrape specific business pages

```json
{
  "directUrls": [
    { "url": "https://www.yelp.com/biz/prince-street-pizza-new-york-2" },
    { "url": "https://www.yelp.com/biz/joes-pizza-new-york" }
  ],
  "reviewLimit": 10,
  "proxy": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

#### Example: business lookup without reviews

```json
{
  "directUrls": [{ "url": "https://www.yelp.com/biz/prince-street-pizza-new-york-2" }],
  "reviewLimit": 0,
  "proxy": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### Use cases

- **Market research** — survey competitor businesses, ratings, and customer feedback in an area
- **Lead generation** — collect business contact details for outreach campaigns
- **Location intelligence** — gauge business density and quality across neighborhoods
- **Review monitoring** — track a specific business's reviews over time with scheduled runs
- **Customer sentiment analysis** — aggregate review text for trend or keyword analysis

### FAQ

**Do I need a proxy?**
Yes. A residential proxy is required — Yelp reliably blocks data-center traffic, so the `proxy` input must stay on the `RESIDENTIAL` group.

**How many businesses can I scrape in one run?**
Up to `searchLimit` businesses per term × location pair (max 100 each), plus every URL in `directUrls`, until `runTimeoutSecs` runs out. Keeping a single run to roughly 100 businesses and splitting larger jobs across runs is the most reliable approach.

**What happens if Yelp blocks the run?**
If no business could be collected, the actor exits cleanly with a single status record (`type: "yelp_blocked"`, `reason: "upstream_error"`) instead of failing, so downstream pipelines can detect the block and retry. Filter on `type` to separate it from business records.

**Why are some review or business fields empty?**
Yelp doesn't expose every field on every business or review — a field comes back as an empty string or array when the business page doesn't actually show it.

**Can I scrape every review for a business?**
No. The actor reads only the reviews shown on the business page itself, in Yelp's default order, up to `reviewLimit`; it does not page through a business's full review history.

**What locations are supported?**
Any location Yelp itself supports. Use `"City, State"` for US locations (e.g. `"New York, NY"`) or a city name for international locations.

**What's the difference between searching and using `directUrls`?**
Searching with `searchTerms` + `locations` discovers businesses matching a query; `directUrls` skips discovery and scrapes the exact business pages you provide — faster when you already know which businesses you want.

**What happens if a run hits `runTimeoutSecs`?**
The actor stops starting new fetches at that mark, pushes everything already collected, and exits cleanly rather than timing out mid-fetch.

**Is this affiliated with Yelp?**
No. This is an independent, third-party actor that reads Yelp's public business pages; it isn't affiliated with or endorsed by Yelp Inc.

# Actor input Schema

## `searchTerms` (type: `array`):

List of search queries (e.g., 'pizza', 'plumber', 'hair salon'). Used together with Locations to find businesses on Yelp.

## `locations` (type: `array`):

List of locations to search in (e.g., 'New York, NY', 'Los Angeles, CA'). Each search term is combined with each location.

## `directUrls` (type: `array`):

List of direct Yelp business page URLs to scrape. Use this to scrape specific businesses without searching.

## `searchLimit` (type: `integer`):

Maximum number of business results to collect per search query. The scraper automatically paginates Yelp search (10 results per page) until this limit is reached, the result set is exhausted, or the run timeout is hit. Higher values mean longer runs.

## `reviewLimit` (type: `integer`):

Maximum number of reviews to collect per business. Set to 0 to skip review extraction.

## `proxy` (type: `object`):

REQUIRED. Yelp uses Cloudflare protection. Residential proxy is mandatory; datacenter IPs are reliably blocked.

## `runTimeoutSecs` (type: `integer`):

Maximum wall-clock time for the run before stopping new fetches. Default 1800s (30 min) suits most production runs; the prefill 240s exists so Apify's 5-min daily quality test passes. Increase for large searchLimit or many locations.

## Actor input object example

```json
{
  "searchTerms": [
    "pizza",
    "sushi",
    "coffee"
  ],
  "locations": [
    "New York, NY",
    "San Francisco, CA"
  ],
  "directUrls": [
    {
      "url": "https://www.yelp.com/biz/prince-street-pizza-new-york-2"
    }
  ],
  "searchLimit": 1,
  "reviewLimit": 1,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "runTimeoutSecs": 240
}
```

# Actor output Schema

## `businesses` (type: `string`):

Dataset containing scraped Yelp business data with reviews, ratings, contact information, and more.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchTerms": [
        "pizza"
    ],
    "locations": [
        "New York, NY"
    ],
    "searchLimit": 1,
    "reviewLimit": 1,
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    },
    "runTimeoutSecs": 240
};

// Run the Actor and wait for it to finish
const run = await client.actor("nimbryxo-studio/yelp-business-search-and-review-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

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchTerms": ["pizza"],
    "locations": ["New York, NY"],
    "searchLimit": 1,
    "reviewLimit": 1,
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
    "runTimeoutSecs": 240,
}

# Run the Actor and wait for it to finish
run = client.actor("nimbryxo-studio/yelp-business-search-and-review-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchTerms": [
    "pizza"
  ],
  "locations": [
    "New York, NY"
  ],
  "searchLimit": 1,
  "reviewLimit": 1,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "runTimeoutSecs": 240
}' |
apify call nimbryxo-studio/yelp-business-search-and-review-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/yelp-business-search-and-review-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/7GbUL6yEkG5aFcZSk/builds/B9lt7ADn0mT8JDakg/openapi.json
