Start free

How to scrape Yelp

Extract Yelp business names, ratings, categories, addresses and review counts as clean JSON, without fighting obfuscated markup or selector drift.

Site:
yelp.com
Difficulty:
Medium
Rendering:
JavaScript-rendered
Anti-bot:
Rate limiting, Bot detection, CAPTCHA

What you can extract from Yelp

These are the fields teams most often pull from yelp.com, and why a hand-written selector for each one tends to break over time.

Field Type Why selectors break
name string The business name renders inside obfuscated, frequently rotated class names, so a hard-coded selector breaks within weeks of being written.
rating number Yelp shows the rating as a star-image aria-label rather than text, forcing brittle parsing of strings like "4.5 star rating" that change across locales.
category string Categories are a list of links whose container shifts position depending on which business attributes are present, so a fixed selector grabs the wrong element.
review_count number Review counts are localized and abbreviated, so the same selector returns "1,234 reviews", "1.234" or "1,2 K" for different visitors.
address string The address is rendered next to a map widget whose container is reused for hours and directions, so a position-based selector frequently grabs opening hours instead of the street address.
price_range string Price range is shown as a run of currency symbols rather than text, so a selector has to count glyphs and breaks whenever Yelp changes the icon markup or localizes the symbol.

The schema-first approach

Instead of maintaining selectors, you hand Extracto a JSON schema describing the shape you want. Here is a schema that works for Yelp:

{
  "name": "string",
  "rating": "number",
  "review_count": "number",
  "category": "string",
  "address": "string",
  "price_range": "string"
}
  1. 1

    Describe the Yelp fields you want

    Write a small JSON schema listing the fields to pull from yelp.com (for example name, rating, category). No CSS selectors or XPath needed.

  2. 2

    Send the URL and schema to Extracto

    POST the Yelp page URL and your schema to the Extracto API. Extracto renders the page in a real browser, handling JavaScript and dynamic content automatically.

  3. 3

    Get schema-validated JSON back

    Extracto returns JSON that matches your schema exactly, validated before it leaves the API, so your pipeline never receives broken or partial data.

Common pitfalls when scraping Yelp

Is it legal to scrape Yelp?

Yelp's Terms of Service prohibit scraping, and Yelp offers a Fusion API that is the sanctioned route for business data. Public business attributes such as name, category and rating are facts, but reviewer names and review text are personal data subject to GDPR and CCPA. If you scrape at all, stay on public pages, keep volume low, respect robots.txt, and avoid collecting personal information about reviewers. For production use, the Fusion API is strongly preferred.

Extracto follows robots.txt by default and rate-limits politely. You are responsible for compliance with Yelp's terms and applicable law (GDPR, CCPA) in your use case.

Scraping Yelp: FAQ

Is it legal to scrape Yelp?
Yelp's Terms of Service prohibit scraping and the Fusion API is the sanctioned route for business data. Public attributes like name and rating are facts, but reviewer information is personal data. If you scrape public pages at all, keep volume low and avoid collecting personal data; for production use the official API.
Why does my Yelp scraper keep breaking?
Yelp obfuscates and rotates its CSS class names, so selectors that match today stop matching after the next deploy. A schema-based approach is more durable because Extracto identifies fields by meaning rather than by exact markup, so layout changes do not silently break extraction.
How do I avoid CAPTCHAs when scraping Yelp?
Keep request rates low, avoid scraping while authenticated, and stop on the first challenge rather than retrying aggressively. Extracto renders pages in a managed browser and applies polite request behaviour, but no tool can make unlimited high-frequency scraping invisible to Yelp.
Can I extract Yelp reviews?
Review bodies and reviewer names are personal data under GDPR and CCPA. Prefer aggregate fields like average rating and review count, and if you must process review text, ensure you have a lawful basis and avoid storing identifiers tied to individuals.
What is the best way to collect Yelp data for many businesses?
For anything beyond a handful of lookups, the Yelp Fusion API is the sanctioned and more reliable route. If you extract from public pages, run at a low, steady rate and capture a consistent schema per business so the results stay comparable across the whole list without per-page selector tuning.