100 free credits. No credit card required. Get a key

How to scrape reviews of a Yelp business with JavaScript

A page of a Yelp business’s reviews (up to 49): sort, star filter, search, language, not-recommended feed.

The examples use the fetch built into Node.js 18+ (and every browser and edge runtime), with AbortSignal.timeout and top-level await, and no dependencies.

GET /v1/yelp/businesses/{business}/reviews2 credits per callRefunded on failureBeta

Before you start

  1. Get an API keySign up for 100 free credits, no card. Keys start with gs_live_.
  2. Put it in the environmentEvery example reads it from GROUNDSOCIAL_API_KEY: export GROUNDSOCIAL_API_KEY=gs_live_…
  3. Set up JavaScriptnode --version # 18 or newer: fetch is built in, nothing to install

Call Reviews of a Yelp business API from JavaScript

GET /v1/yelp/businesses/{business}/reviews. Save this as main.mjs and run node main.mjs. It reads the items in reviews and prints text and rating for each.

main.mjs
// main.mjs: Node.js 18+, no dependencies
const url = new URL('https://api.groundsocial.dev/v1/yelp/businesses/katzs-delicatessen-new-york/reviews')

const res = await fetch(url, {
  headers: {
    Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`,
  },
  signal: AbortSignal.timeout(60_000),
})
if (!res.ok) {
  const { error } = await res.json()
  throw new Error(`${error.code}: ${error.hint ?? error.message}`)
}
const data = await res.json()

for (const item of data.reviews) {
  console.log(item.text, item.rating)
}

console.log('credits charged:', res.headers.get('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.

200 OK
{
  "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

FieldTypeDescription
businessYelpBusinessRef–
totalintegerReviews 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).
reviewsYelpReview[]–
paginationYelpPagination–

Parameters

NameInTypeDescription
business (required)pathstringThe 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.
sortquery"recommended" | "newest" | "oldest" | "highest_rated" | "lowest_rated" | "elites"Default recommended. One of recommended, newest, oldest, highest_rated, lowest_rated, elites.
ratingquerystringStars to keep, comma-separated (1-5). Example: 1,2.
queryquerystringWords to search for in the reviews.
languagequerystringReview language (ISO 639-1, e.g. en, de, fr). Default: the business’s main language. business.possible_languages lists what it has.
limitqueryintegerReviews per page, 1-49 (default 20).
feedquery"recommended" | "not_recommended" | "removed"Which review feed (default recommended). One of recommended, not_recommended, removed.
not_recommendedquery"true" | "false"true is feed=not_recommended. One of true, false.
sincequerystringOnly reviews on or after this date (YYYY-MM-DD or ISO 8601).
untilquerystringOnly reviews on or before this date (YYYY-MM-DD or ISO 8601).
afterquerystringCursor: 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. Add it to the same file.

Every page
// Each page is one call; stop when there is no next cursor.
async function* pages(maxPages = 5) {
  const url = new URL('https://api.groundsocial.dev/v1/yelp/businesses/katzs-delicatessen-new-york/reviews')
  for (let i = 0; i < maxPages; i++) {
    const res = await fetch(url, {
      headers: {
        Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`,
      },
      signal: AbortSignal.timeout(60_000),
    })
    if (!res.ok) throw new Error((await res.json()).error.hint)
    const page = await res.json()
    yield page
    const cursor = page.pagination?.next_cursor
    if (!cursor) return
    url.searchParams.set('after', cursor)
  }
}

for await (const page of pages()) {
  for (const item of page.reviews ?? []) {
    console.log(item.text, item.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.

Errors
async function call(url, init = {}, attempt = 0) {
  const res = await fetch(url, {
    ...init,
    headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`, ...init.headers },
    signal: AbortSignal.timeout(60_000),
  })
  if (res.ok) return res.json()
  const { error } = await res.json()
  // Branch on error.code (stable); error.hint says what to do next.
  if (error.retryable && attempt < 2) {
    const wait = Number(res.headers.get('retry-after') ?? 2)
    await new Promise((r) => setTimeout(r, wait * 1000))
    return call(url, init, attempt + 1)
  }
  throw Object.assign(new Error(error.hint ?? error.message), { code: error.code })
}
StatusMeaning
200A page of reviews.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404No Yelp business by that alias, id or link.
429Too many requests. Wait for Retry-After seconds.
503Yelp is temporarily unavailable. Retryable; nothing was charged.

Every error code and what to do about it.

Pricing

Cost
Per call2 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 callRefunded, 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:

bash
claude mcp add --transport http groundsocial https://api.groundsocial.dev/mcp

Then 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:

json
{
  "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

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.