# Access Yelp Pages from Code: Tested Guide

> Access public Yelp pages from your own code: one call with a URL and a country returns the HTML. 19 pages read on 21 November 2026, with a Python parser.

[Home](https://quanticdata.io/) / [Blog](https://quanticdata.io/blog/) / Access Yelp Pages from Code: Tested Guide

# How to access public Yelp pages from your own code, with a chosen country

Web scraping · Nov 21, 2026 · 11 min read · By [Aldo Morese](https://quanticdata.io/about/), founder of QuanticData

![One call with a URL and a country returns a public Yelp business page, with the seven facts a parser reads from its HTML: name, rating and review count, address and phone, categories, opening hours; the card shows our run of 21 November 2026: 13 business page reads, 6 search pages, 7 of 7 fields on each of the 13 business page reads, median 3.4 seconds.](https://quanticdata.io/blog/access-yelp-pages/hero.webp?v=20261121h)

On this page

- [What you can do with a Yelp page in your code](https://quanticdata.io/blog/access-yelp-pages/#what-you-can-do-with-a-yelp-page-in-your-code)
- [The request: a URL and a country](https://quanticdata.io/blog/access-yelp-pages/#the-request-a-url-and-a-country)
- [What came back in our test](https://quanticdata.io/blog/access-yelp-pages/#what-came-back-in-our-test)
- [What a public Yelp page carries](https://quanticdata.io/blog/access-yelp-pages/#what-a-public-yelp-page-carries)
- [Scrape Yelp data from the page with Python](https://quanticdata.io/blog/access-yelp-pages/#scrape-yelp-data-from-the-page-with-python)
- [What it costs](https://quanticdata.io/blog/access-yelp-pages/#what-it-costs)
- [Yelp's rules, its own API, and proper use](https://quanticdata.io/blog/access-yelp-pages/#yelp-s-rules-its-own-api-and-proper-use)

To access a public Yelp page from your own code, send its URL and a country to the QuanticData Web Unlocker and read the HTML that comes back. On 21 November 2026 we read 19 public Yelp business and search pages this way, median 3.4 seconds, and parsed name, rating, review count, address, phone, categories and hours with 68 lines of Python.

**Run it on the free credit.** Every QuanticData account gets $2 of free API usage per month.

[Start free — $2/month included](https://quanticdata.io/signup/?utm_source=blog&utm_medium=website&utm_campaign=blog-lead&utm_content=access-yelp-pages) · [Explore Web Scraping API](https://quanticdata.io/web-scraping-api/)

The pages, the seconds, the bytes and the parser output below come from that run.

## What you can do with a Yelp page in your code

The call returns the page as HTML. What you do with it is up to your code:

- **Check a listing.** Read the page of your own business and see the name, rating, review count, address, phone and hours it shows.
- **Read it with a chosen country.** The `country` field of the call sets where the request comes from. Our run used `us`.
- **Hand it to a script or an AI agent.** The body is plain HTML. On the REST API, `format` set to `markdown` or `text` converts the result for a language model.
- **Collect business facts.** Parse the HTML into rows, as the Python script further down does.

## The request: a URL and a country

You call the [Web Unlocker](https://quanticdata.io/web-unlocker/) with a URL and a country. This is the Python call from the [Web Unlocker page](https://quanticdata.io/web-unlocker/) with a Yelp business URL in it; the last lines print three fields of the response and save the body:

```python
import requests

r = requests.post(
    "https://app.quanticdata.io/api/v1/scraper/unlock",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={"url": "https://www.yelp.com/biz/sawada-coffee-chicago", "country": "us"},
    timeout=130,
)
page = r.json()["payload"]
print(page["status"], page["latency_ms"], page["cost"])
if page["status"] == 200 and "star rating" in page["body"]:
    open("business.html", "w", encoding="utf-8").write(page["body"])
```

The response says what happened: `status` is the status of the page, `latency_ms` is the time and `cost` is what the call cost. The last two lines save the body when the status is 200 and the body holds a star rating.

For this post we called the same service through our MCP tool, with the same two parameters: the URL and `country` set to `us`. The numbers below come from those calls. Everything else was left at its default. A search page works the same way: put a URL such as `https://www.yelp.com/search?find_desc=coffee&find_loc=Chicago%2C+IL` in the `url` field.

## What came back in our test

On 21 November 2026, between 10:26 and 10:32 UTC, we read 19 public Yelp pages, one call at a time. Each page in the table was checked for content: a business page had the name, rating, review count and address in the body; a search page had at least ten results with their ratings.

| Page type | Pages read | Median time | Fastest and slowest | Body size |
| --- | --- | --- | --- | --- |
| Business pages | 13 reads of 7 businesses | 4.3 s | 2.0 s and 12.1 s | 1.65 to 1.88 MB, median 1.84 MB |
| Search pages | 6 (61 results) | 2.7 s | 2.3 s and 12.3 s | 1.00 to 1.12 MB, median 1.07 MB |
| All | 19 | 3.4 s | 2.0 s and 12.3 s |  |

The seconds are the `latency_ms` of each response. The seven businesses were in New York, Chicago and Austin; some were read more than once, also with the `start` and `sort_by` query parameters in the URL, and each of the 13 reads returned all seven business facts. The searches were coffee in Chicago, tacos in Austin, sushi in Los Angeles, bakeries in Seattle, ramen in San Francisco and BBQ in Houston.

Later the same day we read one of the business pages once more with `country` set to `gb`. It came back in 12.1 seconds, 1.82 MB, with the same seven facts as the read with `us`.

**Try it on your own targets.** Every QuanticData account gets $2 of free API usage per month.

[Start free — $2/month included](https://quanticdata.io/signup/?utm_source=blog&utm_medium=website&utm_campaign=blog-inline&utm_content=access-yelp-pages) · [Explore Web Scraping API](https://quanticdata.io/web-scraping-api/)

## What a public Yelp page carries

The facts of a business page are in its HTML. This is where each one sat in the 13 business page reads of our run, with the values of one Chicago coffee shop as the example.

| Field | Where it is in the HTML | Example from our run | Found |
| --- | --- | --- | --- |
| Name | The `h1` heading | Sawada Coffee | 13 of 13 |
| Rating | `aria-label` ending in "star rating" | 4.5 | 13 of 13 |
| Review count | The page `title` | 1221 | 13 of 13 |
| Address | A `PostalAddress` in the JSON-LD blocks | 112 N Green St, Chicago, IL 60607 | 13 of 13 |
| Phone | The visible text | (312) 344-1750 | 13 of 13 |
| Categories | The `BreadcrumbList` JSON-LD block | Food, Coffee & Tea | 13 of 13 |
| Opening hours | The hours table | Mon 8:00 AM - 4:00 PM | 13 of 13 |

A search page, such as coffee in Chicago, carries a list instead: for each result the name, the rating, the review count and the link to the business page. The six search pages we read held 61 results, 10 or 11 per page.

## Scrape Yelp data from the page with Python

Once the page is in a file, reading the facts is ordinary HTML parsing. The parser needs Beautiful Soup (`pip install beautifulsoup4`; we ran version 4.14.3 on Python 3.12). This is `parse_yelp.py`, the file we ran on all 19 saved pages:

```python
import json
import re
import sys
from html import unescape

from bs4 import BeautifulSoup

def business(html):
    """Facts from one Yelp business page."""
    soup = BeautifulSoup(html, "html.parser")
    text = soup.get_text(" ", strip=True)
    stars = soup.select_one('[aria-label$="star rating"]')
    count = re.search(r"([\d,]+) Reviews", soup.title.string)
    phone = re.search(r"\(\d{3}\) \d{3}-\d{4}", text)
    address, categories = None, []
    for tag in soup.select('script[type="application/ld+json"]'):
        data = json.loads(tag.string)
        if data.get("@type") == "BreadcrumbList":
            categories = [unescape(item["name"]) for item in data["itemListElement"]]
        found = re.search(r'"address": ?(\{.*?\})', tag.string)
        if found and not address:
            a = json.loads(found.group(1))
            address = "%s, %s, %s %s" % (a["streetAddress"], a["addressLocality"], a["addressRegion"], a["postalCode"])
    hours = {}
    for row in soup.select('table[class*="hours-table"] tr'):
        day, times = row.select_one("th p"), row.select("td li p")
        if day and times:
            hours[day.get_text()] = ", ".join(p.get_text() for p in times)
    return {
        "name": soup.h1.get_text(strip=True),
        "rating": float(stars["aria-label"].split()[0]) if stars else None,
        "reviews": int(count.group(1).replace(",", "")) if count else None,
        "address": address,
        "phone": phone.group(0) if phone else None,
        "categories": categories,
        "hours": hours,
    }

def search_results(html):
    """Name, rating, review count and link of each result on a Yelp search page."""
    soup = BeautifulSoup(html, "html.parser")
    rows = []
    for link in soup.select('a[href^="/biz/"][href*="osq="]'):
        name = link.get_text(strip=True)
        if not name or "hrid=" in link["href"]:
            continue
        card = link.find_parent(lambda tag: tag.select_one('[aria-label$="star rating"]'))
        stars = card.select_one('[aria-label$="star rating"]')
        count = re.search(r"\(([\d.,k]+) reviews\)", card.get_text(" ", strip=True))
        rows.append({
            "name": name,
            "rating": float(stars["aria-label"].split()[0]) if stars else None,
            "reviews": count.group(1) if count else None,
            "url": "https://www.yelp.com" + link["href"].split("?")[0],
        })
    return rows

if __name__ == "__main__":
    kind, path = sys.argv[1], sys.argv[2]
    html = open(path, encoding="utf-8").read()
    if kind == "biz":
        print(json.dumps(business(html), indent=2))
    else:
        for row in search_results(html):
            print(row["name"], "|", row["rating"], "|", row["reviews"], "|", row["url"])
```

Run on the saved business page:

```bash
$ python parse_yelp.py biz business.html
{
  "name": "Sawada Coffee",
  "rating": 4.5,
  "reviews": 1221,
  "address": "112 N Green St, Chicago, IL 60607",
  "phone": "(312) 344-1750",
  "categories": [
    "Food",
    "Coffee & Tea"
  ],
  "hours": {
    "Mon": "8:00 AM - 4:00 PM",
    "Tue": "8:00 AM - 4:00 PM",
    "Wed": "8:00 AM - 4:00 PM",
    "Thu": "8:00 AM - 4:00 PM",
    "Fri": "8:00 AM - 4:00 PM",
    "Sat": "8:00 AM - 4:00 PM",
    "Sun": "8:00 AM - 4:00 PM"
  }
}
```

How it reads each field:

- **Name** is the only `h1` of the page.
- **Rating** is an attribute, not text: the star image carries `aria-label="4.5 star rating"`.
- **Review count** on the page is shortened to "1.2k reviews". The page title has the full number, so the parser takes it from there.
- **Address and categories** come from the JSON-LD blocks, structured data the page publishes for search engines. They are tied to meaning, not to styling.
- **Hours** come from the table whose class contains `hours-table`. The rest of that class name is generated, so the selector matches a part of it.

The class names on Yelp pages are generated and can change. Selectors tied to meaning, such as `aria-label`, JSON-LD and the page title, are the ones this parser uses. More on parsing in our [Beautiful Soup guide](https://quanticdata.io/blog/beautifulsoup-web-scraping/) and in [web scraping with Python](https://quanticdata.io/blog/how-to-web-scraping-using-python/).

### A search page

The second function reads a search page. Each result is a link to `/biz/...`; the card around it holds the rating and the review count. Run on the saved page for coffee in Chicago:

```bash
$ python parse_yelp.py search search.html
Sawada Coffee | 4.5 | 1.2k | https://www.yelp.com/biz/sawada-coffee-chicago
The Wormhole Coffee | 4.4 | 1.4k | https://www.yelp.com/biz/the-wormhole-coffee-chicago-3
Oud Coffee & Cafe | 4.4 | 37 | https://www.yelp.com/biz/oud-coffee-and-cafe-chicago-2
Candor | 4.4 | 50 | https://www.yelp.com/biz/candor-chicago
Groundswell Coffee Roasters | 4.0 | 3 | https://www.yelp.com/biz/groundswell-coffee-roasters-chicago-5
Metric Coffee | 4.3 | 174 | https://www.yelp.com/biz/metric-coffee-chicago
Damn Fine Coffee Bar | 4.4 | 133 | https://www.yelp.com/biz/damn-fine-coffee-bar-chicago-2
Nimble | 4.3 | 20 | https://www.yelp.com/biz/nimble-chicago
Magnifico Coffee Roasters | 4.8 | 76 | https://www.yelp.com/biz/magnifico-coffee-roasters-chicago
Dark Matter Coffee - The Mothership | 4.4 | 333 | https://www.yelp.com/biz/dark-matter-coffee-the-mothership-chicago
```

The search page gives the list and the business page gives the details. The links in the last column are the business pages the first function reads; four of the seven businesses of our run are in this list.

## What it costs

The Web Unlocker is billed by the gigabyte, prepaid, with no subscription: you buy a pack from 1 GB in the dashboard, where the rate per gigabyte is shown before you buy, and every call moves bytes against it. Each response reports the bytes it moved and the cost of that call.

So the cost of a Yelp page follows its size. In our run a business page was 1.65 to 1.88 MB, median 1.84 MB, and a search page 1.00 to 1.12 MB, median 1.07 MB. Counting 1 GB as 1,000 MB, that is about 540 business pages or about 930 search pages per gigabyte at the median sizes.

Two settings from the [Web Unlocker page](https://quanticdata.io/web-unlocker/) keep the bill predictable. `max_bytes` caps a single call before it starts. `cache_ttl` keeps a page for the time you choose, and the same call again is answered from the cache at no cost while it is cached. Business hours and addresses change rarely, so a long cache lifetime fits this kind of data.

## Yelp's rules, its own API, and proper use

We read three of Yelp's documents on 21 November 2026. Its robots.txt sets rules for the crawlers it names, ends with `User-Agent: *` and `Disallow: /`, and says that automated access is prohibited except as expressly permitted by Yelp, with a contact link to ask for permission. Its Support Center article "Can I copy or scrape data from the Yelp site?" says scraping is not allowed. And Yelp offers the Yelp Places API, which its documentation also calls the Yelp Fusion API: it works with a private key under `https://api.yelp.com/v3`, and its Business Details endpoint returns the name, address, phone number, photos, rating, price level and hours of a business.

Read those documents before you build on Yelp pages, and ask Yelp where your use needs its permission. Our [robots.txt tester](https://quanticdata.io/tools/robots-txt-tester/) shows what a robots.txt file allows for a given path, and our overview of [web scraping law in the US](https://quanticdata.io/blog/is-web-scraping-legal-in-us/) covers the general ground.

- **Public pages only.** No logins, no accounts, nothing behind a sign-in.
- **A moderate pace.** Our run sent one call at a time. Read each page once and cache it. Our explainer on [rate limiting](https://quanticdata.io/blog/what-is-rate-limiting/) shows why sites set limits.
- **Business facts, not people.** Name, address, phone and hours describe a business. Reviews are written by people: reviewer names, photos and texts can be personal data, and laws such as the GDPR and the CCPA may apply to collecting and storing them.
- **No republishing.** Yelp's terms cover how its content may be used. Reading a fact is one thing; copying pages, photos or reviews into your own product is another.

If you would rather receive a page as Markdown or as JSON fields than as raw HTML, the QuanticData [Web Scraper API](https://quanticdata.io/web-scraping-api/) does that from one call, and our page on [Google Maps data](https://quanticdata.io/web-scraping-api/google-maps-data/) covers another source of local business listings.

### Sources & further reading

- [Yelp Developers: Getting Started with the Yelp Places API](https://docs.developer.yelp.com/docs/places-intro)
- [Yelp Support Center: Can I copy or "scrape" data from the Yelp site?](https://www.yelp-support.com/article/Can-I-copy-or-scrape-data-from-the-Yelp-site)
- [Yelp robots.txt](https://www.yelp.com/robots.txt)
- [RFC 9309: Robots Exclusion Protocol](https://www.rfc-editor.org/rfc/rfc9309)
- [Beautiful Soup documentation](https://www.crummy.com/software/BeautifulSoup/bs4/doc/)
- [Schema.org: PostalAddress](https://schema.org/PostalAddress)

## FAQ

Quick answers on access yelp pages.

[Something else? Ask us](mailto:hello@quanticdata.io)

### How do I open a Yelp page from my own code?

Send one POST to the Web Unlocker with the page URL and a country, and read the `body` of the response: it is the page HTML. On 21 November 2026 we read 19 public Yelp business and search pages this way, median 3.4 seconds.

### Can I choose the country a Yelp page is read from?

Yes. The `country` field of the call sets it. Our run of 19 pages used `us`. One more read of a business page with `gb` came back in 12.1 seconds with the same seven business facts.

### Can you scrape Yelp?

A public Yelp page carries its business facts in the HTML: we read 19 public pages on 21 November 2026 and parsed name, rating, review count, address, phone, categories and hours. Yelp's robots.txt says automated access is prohibited except as expressly permitted by Yelp, its Support Center says scraping is not allowed, and Yelp offers its own API. Check those first.

### What data is on a public Yelp business page?

The business name, the star rating, the review count, the street address, the phone number, the categories and the opening hours. In our run all seven were present on 13 of 13 business page reads. A search page lists name, rating, review count and link for each result.

### Does Yelp have an official API?

Yes. The Yelp Places API, which Yelp's documentation also calls the Yelp Fusion API, works with a private API key under `https://api.yelp.com/v3`. Its Business Details endpoint returns name, address, phone number, photos, rating, price level and hours, and a reviews endpoint returns up to three review excerpts per business.

### How long does a Yelp page take, and how big is it?

In our run of 21 November 2026 the median was 3.4 seconds over 19 pages: 4.3 seconds for business pages and 2.7 seconds for search pages. A business page was 1.65 to 1.88 MB of HTML and a search page 1.00 to 1.12 MB. The Web Unlocker is billed by the gigabyte.

### Can I collect Yelp reviews?

Yelp's own API returns up to three review excerpts per business, according to its documentation. Reviews are written by people, so reviewer names and texts can be personal data: laws such as the GDPR and the CCPA may apply, and Yelp's terms cover how its content may be used. This guide covers business facts and search listings.

## Read public pages from your own code

Send a URL and a country to the Web Unlocker and parse the HTML it returns. Prepaid gigabytes, packs from 1 GB, no subscription.

[Start free — $2/month included](https://quanticdata.io/signup/?utm_source=blog&utm_medium=website&utm_campaign=blog-end&utm_content=access-yelp-pages) · [Explore Web Scraping API](https://quanticdata.io/web-scraping-api/)

## Related reading

- [Web Scraping with Java: jsoup and HttpClient](https://quanticdata.io/blog/web-scraping-java/): Web scraping · In Java, the HttpClient that ships with the JDK downloads the page and jsoup reads the HTML with CSS selectors. Below: an 86-line scraper that collected 60 books over 3 pages, run directly and through residential and mobile proxies, the one system property that proxy authentication needs on HTTPS, and five pages fetched at once.
- [Web Scraping with Rust: reqwest and scraper](https://quanticdata.io/blog/web-scraping-rust/): Web scraping · In Rust, reqwest downloads the page and the scraper crate reads the HTML with CSS selectors. Below: a 72-line scraper that collected 60 books over 3 pages, run directly and through residential and mobile proxies, an async version that fetched five pages in 2.1 seconds, and a Windows build that needs no Visual Studio.
- [Web Scraping with Ruby: Nokogiri and Net::HTTP](https://quanticdata.io/blog/web-scraping-ruby/): Web scraping · In Ruby, Net::HTTP from the standard library downloads the page and the Nokogiri gem reads the HTML with CSS selectors. Below: a 38-line script with a 24-line helper that collected 60 books over 3 pages, run directly and through residential and mobile proxies, the same request with HTTParty, and a threaded version that fetches five pages three at a time.

---

Source: https://quanticdata.io/blog/access-yelp-pages/ · Site index for AI: https://quanticdata.io/llms.txt
