scraper.mindq.ru

← все платформы

Yelp

URL шаблон: https://www.yelp.com/biz/{alias}

Источник данных: ScraperAPI render=true → HTML с Apollo cache (HTML-comment в <script data-apollo-state>)

Стратегия парсинга

  1. GET главной страницы биза через ScraperAPI render=true.
  2. В HTML находим `<script type="application/json" data-apollo-state="..."><!--{...}--></script>` — Apollo state в HTML-entity-escaped JSON.
  3. Декодируем `&quot;` через `html.unescape`, парсим JSON, получаем граф объектов: `Business:...`, `BusinessLocation:...`, `Review:...`, `BusinessPhoto:...` и т.д.
  4. Извлекаем `Business:...` объект → mapping в нашу структуру (резолвим `__ref` ссылки).
  5. Пагинируем отзывы по `?start={N}&sort_by=date_desc` — каждый запрос = новый ScraperAPI вызов. Останавливаемся, когда пришли только дубликаты.

Поля ресторана

полеоткуда / какпример
encid / aliasBusiness.encid / Business.alias'_kdL...' / 'ghirardelli-ice-cream-...'
nameBusiness.name'Ghirardelli Ice Cream...'
ratingBusiness.rating(...) (parameterized)4.0
review_countBusiness.reviewCount721
price_rangeBusiness.priceRange.display'$$'
categoriesBusiness.categories[].title (через __ref)['Ice Cream & Frozen Yogurt','Desserts']
address fieldsBusinessLocation.address'2 New Montgomery St'
city / state / postal_code / countryBusinessLocation.address + .country'San Francisco / CA / 94105 / US'
neighborhoodsBusinessLocation.neighborhoods['SoMa']
coordinatesиз map(...).src — center=lat,lng{lat:37.78, lng:-122.40}
phoneBusiness.phoneNumber.formatted'(415) 397-3030'
websiteBusiness.externalResources.website.url'https://ghirardelli.com'
menu_urlBusiness.externalResources.menu.urlnull или url
hours_today / hours_weekBusiness.operationHours.regularHoursMerged...'08:00 AM - 11:00 PM'
specialties / historyBusiness.specialties / .history'We make chocolate since 1852…'
is_closedBusiness.isClosedfalse
is_claimedBusiness.claimability.isClaimedtrue
is_advertiserBusiness.isYelpAdvertiserfalse
biz_photosвсе BusinessPhoto:* объекты с photoUrl(LARGE)[{url, caption, width, height}, ...]

Поля отзыва

полеоткуда / какпример
encidReview.encid'A1B2C3...'
ratingReview.rating5
textReview.text.full / .truncated'Great service...'
created_atReview.createdAt.utcDateTime'2025-12-01T...'
author_nameUser.displayName (через __ref)'John D.'
author_encidUser.encidстрока
author_eliteUser.isElitetrue/false
author_photo_urlUser.profilePhoto.url(...)'https://...yelpcdn.com/...'
photo_urlsReview.photos.edges[].node (LARGE)['https://...']
reactionsReview.usefulCount/funnyCount/coolCount{useful:5, funny:1}

Пример запроса

{
    "platform": "yelp",
    "url": "https://www.yelp.com/biz/alias"
}

Опции options.scraperapi описаны в общей документации.

Нюансы