# Yelp Scraper (`aurenic/yelp-scraper`) Actor

Extract Yelp business profiles and full reviews via Yelp's internal GraphQL endpoint. No login, no API key, no CSRF token. Firefox TLS + US residential proxy.

- **URL**: https://apify.com/aurenic/yelp-scraper.md
- **Developed by:** [Aurenic](https://apify.com/aurenic) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Scraper

Extract Yelp business profiles and full reviews via Yelp's internal GraphQL endpoint. No login, no API key, no CSRF token. Firefox TLS + US residential proxy.

### What does Yelp Scraper do?

Scrape Yelp in two modes:

- **Business URLs** — pass Yelp business pages, get business metadata plus every public review with full text, ratings, author details, photos, owner replies, and reaction counts.
- **Search** — pass a keyword and location, get every business on the results page with the same review detail.

Yelp's frontend is powered by an **unauthenticated GraphQL endpoint at `/gql/batch`** that accepts persisted-query IDs. No Yelp account, no API key, no CSRF token, no cookies. The actor calls that endpoint directly, backed by Firefox TLS fingerprinting and US residential proxy rotation.

### Output fields

#### Business

| Field | Description |
|---|---|
| businessUrl | Yelp business page |
| encBizId | Yelp encrypted business ID |
| name | Business name |
| rating | Average rating (0–5) |
| reviewCount | Total reviews |
| priceRange | Price tier ($$, $$$) |
| categories | Business categories |
| address | Full formatted address |
| phone | Business phone |
| website | Business website |

#### Review

| Field | Description |
|---|---|
| reviewId | Yelp review ID |
| rating | Star rating (1–5) |
| text | Full review text |
| language | Review language |
| authorName | Reviewer display name |
| authorProfileUrl | Reviewer profile |
| authorReviewCount | Reviewer's total reviews |
| authorFriendCount | Reviewer's friend count |
| authorEliteYear | Elite badge year |
| location | Reviewer location |
| createdAt | Review timestamp |
| photos | Attached photo URLs |
| ownerReplyText | Owner response text |
| ownerReplyDate | Owner response date |
| reactionCounts | Useful / funny / cool counts |

### Who is it for?

- **Reputation management agencies** monitoring client reviews across locations
- **Local SEO teams** extracting review corpora for citation and sentiment analysis
- **Competitive intelligence** benchmarking restaurant, salon, and service businesses
- **Market researchers** building local business datasets by category and city
- **AI/ML builders** sourcing labelled review data for sentiment models
- **Franchise operators** auditing review sentiment across every location

### Pricing

**$2.00 per 1,000 results.** No subscription.

| Results | Cost |
|---|---|
| 100 | $0.20 |
| 1,000 | $2.00 |
| 10,000 | $20.00 |

### How to use it

1. Paste **Business URLs** to scrape specific businesses, and/or
2. Enter **Search Queries** with matching **Locations** to discover businesses by keyword.
3. Set **Max Reviews per Business** (default 100) and **Max Businesses** (default 50).
4. Click **Start**.

### Output example

```json
{
  "recordType": "review",
  "reviewId": "abc123xyz",
  "rating": 5,
  "text": "Best pizza in the neighborhood. The crust is perfectly charred...",
  "language": "en",
  "authorName": "Sarah M.",
  "authorProfileUrl": "https://www.yelp.com/user_details?userid=...",
  "authorReviewCount": 142,
  "authorFriendCount": 38,
  "authorEliteYear": "2026",
  "location": "Brooklyn, NY",
  "createdAt": "2026-08-14T18:32:00.000Z",
  "photos": ["https://s3-media0.fl.yelpcdn.com/bphoto/..."],
  "ownerReplyText": "Thanks Sarah! See you soon.",
  "ownerReplyDate": "2026-08-15T10:05:00.000Z",
  "reactionCounts": { "useful": 12, "funny": 3, "cool": 8 },
  "businessUrl": "https://www.yelp.com/biz/lucali-brooklyn",
  "encBizId": "...",
  "businessName": "Lucali",
  "scrapedAt": "2026-09-23T12:00:00.000Z"
}
```

### Technical details

- **No login, no API key, no CSRF token, no cookies.** Yelp's `/gql/batch` endpoint is unauthenticated by design.
- **Firefox TLS fingerprint** via `impit` — Chrome JA3 strings get flagged; Firefox is the confirmed working profile.
- **US residential proxy rotation** — required for Yelp's Cloudflare IP reputation checks. The actor rotates sessions on 403.
- **Persisted-query IDs** — the review feed uses documentId `ef51f33d...`. Yelp rotates these occasionally; if a run logs `persisted query not found`, update the `REVIEW_FEED_DOC_ID` constant.
- **Cursor pagination** — Yelp returns a base64 `endCursor` per page. The actor follows it until the cap or the last page.
- **No browser, no Playwright.** Pure HTTP with TLS fingerprinting.

### Known limits

- **US residential proxy is required.** Yelp blocks datacenter IPs and many non-US residential IPs.
- **Persisted-query rotation.** Yelp's documentId hashes rotate every few months. When they do, the actor logs the exact GraphQL error and the fix is a one-line constant update.
- **Review depth is capped by Yelp itself.** Most businesses return 100–200 reviews per sort order, then `hasNextPage: false`. For deeper coverage, run multiple sort orders.
- **Search mode is best-effort HTML discovery.** If Yelp serves a Cloudflare challenge on the search page, business URL mode still works.
- **`encBizId` extraction** depends on Yelp's HTML. If the pattern changes, the actor logs a diagnostic with the failed marker.

### FAQ

**Do I need a Yelp API key?** No. The GraphQL endpoint is unauthenticated.

**Do I need a proxy?** Yes — US residential proxy is pre-configured and required.

**Why is the run slow?** Yelp rotates through Cloudflare reputation checks. Each business page costs one HTML fetch plus one GraphQL call, with retries on 403.

**How do I export data?** After a run, go to Storage → Export as JSON, CSV, Excel.

### Support

Open an issue on the Actor's page for bugs or feature requests.

# Actor input Schema

## `businessUrls` (type: `array`):

Yelp business URLs (e.g. https://www.yelp.com/biz/xyz-restaurant-san-francisco). Returns business metadata + full reviews.

## `searchQueries` (type: `array`):

Keywords to search (e.g. 'pizza', 'dentist'). Each is paired with a location below.

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

Cities or ZIP codes paired by index with Search Queries. Falls back to the first location if fewer are provided.

## `maxReviewsPerBusiness` (type: `integer`):

Hard cap on reviews per business.

## `maxBusinesses` (type: `integer`):

Hard cap on businesses discovered per search query.

## `sortBy` (type: `string`):

Sort order for the review feed.

## Actor input object example

```json
{
  "businessUrls": [],
  "searchQueries": [
    "pizza"
  ],
  "locations": [
    "New York, NY"
  ],
  "maxReviewsPerBusiness": 1,
  "maxBusinesses": 1,
  "sortBy": "relevance"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "businessUrls": [],
    "searchQueries": [
        "pizza"
    ],
    "locations": [
        "New York, NY"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("aurenic/yelp-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 = {
    "businessUrls": [],
    "searchQueries": ["pizza"],
    "locations": ["New York, NY"],
}

# Run the Actor and wait for it to finish
run = client.actor("aurenic/yelp-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 '{
  "businessUrls": [],
  "searchQueries": [
    "pizza"
  ],
  "locations": [
    "New York, NY"
  ]
}' |
apify call aurenic/yelp-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,aurenic/yelp-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/ydfbQGPQm0uHhekVd/builds/3NBShntWlWFmwMGWH/openapi.json
