# Yelp Business API (`epctex/yelp-business-api`) Actor

Extract business listings from Yelp by keyword, location, URL, or place slug. Get ratings, reviews, hours, amenities, contact info, and more. Sort by rating, review count, or recommended. Ideal for lead generation, market research, and competitor analysis.

- **URL**: https://apify.com/epctex/yelp-business-api.md
- **Developed by:** [epctex](https://apify.com/epctex) (community)
- **Categories:** Lead generation, Developer tools, Other
- **Stats:** 204 total users, 38 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 dataset items

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?

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

## Actor - Yelp Business API

### Yelp Business Scraper

The Yelp Business API supports the following features:

- **Search by keyword** — Search for any business type or category on Yelp.
- **Search by location** — Target a specific city, neighborhood, or region.
- **Scrape by URL** — Provide business detail or search list URLs directly.
- **Scrape by place slug** — Use Yelp place slugs for precise business lookups.
- **Sort results** — Sort by rating, review count, or recommended.

### 💰 Pricing: Transparent Event-Based Costs

Pay only for what you scrape—no subscriptions, no hidden fees:

| Event Type | Price | What's Included |
| ---------- | ----- | --------------- |
| **List Query** | **$0.005** per search/list | First ~10 businesses included FREE (first page) |
| **Detail Query** | **$0.005** per business URL | Each direct business URL or place slug |
| **Dataset Items** | **$0.0005** per place detail | Only charged for results beyond the free ~10 |

#### 📊 Cost Examples

| Scenario | Charges | Calculation | Total Cost |
| -------- | ------- | ----------- | ---------- |
| **1 search, 10 results** | 1 list query | $0.005 × 1 | **$0.005** |
| **1 search, 100 results** | 1 list query + 90 items | $0.005 + ($0.0005 × 90) | **$0.050** |
| **5 searches, 500 results** | 5 list queries + 450 items | ($0.005 × 5) + ($0.0005 × 450) | **$0.250** |
| **10 direct business URLs** | 10 detail queries | $0.005 × 10 | **$0.050** |

### Demo Mode

Free-plan users can try this actor without a subscription. The limit is **5 runs per month** and **10 items per run**. The API is not available on the Free plan. For unrestricted use, [subscribe to a paid plan](https://apify.com/pricing?fpr=yhdrb).

### Input Parameters

| Field | Type | Description | Default |
| ----- | ---- | ----------- | ------- |
| `startUrls` | array | Yelp URLs to start with. Can be a business detail or search list URL. | `[]` |
| `placeSlugs` | array | Yelp place slugs for direct business lookups (e.g. `rise-over-run-san-francisco-2`). | `[]` |
| `searchTerms` | array | Keywords to search for on Yelp (e.g. `pizza`, `dentist`). | `[]` |
| `location` | string | Location to search in (e.g. `San Francisco, CA`). Used together with `searchTerms`. | `""` |
| `sortBy` | string | Sort order for search results: `rating`, `reviewCount`, or `recommended`. Used with `searchTerms`. | `rating` |
| `maxItems` | number | Maximum number of items to return. | `1000` |
| `customMapFunction` | string | Function that takes each object as an argument and returns a mapped object. | `null` |

#### Input Example

```json
{
  "searchTerms": [
    "sushi"
  ],
  "maxItems": 100
}
```

### During the Run

The actor outputs messages as it progresses through each page or URL. If you provide incorrect input, the actor will stop immediately with an explanation of what went wrong.

### Contact

Please visit us through [epctex.com](https://epctex.com) to see all available products. For custom integrations, reach out via the chat box on [epctex.com](https://epctex.com). For support: <business@epctex.com>.

# Actor input Schema

## `startUrls` (type: `array`):

Yelp URLs to start with. Accepts business detail or search list URLs.

## `placeSlugs` (type: `array`):

Yelp place slugs for direct business lookups (e.g. rise-over-run-san-francisco-2).

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

Keywords to search for on Yelp (e.g. pizza, dentist). Use with location for best results.

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

Sort order for search results: rating, reviewCount, or recommended.

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

Location to search in (e.g. San Francisco, CA). Used together with search terms.

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

Maximum number of items that you want as output.

## `customMapFunction` (type: `string`):

Function that takes each object as an argument and returns a mapped object.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.yelp.com/biz/rise-over-run-san-francisco-2?hrid=wTWNPTAfcLTbWsIx1UT4bw"
  ],
  "sortBy": "rating",
  "location": "San Francisco, CA",
  "maxItems": 1000,
  "customMapFunction": "(object) => { return {...object} }"
}
```

# Actor output Schema

## `overview` (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 = {
    "startUrls": [
        "https://www.yelp.com/biz/rise-over-run-san-francisco-2?hrid=wTWNPTAfcLTbWsIx1UT4bw"
    ],
    "sortBy": "rating",
    "location": "San Francisco, CA",
    "maxItems": 1000,
    "customMapFunction": (object) => { return {...object} }
};

// Run the Actor and wait for it to finish
const run = await client.actor("epctex/yelp-business-api").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 = {
    "startUrls": ["https://www.yelp.com/biz/rise-over-run-san-francisco-2?hrid=wTWNPTAfcLTbWsIx1UT4bw"],
    "sortBy": "rating",
    "location": "San Francisco, CA",
    "maxItems": 1000,
    "customMapFunction": "(object) => { return {...object} }",
}

# Run the Actor and wait for it to finish
run = client.actor("epctex/yelp-business-api").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 '{
  "startUrls": [
    "https://www.yelp.com/biz/rise-over-run-san-francisco-2?hrid=wTWNPTAfcLTbWsIx1UT4bw"
  ],
  "sortBy": "rating",
  "location": "San Francisco, CA",
  "maxItems": 1000,
  "customMapFunction": "(object) => { return {...object} }"
}' |
apify call epctex/yelp-business-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,epctex/yelp-business-api"
        }
    }
}

```

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/uuoE0MiCddKHh81Nb/builds/48Zpv7DsomXSGwBiO/openapi.json
