# Yelp Business Search Scraper (`good-apis/yelp-search-scraper`) Actor

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

## Pricing

$0.80 / 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/platform/actors/running/actors-in-store#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 Search Scraper

Find businesses on **Yelp** for any search term and location — **name, star rating, review count, category tags, price level, and the Yelp business URL** — straight from a query. No login, no browser to manage, fast JSON.

Results come back in Yelp's own **organic ranking** (the "best of" list), with sponsored placements excluded (any that slip through are flagged `is_ad`). Each business's URL/slug feeds straight into the **Yelp Business Detail** and **Yelp Reviews** scrapers.

**Pricing: $0.80 per 1,000 businesses** (pay per result). You're only charged for businesses actually returned.

### What you get

Every business returns:

| Field | Description |
|---|---|
| `name` | Business name |
| `url` | Yelp business page URL |
| `slug` | Yelp business slug (feed to the Detail / Reviews scraper) |
| `rating` | Star rating (0–5) |
| `review_count` | Number of reviews on Yelp |
| `categories` | Yelp category tags (e.g. Plumbing, Water Heater Installation/Repair) |
| `price_range` | Price level ($ – $$$$) when Yelp shows one |
| `is_ad` | `true` if this is a sponsored placement |

### Input

| Field | Required | Description |
|---|---|---|
| `query` | ✓ | A business type or keyword — `restaurants`, `plumbers`, `coffee`, `dentists` … |
| `location` | ✓ | City, area, or ZIP — `San Francisco, CA` or `10001` |
| `max_results` | | How many businesses to return (default 20; one page holds ~10) |

```json
{ "query": "restaurants", "location": "San Francisco, CA", "max_results": 20 }
```

### Example output

```json
{
  "name": "Blue Dragon Plumbing",
  "url": "https://www.yelp.com/biz/blue-dragon-plumbing-austin-2",
  "slug": "blue-dragon-plumbing-austin-2",
  "rating": 4.9,
  "review_count": 527,
  "categories": ["Plumbing"],
  "price_range": null,
  "is_ad": false
}
```

### Python client

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("<username>/yelp-search-scraper").call(
    run_input={"query": "restaurants", "location": "San Francisco, CA", "max_results": 20}
)
for biz in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(biz["name"], biz["rating"], biz["review_count"])
```

### Node.js client

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

const client = new ApifyClient({ token: '<APIFY_TOKEN>' });
const run = await client.actor('<username>/yelp-search-scraper').call({
    query: 'restaurants', location: 'San Francisco, CA', max_results: 20,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((b) => console.log(b.name, b.rating, b.review_count));
```

### FAQ

**How many businesses per run?** One Yelp results page holds ~10 organic businesses; `max_results` caps how many you keep.

**Do I pay for sponsored results?** Sponsored placements are excluded from the organic list; you're charged only for the businesses returned.

**Can I get full details / reviews?** Yes — take a business's `slug` and pass it to the **Yelp Business Detail** or **Yelp Reviews** scraper.

# Actor input Schema

## `query` (type: `string`):

A business type or keyword, e.g. 'restaurants', 'plumbers', 'coffee', 'dentists'.

## `location` (type: `string`):

City, area, or ZIP — e.g. 'San Francisco, CA' or '10001'.

## `max_results` (type: `integer`):

How many businesses to return (one results page holds ~10).

## Actor input object example

```json
{
  "query": "restaurants",
  "location": "San Francisco, CA",
  "max_results": 20
}
```

# Actor output Schema

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

All scraped items in the default dataset.

# 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 = {
    "query": "restaurants",
    "location": "San Francisco, CA",
    "max_results": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("good-apis/yelp-search-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 = {
    "query": "restaurants",
    "location": "San Francisco, CA",
    "max_results": 20,
}

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

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

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

```

## CLI example

```bash
echo '{
  "query": "restaurants",
  "location": "San Francisco, CA",
  "max_results": 20
}' |
apify call good-apis/yelp-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=good-apis/yelp-search-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/jCUYM7CU2ZCbN8fOM/builds/tqhjvgOkUz2ziuA2c/openapi.json
