# Yelp Business Scraper — Ratings, Hours & Photos (`thenetaji/yelp-business-scraper`) Actor

Fetch a business's full Yelp profile by its URL slug: star rating, categories, structured address, phone number, price band and photos. Several businesses in one run.

- **URL**: https://apify.com/thenetaji/yelp-business-scraper.md
- **Developed by:** [The Netaji](https://apify.com/thenetaji) (community)
- **Categories:** Business, Lead generation, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.40 / 1,000 business profiles

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Yelp Business Scraper

The Actor resolves a Yelp business URL slug — the alias in `/biz/<alias>` — to a structured record: star rating, categories, a structured address, phone number, price band, and photos. It accepts several aliases in one run, one request and one output row per alias.

### Accepted input

| Field | Type | Default | Description |
|---|---|---|---|
| `alias` | array of strings | — (required) | Yelp business slugs, one per line. A full `https://www.yelp.com/biz/...` URL is accepted too and reduced to the slug automatically. |
| `maxItems` | integer | 100 | Maximum businesses to save. `0` removes the limit. One row and one request per alias, so this also bounds the number of requests the run makes. |

```json
{
  "alias": ["tartine-bakery-san-francisco", "blue-bottle-coffee-mint-plaza-san-francisco"],
  "maxItems": 5
}
```

### Response fields

| Field | Contents |
|---|---|
| `alias` | The slug that was fetched, echoed back. |
| `url` | The business's page on Yelp, built from `alias`. |
| `name` | The business name. The one field here that is never null: a page that resolves but carries no name is treated as an error rather than as a business record full of nulls. |
| `rating` | The star rating Yelp displays, 1 to 5. |
| `review_count_display` | The review count exactly as Yelp prints it to a logged-out visitor — an abbreviation such as `"9.2k"`, not an exact figure. Yelp does not publish an exact count at this tier, and the string is not expanded into a number here, since doing so would invent digits of precision Yelp never gave. |
| `phone` | The business's phone number. |
| `price_range` | Yelp's own price band, `$` to `$$$$`. |
| `categories` | The business's Yelp categories. An empty array when the page lists none, never null. |
| `address` | A structured address (`street_address`, `locality`, `region`, `postal_code`, `country`). Null when the page carries no photos, since this is read from the photo list rather than from a listing block Yelp does not publish. |
| `photos` | Business photos, each with its image URL, caption, upload date, and uploader where Yelp names one. |
| `reviews` | Always `null`. See `reviews_note` and the FAQ below. |
| `reviews_note` | States, in the response itself, why `reviews` is always null. |

```json
{
  "alias": "tartine-bakery-san-francisco",
  "url": "https://www.yelp.com/biz/tartine-bakery-san-francisco",
  "name": "Tartine Bakery",
  "rating": 4.3,
  "review_count_display": "9.2k",
  "phone": "(415) 487-2600",
  "price_range": "$$",
  "categories": ["Bakeries", "Desserts", "Cafes"]
}
```

### Behaviour on redirects and missing pages

Yelp redirects aliases freely: a plain slug can 301 to a disambiguated one, and a business that has moved or merged listings resolves to a different alias than the one requested. Redirects are followed, so a stale alias still resolves, and `name` — not the requested `alias` — is the authority on which business was actually returned.

An alias with no Yelp page for it is reported and skipped rather than ending the run; the rest of the list is still processed, and nothing is charged for it.

### Frequently asked questions

**Why is `reviews` always null?**
Yelp renders its review list client-side. A server-fetched page carries loading placeholders and no review prose at all, while the fields in this response — name, rating, address, phone, categories, and photos — are present in the markup itself and reach both a browser and a plain HTTP request equally. No input here changes that; reviews are simply not available at this tier.

**Why is `review_count_display` a string like `"9.2k"` instead of a number?**
Because that is the only figure Yelp publishes to a logged-out client. The exact count appears nowhere on the page, so parsing `"9.2k"` into `9200` would be inventing precision rather than reporting it. A caller that wants an approximate number can parse the string itself, knowingly.

**Why does `address` come back structured while everything else reads like plain text?**
Yelp publishes no `LocalBusiness` block on a business page. The one structured address available is attached to each photo in the page's own photo list, which is why `address` is null on the rare page with no photos rather than falling back to a street line scraped out of the markup.

**Can this look up several businesses in one run?**
Yes. Every line in `alias` is one request and one row; a list of five hundred slugs makes five hundred requests, and one that resolves to no page is skipped rather than stopping the rest.

### Related

[Yelp Search Scraper](https://apify.com/thenetaji/yelp-search-scraper) finds businesses by search term and location when the alias is not already known, and can attach this same business record to each of its results.

# Actor input Schema

## `alias` (type: `array`):

Yelp business slugs to fetch, one per line — the part of the URL after /biz/, e.g. tartine-bakery-san-francisco. A full https://www.yelp.com/biz/... URL works too and is reduced to the slug for you. One request and one row per alias.

## `maxItems` (type: `integer`):

Maximum businesses to save. Set 0 for no limit. One row and one request per alias, so this is also the number of requests the run makes.

## Actor input object example

```json
{
  "alias": [
    "tartine-bakery-san-francisco"
  ],
  "maxItems": 5
}
```

# Actor output Schema

## `dataset` (type: `string`):

All records scraped by this run

# 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 = {
    "alias": [
        "tartine-bakery-san-francisco"
    ],
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("thenetaji/yelp-business-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 = {
    "alias": ["tartine-bakery-san-francisco"],
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("thenetaji/yelp-business-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 '{
  "alias": [
    "tartine-bakery-san-francisco"
  ],
  "maxItems": 5
}' |
apify call thenetaji/yelp-business-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thenetaji/yelp-business-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/JZN3VK1JB3kcahwo5/builds/4ldSThdctXq6bK4Wc/openapi.json
