Before you start
- Get an API keySign up for 100 free credits, no card. Keys start with
gs_live_. - Put it in the environmentEvery example reads it from
GROUNDSOCIAL_API_KEY:export GROUNDSOCIAL_API_KEY=gs_live_… - Set up Python
pip install requests
Call Reviews of a Yelp business API from Python
GET /v1/yelp/businesses/{business}/reviews. Save this as main.py and run python main.py. It reads the items in reviews and prints text and rating for each.
import os
import requests
API = "https://api.groundsocial.dev"
HEADERS = {"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}
res = requests.get(
f"{API}/v1/yelp/businesses/katzs-delicatessen-new-york/reviews",
headers=HEADERS,
timeout=60,
)
res.raise_for_status()
data = res.json()
for item in data["reviews"]:
print(item.get("text"), item.get("rating"))
print("credits charged:", res.headers["x-credits-charged"])The response
A real Yelp response to this call, recorded from the live API on 27 Nov 2026 and shortened for display: arrays keep their first items and … marks every cut. The recorded page had 20 items in reviews. Live calls return current data in the same shape.
{
"business": {
"id": "V7lXZKBDzScDeGB8JmnzSA",
"alias": "katzs-delicatessen-new-york",
"name": "Katz's Delicatessen",
"url": "https://www.yelp.com/biz/katzs-delicatessen-new-york",
"rating": 4.1,
"review_count": 17151,
"rating_distribution": {
"1": 1076,
"2": 961,
"3": 1910,
"4": 4426,
"5": 8783
},
"possible_languages": [
{
"language": "en",
"count": 16961
},
{
"language": "de",
"count": 62
},
"… 12 more"
]
},
"total": 16961,
"feed": "recommended",
"reviews": [
{
"id": "gda9UOamGqZhPsL2TCwWAQ",
"url": "https://www.yelp.com/biz/katzs-delicatessen-new-york?hrid=gda9UOamGqZhPsL2TCwWAQ",
"text": "Is Katz's overrated? Absolutely not. We waited about 45 minutes outside and another 20 min…",
"language": "en",
"rating": 5,
"time_created": "2026-11-20T12:21:22-05:00",
"user": {
"id": "WSptrgW8NLFBNvw1FOpifw",
"name": "Casey P.",
"profile_url": "https://www.yelp.com/user_details?userid=WSptrgW8NLFBNvw1FOpifw",
"image_url": "https://s3-media0.fl.yelpcdn.com/photo/j0aK051H-DhtJCbC1WYFkg/60s.jpg",
"location": "Nashville, United States",
"review_count": 589,
"friend_count": 1004,
"photo_count": 4609,
"elite_year": "26"
},
"reactions": {
"helpful": 2,
"thanks": 0,
"love_this": 0,
"oh_no": 1
},
"photos": [],
"business_reply": null,
"previous_review_count": 0,
"is_first_review": false,
"check_in_count": 0
},
{
"id": "Pprc4UvAB91E0Xs1KAOugQ",
"url": "https://www.yelp.com/biz/katzs-delicatessen-new-york?hrid=Pprc4UvAB91E0Xs1KAOugQ",
"text": "Don't let the long line outside intimidate you. It moves pretty fast and after about 30 m…",
"language": "en",
"rating": 4,
"time_created": "2026-11-25T22:33:37-05:00",
"user": {
"id": "8cs89p4eFmAd36_7y0-8AQ",
"name": "Justin R.",
"profile_url": "https://www.yelp.com/user_details?userid=8cs89p4eFmAd36_7y0-8AQ",
"image_url": "https://s3-media0.fl.yelpcdn.com/photo/Mczcan3leu4UnrDZP9BLdQ/60s.jpg",
"location": "San Francisco, United States",
"review_count": 371,
"friend_count": 124,
"photo_count": 540,
"elite_year": "26"
},
"reactions": {
"helpful": 0,
"thanks": 0,
"love_this": 0,
"oh_no": 0
},
"photos": [
{
"id": "_Q5TCFfN7x5fKj5f_1OfcQ",
"url": "https://s3-media0.fl.yelpcdn.com/bphoto/_Q5TCFfN7x5fKj5f_1OfcQ/348s.jpg",
"caption": "Reuben w/ Pastrami",
"width": 1500,
"height": 2000,
"uploaded_at": null,
"author": null
},
{
"id": "2f_0IN0vYzgiK1mNXj_YUw",
"url": "https://s3-media0.fl.yelpcdn.com/bphoto/2f_0IN0vYzgiK1mNXj_YUw/348s.jpg",
"caption": "Outside line",
"width": 1500,
"height": 2000,
"uploaded_at": null,
"author": null
},
"… 3 more"
],
"business_reply": null,
"previous_review_count": 0,
"is_first_review": false,
"check_in_count": 1
},
"… 18 more"
],
"pagination": {
"next_cursor": "eyJiIjoiVjdsWFpLQkR6U2NEZUdCOEptbnpTQSIsImsiOiJrYXR6cy1kZWxpY2F0ZXNzZW4tbmV3LXlvcmsiLCJmIj…",
"has_more": true
}
}Top-level fields
| Field | Type | Description |
|---|---|---|
business | YelpBusinessRef | – |
total | integer | Reviews matching the filters (all pages). |
feed | "recommended" | "not_recommended" | "removed" | recommended: the reviews Yelp shows; not_recommended: the ones its software filters out; removed: removed for violating guidelines (rating and author only). |
reviews | YelpReview[] | – |
pagination | YelpPagination | – |
Parameters
| Name | In | Type | Description |
|---|---|---|---|
business (required) | path | string | The business: its alias (the part after /biz/ in its link), its Yelp id, or the link itself (any Yelp site), URL-encoded. Example: katzs-delicatessen-new-york. |
sort | query | "recommended" | "newest" | "oldest" | "highest_rated" | "lowest_rated" | "elites" | Default recommended. One of recommended, newest, oldest, highest_rated, lowest_rated, elites. |
rating | query | string | Stars to keep, comma-separated (1-5). Example: 1,2. |
query | query | string | Words to search for in the reviews. |
language | query | string | Review language (ISO 639-1, e.g. en, de, fr). Default: the business’s main language. business.possible_languages lists what it has. |
limit | query | integer | Reviews per page, 1-49 (default 20). |
feed | query | "recommended" | "not_recommended" | "removed" | Which review feed (default recommended). One of recommended, not_recommended, removed. |
not_recommended | query | "true" | "false" | true is feed=not_recommended. One of true, false. |
since | query | string | Only reviews on or after this date (YYYY-MM-DD or ISO 8601). |
until | query | string | Only reviews on or before this date (YYYY-MM-DD or ISO 8601). |
after | query | string | Cursor: the previous page’s pagination.next_cursor. |
Pagination
Each page carries the next cursor in pagination.next_cursor; pass it back as after and stop when it is empty. Every page is a separate call at 2 credits per call, so cap the pages you read. This version is self-contained.
import os
import requests
API = "https://api.groundsocial.dev"
HEADERS = {"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}
def pages(max_pages=5):
"""Yields one page at a time; each page is one call."""
params = {}
for _ in range(max_pages):
res = requests.get(f"{API}/v1/yelp/businesses/katzs-delicatessen-new-york/reviews", params=params, headers=HEADERS, timeout=60)
res.raise_for_status()
page = res.json()
yield page
cursor = (page.get("pagination") or {}).get("next_cursor")
if not cursor:
break
params["after"] = cursor
for page in pages():
for item in page.get("reviews") or []:
print(item.get("text"), item.get("rating"))Errors and retries
Every error is JSON with error.code (stable: branch on it), message, hint (what to do next), docs_url and retryable. A failed call is never charged. Retry only when retryable is true, after the Retry-After header.
import os, time
import requests
def call(url, **kwargs):
headers = {"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}
for attempt in range(3):
res = requests.get(url, headers=headers, timeout=60, **kwargs)
if res.ok:
return res.json()
err = res.json()["error"]
# Branch on the stable code; the hint says what to do next.
if err["retryable"] and attempt < 2:
time.sleep(int(res.headers.get("Retry-After", 2)))
continue
raise RuntimeError(f"{err['code']}: {err.get('hint', err['message'])}")
data = call("https://api.groundsocial.dev/v1/yelp/businesses/katzs-delicatessen-new-york/reviews")| Status | Meaning |
|---|---|
200 | A page of reviews. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | No Yelp business by that alias, id or link. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Yelp is temporarily unavailable. Retryable; nothing was charged. |
Every error code and what to do about it.
Pricing
| Cost | |
|---|---|
| Per call | 2 credits per call |
| 1,000 calls | $2.00 on the starter pack, $0.80 at volume |
| No key (MPP or x402) | $0.02 per call |
| Failed call | Refunded, never charged |
Every response has x-credits-charged and x-credits-remaining headers. Credits never expire. Packs and calculator.
From an AI agent (MCP)
The same call is the yelp_business_reviews tool on the hosted MCP server, so Claude, Cursor or any MCP client can make it without code. Add the server once:
claude mcp add --transport http groundsocial https://api.groundsocial.dev/mcpThen ask for it in words (“A page of a Yelp business’s reviews (up to 49): sort, star filter, search, language, not-recommended feed”), or call the tool directly:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "yelp_business_reviews",
"arguments": {
"business": "katzs-delicatessen-new-york"
}
}
}MCP setup for Claude Desktop, Cursor, VS Code and ChatGPT.
Use Yelp business reviews in a pipeline
A page of a business’s reviews (limit up to 49, default 20): full text, stars, date with the business’s UTC offset, the reviewer (name, location, review/friend/photo counts, Elite year), reactions, photos, the owner’s public reply. sort: recommended (Yelp’s default), newest, oldest, highest_rated, lowest_rated, elites.
Keep going
- This call in JavaScript, TypeScript, Go, PHP, cURL.
- Reviews of a Yelp business API reference: every field and status code.
- Yelp tutorials and all Python tutorials.
- Yelp API: every endpoint and price.
- How to scrape Yelp review history in a date window with Python: Every review of a Yelp business in a date window, newest first (up to 500).
- How to get a Yelp business with Python: A Yelp business: rating and distribution, categories, price, contact, address, hours, amenities, photos.
Run it on your own data
One key for Yelp and 76 more platforms, over REST or MCP. Free credits on signup, no card.
Yelp is a trademark of its owner. We are not affiliated with or endorsed by it.