Search Yelp businesses in a metro, pull one business in full with hours, amenities and health inspections, and page through review bodies with owner responses. 3 endpoints, 2 credits each, structured JSON.
---
name: yelp-business-data
description: Search Yelp businesses in a metro, pull one business in full with hours, amenities and health inspections, and page through review bodies with owner responses. 3 endpoints, 2 credits each, structured JSON.
version: 1.0.0
tags: yelp, local-business, business-listings, local-seo, reviews, review-mining, ratings, reputation-management, restaurants, lead-generation, local-data, business-hours, competitor-research, agents, structured-data, json, ai-agents, scraping-api
metadata:
openclaw:
requires:
env:
- SCAVIO_API_KEY
primaryEnv: SCAVIO_API_KEY
timeout: 120
throttle: 1
emoji: "\u2B50"
homepage: https://scavio.dev/docs/yelp-search?utm_source=agent-skills&utm_medium=skill&utm_campaign=yelp-business-data
---
# Yelp via Scavio
Search Yelp businesses in a metro, read one business in full, and page through its reviews. All endpoints return structured JSON.
## When to trigger
Use this skill when the user asks to:
- Find local businesses by term and location, in Yelp's ranked order
- Filter by price band, open-now, or Yelp's own attribute aliases
- Pull one business in full - rating histogram, price band, categories, address and coordinates, phone, website and menu links, hours and holidays, amenities, photos, popular items, health inspections, Q&A, licences, claim status
- Read review bodies with author expertise, attached photos, reaction counts and the owner's response
- Build local-lead lists, reputation monitors or competitor comp sets
## Setup
Get a free API key at [scavio.dev](https://scavio.dev/?utm_source=agent-skills&utm_medium=skill&utm_campaign=yelp-business-data) (50 free credits to get started, no card required):
```bash
export SCAVIO_API_KEY=sk_live_your_key
```
### If you do not have a key yet
An agent running this skill without `SCAVIO_API_KEY` set will get `401` on every
call below. The whole path from nothing to a working key is self-serve:
1. Sign up at [dashboard.scavio.dev](https://dashboard.scavio.dev/sign-up?utm_source=agent-skills&utm_medium=skill&utm_campaign=yelp-business-data) - email or Google, no card required.
2. A key is created for the account automatically at signup. It is on the dashboard under API Keys, ready to copy.
3. A new account starts with 50 credits. Endpoints in this skill cost 1 credit each unless the table below says otherwise.
When the balance runs out the API answers `402` with a JSON body carrying
`billing_url`. Topping up needs no code change - the same key keeps working.
The smallest purchase is 2,500 credits for $25, and monthly plans work out
cheaper per credit if the usage is steady rather than one-off.
Every request is a `POST` with a JSON body and:
```
Authorization: Bearer $SCAVIO_API_KEY
```
## Endpoints
Base URL: `https://api.scavio.dev`. Every Yelp endpoint costs **2 credits**.
| Endpoint | Credits | What it returns |
|---|---|---|
| `POST /api/v1/yelp/search` | 2 | Businesses in Yelp's ranked order: rating, review count, price band, categories, address, contact rails, hours, photos, review snippet; each row carries `business_id` **and** `alias` |
| `POST /api/v1/yelp/business` | 2 | One business in full - **plus the first page of reviews at no extra cost** |
| `POST /api/v1/yelp/reviews` | 2 | A page of reviews: rating, full text, language, author profile and expertise counts, attached photos, reaction counts, owner response |
## Workflow
1. **Find businesses:** call `/yelp/search` with `term` **and** `location` (or a full `yelp.com/search` URL as `url`). Read `businesses[].business_id` or `alias`.
2. **One business:** call `/yelp/business` with that `business_id` - an alias like `desnudo-coffee-austin-2`, the opaque encid, or a `yelp.com/biz` URL all work. **This already includes page 1 of the reviews.**
3. **More reviews:** call `/yelp/reviews` starting at **`page: 2`**.
### The two ways to waste 2 credits
- **`/yelp/reviews` with `page: 1` re-fetches the document `/business` already returned.** It is the same content for another 2 credits. Always start review paging at page 2.
- **A search without `location`** has no fixed place, so the same request reports on a different metro from one run to the next. `location` is effectively required even though the schema allows a `url` instead.
### Pagination
Yelp fixes the page size at **10** for both search and reviews.
- **`/search`** takes a 1-based `page`. `count` is the 10-row page, `total_results` is Yelp's headline count, `results_per_page` and `start` are echoed back.
- **`/reviews`** takes a 1-based `page` and carries `has_next_page`. A page past the last review is a **404**, not an empty result - stop on `has_next_page: false`.
- **`/business`** takes no paging parameter.
## Parameters
### Search (`/search`)
| Parameter | Type | Default | Description |
|---|---|---|---|
| `term` | string | with `location` | What to look for (1-200 chars) |
| `location` | string | with `term` | Metro, neighbourhood or address (1-200 chars) |
| `url` | string | alternative | Full `yelp.com/search` URL instead of term + location (1-1000 chars) |
| `page` | integer | -- | 1-based, page size fixed at 10 |
| `sort` | string | `recommended` | `recommended`, `rating`, `review_count` |
| `price` | integer[] | -- | Any of `1`, `2`, `3`, `4` (1-4 items) |
| `open_now` | boolean | -- | Open at request time |
| `attributes` | string[] | -- | Raw Yelp filter aliases, max 20 (`RestaurantsDelivery`, `GoodForKids`, `WheelchairAccessible`) |
`(term AND location)` or `url` is required.
`sort` is closed - Yelp **ignores** an unrecognised sort and serves default ranking under a `200`, so an invented value buys a 2-credit call for a sort that never ran. `attributes` is the opposite: a deliberate passthrough, because Yelp's vocabulary runs to roughly 117 aliases per vertical. An alias Yelp does not know is ignored upstream and the results come back unfiltered - so check that the filter you asked for is reflected in the results before reporting it as applied.
### Business (`/business`)
| Parameter | Type | Default | Description |
|---|---|---|---|
| `business_id` | string | one of | Alias (`desnudo-coffee-austin-2`), opaque encid, or a `yelp.com/biz` URL |
| `url` | string | one of | Full `yelp.com/biz` URL |
### Reviews (`/reviews`)
| Parameter | Type | Default | Description |
|---|---|---|---|
| `business_id` | string | one of | Alias, encid, or biz URL |
| `url` | string | one of | Full `yelp.com/biz` URL |
| `page` | integer | -- | **Start at 2** - page 1 is what `/business` already returned |
| `sort` | string | `relevance` | `relevance`, `newest`, `oldest`, `rating_high`, `rating_low`, `elites` |
| `rating` | integer | -- | `1`-`5`. Changes `filtered_review_count`, not `review_count` |
## Examples
```python
import requests
BASE = "https://api.scavio.dev"
# Your key from https://scavio.dev. Load it from your environment or secret
# store in real code - keep it out of source control.
API_KEY = "sk_your_key_here"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
# 1. Always send location - a location-less search drifts between metros
found = requests.post(f"{BASE}/api/v1/yelp/search", headers=HEADERS,
json={"term": "coffee", "location": "Austin, TX",
"sort": "review_count", "price": [1, 2], "open_now": True}).json()
row = found["data"]["businesses"][0]
# 2. Full business record - page 1 of the reviews rides along free
biz = requests.post(f"{BASE}/api/v1/yelp/business", headers=HEADERS,
json={"business_id": row["alias"]}).json()["data"]
print(biz["rating"], biz["review_count"], biz["not_recommended_review_count"])
first_page_reviews = biz["reviews"]
# 3. Page PAST it. Never ask for page 1 here - it is the same 2 credits twice.
more = requests.post(f"{BASE}/api/v1/yelp/reviews", headers=HEADERS,
json={"business_id": row["alias"], "page": 2, "sort": "newest"}).json()["data"]
# 4. One-star reviews only: filtered_review_count is the count that matches
one_star = requests.post(f"{BASE}/api/v1/yelp/reviews", headers=HEADERS,
json={"business_id": row["alias"], "rating": 1, "page": 2}).json()["data"]
print(one_star["filtered_review_count"], "of", one_star["review_count"])
```
Paging reviews, stopping on the signal Yelp actually gives:
```python
def review_pages(business_id, start=2, max_pages=4, **body):
"""10 per page, 2 credits per page. Page 1 came free with /business."""
out = []
for page in range(start, start + max_pages):
data = requests.post(f"{BASE}/api/v1/yelp/reviews", headers=HEADERS,
json={"business_id": business_id, "page": page, **body}).json()["data"]
out += data["reviews"]
if not data["has_next_page"]: # past the last page is a billed 404
break
return out
```
## Response shapes
Every response uses the envelope `{ data, response_time, credits_used, credits_remaining }`. Key `data` fields:
- **search** — `term`, `location`, `url`, `location_display`, `city`, `state`, `country`, `latitude`, `longitude`, `bounds`, `categories`, `vertical`, `sort`, `attributes`, `open_now`, `breadcrumbs`, `total_results`, `results_per_page`, `page`, `start`, `related_searches`, `count`, `businesses[]` (`pos`, `business_id`, `alias`, `name`, `url`, `rank`, `is_ad`, `rating`, `review_count`, `price_range`, `categories`, `address`, `street_address`, `city`, `state`, `postal_code`, `country`, `neighborhoods`, `timezone`, `hours`, `image`, `images`, `photos`, `snippet`, `tags`, `actions`, `highlights`, `is_yelp_guaranteed`, `has_verified_license`, `is_service_area_business`).
- **business** — `business_id`, `alias`, `name`, `url`, `summary`, `specialties`, `history`, `year_established`, `rating`, `review_count`, `rating_distribution`, `not_recommended_review_count`, `review_counts_by_language`, `price_range`, `categories`, `phone`, `website`, `menu_url`, `address`, `city`, `state`, `postal_code`, `country`, `neighborhoods`, `timezone`, `latitude`, `longitude`, `service_areas`, `hours[]`, `hours_today`, `is_open_now`, `is_closed`, `holidays`, `attributes`, `amenities`, `popular_items[]`, `popular_items_omitted`, `review_highlights`, `health_inspections`, `question_count`, `questions`, `is_claimed`, `is_advertiser`, `verified_licenses`, `messaging_response_time`, `filtered_review_count`, `reviews[]` (page 1).
- **reviews** — `business_id`, `alias`, `name`, `url`, `rating`, `review_count`, `rating_distribution`, `filtered_review_count`, `sort`, `rating_filter`, `start`, `page`, `has_next_page`, `count`, `reviews[]` (`pos`, `review_id`, `url`, `rating`, `text`, `language`, `published_date`, `experience_date`, `author`, `author_url`, `author_photo`, `author_expertise`, `author_expertise_count`, `photos`, `videos`, `reactions`, `is_first_review`, `previous_review_count`, `owner_response`, `owner_response_date`, `owner_response_from`, `appreciated_by_owner`).
```json
{
"data": {
"term": "coffee",
"location": "Austin, TX",
"page": 1,
"start": 0,
"results_per_page": 10,
"total_results": 240,
"count": 10,
"businesses": [
{
"pos": 1,
"business_id": "kQ7pCn2m0Vx9",
"alias": "desnudo-coffee-austin-2",
"name": "Desnudo Coffee",
"rating": 4.5,
"review_count": 2153,
"price_range": "$",
"categories": ["Coffee & Tea"],
"city": "Austin",
"state": "TX",
"url": "https://www.yelp.com/biz/desnudo-coffee-austin-2"
}
]
},
"credits_used": 2,
"credits_remaining": 998
}
```
## Guardrails
- Every call is **2 credits**, including one that comes back empty - budget before paging.
- **Never call `/reviews` with `page: 1`.** `/business` already returned that page; the repeat is 2 credits for a duplicate.
- **Always send `location`.** Without it the answer is about wherever the request exited, and it can differ between two identical runs.
- Never invent a `sort` value. An unrecognised sort is ignored and you pay for default ranking.
- `attributes` is a passthrough, so an alias Yelp does not recognise silently disappears. Verify the filter took effect before telling the user it was applied.
- `rating` on `/reviews` changes `filtered_review_count`, not `review_count`. Quote the right one.
- Yelp's recommendation software hides some reviews entirely. Those are never returned and are counted in `not_recommended_review_count` - so the reviews you can read are not the whole picture, and an average you compute yourself will not match Yelp's.
- `popular_items` can arrive as stub shells; those rows are dropped and `popular_items_omitted` flags it. If that flag is `true`, do not claim the item list is complete.
- Never fabricate business names, ratings, addresses, hours or review text. Only return what the API returned.
- Always include the business `url` so the user can verify.
## Failure handling
- `400` means an invalid or missing parameter - `term` without `location` and no `url`, a `sort` outside its enum, or more than 20 attributes. Fix and retry.
- `401` means the API key is invalid or missing. Check `SCAVIO_API_KEY`.
- `404` means the business does not exist, or the review page is past the last one. Stop on `has_next_page: false` rather than discovering the end with a billed 404.
- `429` means rate or usage limit exceeded. Wait before retrying. See [rate limits](https://scavio.dev/docs/rate-limits?utm_source=agent-skills&utm_medium=skill&utm_campaign=yelp-business-data).
- `502` / `503` mean upstream is temporarily unavailable - wait a few seconds and retry, up to a few times.
- An empty search is usually the filters: drop `open_now`, widen `price`, or use a broader `term`.
- If `SCAVIO_API_KEY` is not set, prompt the user to export it before continuing.
## SDKs
```bash
pip install scavio==0.15.0
```
```python
from scavio import ScavioClient
client = ScavioClient() # reads SCAVIO_API_KEY
found = client.yelp.search(term="coffee", location="Austin, TX", sort="review_count")
alias = found["data"]["businesses"][0]["alias"]
biz = client.yelp.business(business_id=alias) # includes page 1 of reviews
more = client.yelp.reviews(business_id=alias, page=2) # start at 2, never 1
```
```bash
npm install scavio@0.15.0
```
```javascript
import { Scavio } from "scavio";
const client = new Scavio(); // reads SCAVIO_API_KEY
const found = await client.yelp.search({ term: "coffee", location: "Austin, TX" });
const more = await client.yelp.reviews({ business_id: found.data.businesses[0].alias, page: 2 });
```
don't have the plugin yet? install it then click "run inline in claude" again.
search yelp businesses in a metro, read one business in full, and page through its reviews. all endpoints return structured json. built on Scavio.
use this skill to find local businesses by term and location in Yelp's ranked order, pull a single business in full (rating, hours, amenities, health inspections, photos, q&a, reviews), and page through review bodies with author expertise and owner responses. this covers lead generation, reputation monitoring, competitor research, and local seo work. you need a Scavio API key (free tier available, 50 credits to start).
external connection: Scavio API
SCAVIO_API_KEY (required)endpoint base url: https://api.scavio.dev
headers: Authorization: Bearer $SCAVIO_API_KEY
rate limits: check scavio.dev/docs/rate-limits. standard tier allows concurrent calls; hitting 429 means wait and retry.
step 1: search for businesses (call /api/v1/yelp/search)
term (what to search, 1-200 chars) and location (metro/neighborhood/address, 1-200 chars). both required unless you pass a full yelp.com/search url as url.page (1-based, default 1), sort (default recommended; also rating, review_count), price (array of 1-4), open_now (boolean), attributes (raw yelp filter aliases, max 20)data.businesses[] array. each row has business_id, alias, name, rating, review_count, price_range, address, city, state, hours, image, snippet, url. also returns total_results, page, start, count (10 per page).page vs total_results / 10)step 2: fetch one business in full (call /api/v1/yelp/business)
business_id (can be alias like desnudo-coffee-austin-2, opaque encid, or full yelp.com/biz url)data containing full business record: name, rating, review_count, rating_distribution, not_recommended_review_count, price_range, categories, phone, website, menu_url, address, hours[], is_open_now, holidays, amenities, popular_items[], health_inspections[], questions[], is_claimed, verified_licenses[]. also includes page 1 of reviews at no extra cost under data.reviews[] (10 reviews max on this page).step 3: page through additional reviews (call /api/v1/yelp/reviews)
business_id (or url), page must start at 2 (page 1 is what step 2 already returned), optional sort (default relevance; also newest, oldest, rating_high, rating_low, elites), optional rating (1-5 to filter to that star rating only)data containing reviews[] array (10 per page), page, has_next_page (boolean), filtered_review_count (count after rating filter), review_count (total unfiltered). each review has review_id, rating, text, language, published_date, author, author_expertise_count, photos[], reactions, owner_response (may be null), owner_response_date, appreciated_by_owner.page and repeat step 3 until has_next_page is false. calling with page: 1 on this endpoint re-fetches what step 2 already returned (wastes 2 credits, same data).if SCAVIO_API_KEY is not set
if search returns empty result set
count: 0, total_results: 0open_now, widen price range, use a broader term) and retry. a narrower location string (e.g. neighborhood vs metro) may also help specificity.if search result has an unrecognized sort value
sort against enum (recommended, rating, review_count) before sending.if attributes filter is not reflected in results
GoodForKids but results show no such filter applied.attributes is a passthrough. verify the filter took effect in the results before telling the user it was applied. if it did not, the alias may not exist for that vertical or Yelp may have renamed it.if /reviews page call returns 404
page number higher than available pageshas_next_page: false before making the next call instead of discovering the end with a failed request.if response status is 429 (rate limited)
if response status is 502 or 503 (upstream unavailable)
if popular_items_omitted is true
popular_items[] array is incompleteif rating filter is applied on reviews
filtered_review_count differs from review_countfiltered_review_count as the number of reviews matching the filter, not review_count (which is the total).if Yelp hides reviews (normal behavior)
not_recommended_review_countresponse envelope (all endpoints):
{
"data": { /* endpoint-specific data */ },
"response_time": "123ms",
"credits_used": 2,
"credits_remaining": 48
}
search output (data key):
term, location, location_display, city, state, country, latitude, longitudepage, start, results_per_page, total_results, countbusinesses[] array with 10 rows (or fewer on last page): each row includes business_id, alias, name, rating, review_count, price_range, categories[], address, city, state, postal_code, neighborhoods[], hours, image, url, is_ad, rank, snippetbusiness output (data key):
business_id, alias, name, url, rating, review_count, rating_distribution (histogram), not_recommended_review_countprice_range, categories[], phone, website, menu_urladdress, city, state, postal_code, latitude, longitude, neighborhoods[], timezonehours[] (array of day objects with day, start, end, is_overnight), hours_today, is_open_now, holidays[]amenities (key-value map of amenity names to boolean), popular_items[] (name, description, photo), popular_items_omitted (boolean)health_inspections[], questions[], is_claimed, verified_licenses[]reviews[] (page 1, up to 10): each has review_id, rating, text, author, author_expertise_count, published_date, photos[], reactions, owner_response, owner_response_datereviews output (data key):
business_id, alias, name, url, page, start, has_next_pagereview_count (total), filtered_review_count (after rating filter), sort, rating_filterreviews[] (up to 10 per page): each has review_id, rating, text, language, published_date, experience_date, author, author_url, author_photo, author_expertise_count, photos[], reactions, owner_response, owner_response_date, owner_response_from, appreciated_by_ownererror responses:
400: invalid/missing param (e.g. term without location, bad sort, >20 attributes). fix and retry.401: invalid or missing SCAVIO_API_KEY. check env var.402: account credits exhausted. check billing_url in response body. recharge at dashboard; same key continues working.404: business not found, or review page is past the last. do not retry the same call.429: rate or concurrency limit. wait and retry.502/503: upstream unavailable. wait a few seconds and retry up to 2-3 times.200 response with data.businesses[] containing at least one row. the first row's alias or business_id is ready for step 2.200 response with data.business_id, data.rating, data.hours, data.amenities, and data.reviews[] (page 1). you can now read the full business record and initial reviews.200 response with data.reviews[] containing rows. check has_next_page: if false, you have reached the end. if true, increment page and call again.url to verify on Yelp. credits are deducted from the account (shown in credits_remaining).get a free api key at scavio.dev (50 free credits to start, no card required):
export SCAVIO_API_KEY=sk_live_your_key
if you don't have a key yet:
402 with billing_url in the response. recharge at that url.import requests
BASE = "https://api.scavio.dev"
API_KEY = "sk_your_key_here" # load from env in production
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
# 1. search with required location
found = requests.post(f"{BASE}/api/v1/yelp/search", headers=HEADERS,
json={"term": "coffee", "location": "Austin, TX",
"sort": "review_count", "price": [1, 2], "open_now": True}).json()
row = found["data"]["businesses"][0]
print(f"{row['name']} ({row['alias']}): {row['rating']} stars, {row['review_count']} reviews")
# 2. full business record (page 1 of reviews included for free)
biz = requests.post(f"{BASE}/api/v1/yelp/business", headers=HEADERS,
json={"business_id": row["alias"]}).json()["data"]
print(f"Hours: {biz['hours_today']}")
print(f"Amenities: {biz.get('amenities', {})}")
print(f"Page 1 reviews: {len(biz.get('reviews', []))} loaded")
# 3. page 2 and beyond (never ask for page 1 here, it costs 2 credits for the same data)
page_2 = requests.post(f"{BASE}/api/v1/yelp/reviews", headers=HEADERS,
json={"business_id": row["alias"], "page": 2, "sort": "newest"}).json()["data"]
print(f"Page 2: {page_2['count']} reviews, has_next_page: {page_2['has_next_page']}")
# 4. filter to 1-star reviews only
one_star = requests.post(f"{BASE}/api/v1/yelp/reviews", headers=HEADERS,
json={"business_id": row["alias"], "rating": 1, "page": 2}).json()["data"]
print(f"{one_star['filtered_review_count']} one-star reviews (of {one_star['review_count']} total)")
from scavio import ScavioClient
client = ScavioClient() # reads SCAVIO_API_KEY from env
found = client.yelp.search(term="coffee", location="Austin, TX", sort="review_count")
alias = found["data"]["businesses"][0]["alias"]
biz = client.yelp.business(business_id=alias) # includes page 1 of reviews
more = client.yelp.reviews(business_id=alias, page=2) # start at 2, never 1
import { Scavio } from "scavio";
const client = new Scavio(); // reads SCAVIO_API_KEY from env
const found = await client.yelp.search({ term: "coffee", location: "Austin, TX" });
const biz = await client.yelp.business({ business_id: found.data.businesses[0].alias });
const more = await client.yelp.reviews({ business_id: found.data.businesses[0].alias, page: 2 });
def all_reviews(business_id, start=2, max_pages=None, **kwargs):
"""fetch reviews starting at page 2 (page 1 came free with /business)."""
reviews = []
page = start
count = 0
while True:
resp = requests.post(f"{BASE}/api/v1/yelp/reviews", headers=HEADERS,
json={"business_id": business_id, "page": page, **kwargs})
if resp.status_code == 404:
break # past the last page
data = resp.json()["data"]
reviews.extend(data["reviews"])
count += 1
if max_pages and count >= max_pages:
break
if not data["has_next_page"]:
break # legitimate end signal
page += 1
return reviews
/reviews with page: 1. /business already returned that page at no extra cost. asking for it again wastes 2 credits on duplicate data.