Yelp business endpoint
https://api.scrapereviews.com/v1/yelp/businesses/{business_id}1 creditThe Yelp business endpoint returns a business as a unified Entity of type business: name, Yelp URL, photo, rating out of 5, number of reviews, how the reviews split by star, categories and country.
Yelp-only fields are in extra: alias and Yelp id, address, city, region, postal code and coordinates, public phone number, price range, neighbourhoods and the number of reviews per language.
Any country’s Yelp businesses are served. The id is the alias at the end of the Yelp URL; find it from a name with the search endpoint.
Parameters
Path parameters
| Parameter | Type | Description |
|---|---|---|
| business_id | string | The alias at the end of the Yelp URL (gary-danko-san-francisco) or the Yelp id (extra.encid) |
This endpoint takes no parameters.
Authenticate with your API key in the X-API-Key header or as Authorization: Bearer (see authentication).
Example request
curl "https://api.scrapereviews.com/v1/yelp/businesses/gary-danko-san-francisco" \
-H "X-API-Key: sr_your_api_key"Response
{ "data": Entity, "meta": BaseMeta }{
"data": {
"source": "yelp", "type": "business", "id": "gary-danko-san-francisco", "handle": "gary-danko-san-francisco",
"name": "Gary Danko", "url": "https://www.yelp.com/biz/gary-danko-san-francisco",
"rating": 4.5, "rating_scale": 5, "review_count": 6160,
"rating_distribution": { "1": 124, "2": 218, "3": 484, "4": 1100, "5": 4239 },
"categories": [{ "id": "newamerican", "name": "New American", "is_primary": true }], "country": "US",
"extra": { "alias": "gary-danko-san-francisco", "encid": "WavvLdfdP6g8aZTtbBQHTw", "city": "San Francisco",
"region": "CA", "price_range": "$$$$", "review_languages": { "en": 6162, "zh": 3 } }
},
"meta": { "credits_used": 1, "cache_hit": false }
}Every field is described in the response models. Successful responses also carry the X-Credits-Used header.
Cost
Business details cost 1 credit per call. Answers are cached for 24 hours; a cached answer costs the same and is marked meta.cache_hit = true.
Only successful calls are billed: every error costs 0 credits. You get 30 free calls every month; see pricing for credit packs.
Errors
Errors come with an HTTP status and this JSON body: branch on detail.error, show detail.message to humans.
{
"detail": {
"error": "entity_not_found",
"message": "No Yelp business found for 'no-such-business'"
}
}| HTTP | error | Meaning |
|---|---|---|
| 400 | invalid_parameter | A parameter is invalid: bad domain, stars, language or date, missing query, limit out of range... |
| 401 | missing_api_key | No API key in X-API-Key or Authorization: Bearer. |
| 401 | invalid_api_key | The key does not exist or has been revoked. |
| 402 | insufficient_credits | Your credit balance is 0. |
| 404 | entity_not_found | No location, property, business or product with this id on Tripadvisor, Booking.com, Yelp, G2 or Capterra (the source is named in the message). |
| 429 | rate_limit_exceeded | Too many requests per minute. |
| 429 | insufficient_credits_retry_later | The balance ran out on recent calls and the key is cooling down. |
| 502 | upstream_changed | The source (Trustpilot, App Store or Google Play, named in the message) changed its format and the response could not be read. |
| 503 | upstream_blocked | The source is temporarily blocking requests. |
| 503 | feature_disabled | The endpoint is temporarily switched off by us (detail.feature names it). The call is not billed. |
| 504 | upstream_timeout | The source did not answer in time. |
What to do for each code: error handling.
Use cases
- Follow the rating and the star distribution of your locations and of competitors.
- Enrich a list of local businesses with address, coordinates, phone and price range.
Related endpoints
- Yelp reviews GET /v1/yelp/businesses/{business_id}/reviews: Reviews of a Yelp business with sort, star, text, language and date filters, and the owner’s replies.
- Yelp search GET /v1/yelp/businesses/search: Yelp businesses matching a name near a location (Yelp’s search suggestions).
ScrapeReviews is an independent service and is not affiliated with or endorsed by Yelp.