yelp-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseYelp Search Integration
Yelp搜索集成
Search for local businesses on Yelp to find services, get contact information, check ratings, and retrieve hours of operation.
在Yelp上搜索本地商家,以查找服务、获取联系方式、查看评分及营业时间。
Setup
设置
1. Yelp API Key (Required)
1. Yelp API Key(必填)
- Go to https://www.yelp.com/developers
- Create an account or sign in
- Click "Create App" and fill out the form
- Copy your API Key
Add to your file:
.envYELP_API_KEY=your_api_key_here- 访问https://www.yelp.com/developers
- 创建账户或登录
- 点击“Create App”并填写表单
- 复制你的API Key
将其添加到你的文件中:
.envYELP_API_KEY=your_api_key_here2. Browser-Use for Reviews (Optional)
2. 浏览器用于评论提取(可选)
Only needed if you want to extract review text (slow, ~30-60s per request).
Install dependencies:
bash
uv add browser-use playwright langchain-openai
uv run playwright install chromiumAdd to :
.envOPENAI_API_KEY=your_openai_key_hereNote: Review extraction uses browser-use to search DuckDuckGo (since Yelp blocks direct scraping). For most use cases, the rating + review_count from the API is sufficient.
仅当你需要提取评论文本时才需要(速度较慢,每次请求约30-60秒)。
安装依赖:
bash
uv add browser-use playwright langchain-openai
uv run playwright install chromium添加到文件:
.envOPENAI_API_KEY=your_openai_key_here注意:评论提取使用browser-use搜索DuckDuckGo(因为Yelp阻止直接爬取)。对于大多数使用场景,API提供的评分+评论数量已足够。
Scripts
脚本
All scripts are in and should be run with .
tools/yelp-search/scripts/uv run python所有脚本都位于目录下,需使用运行。
tools/yelp-search/scripts/uv run pythonsearch.py - Find Businesses (Primary Tool)
search.py - 查找商家(主工具)
bash
uv run python tools/yelp-search/scripts/search.py "search term" --location "City, State"Options:
| Flag | Description | Example |
|---|---|---|
| City, address, or zip | |
| GPS coordinates | |
| Number of results (default: 5) | |
| Sort order | |
| Price filter (1-4) | |
| Output raw JSON |
Examples:
bash
undefinedbash
uv run python tools/yelp-search/scripts/search.py "搜索关键词" --location "城市, 州"选项:
| 标志 | 描述 | 示例 |
|---|---|---|
| 城市、地址或邮编 | |
| GPS坐标 | |
| 结果数量(默认:5) | |
| 排序方式 | |
| 价格筛选(1-4) | |
| 输出原始JSON数据 |
示例:
bash
undefinedFind top-rated dog groomers
查找评分最高的宠物美容店
uv run python tools/yelp-search/scripts/search.py "dog groomer" -l "San Francisco" --sort-by rating
uv run python tools/yelp-search/scripts/search.py "dog groomer" -l "San Francisco" --sort-by rating
Find cheap restaurants nearby
查找附近的平价餐厅
uv run python tools/yelp-search/scripts/search.py "restaurants" -l "94123" --price 1,2 --sort-by distance
uv run python tools/yelp-search/scripts/search.py "restaurants" -l "94123" --price 1,2 --sort-by distance
Search near a specific address
在特定地址附近搜索
uv run python tools/yelp-search/scripts/search.py "laundry pickup" -l "123 Main St, San Francisco"
undefineduv run python tools/yelp-search/scripts/search.py "laundry pickup" -l "123 Main St, San Francisco"
undefineddetails.py - Get Business Hours & Info
details.py - 获取商家营业时间及详细信息
bash
uv run python tools/yelp-search/scripts/details.py "business-alias"The business alias is in the Yelp URL (e.g., ).
the-laundry-corner-san-franciscobash
uv run python tools/yelp-search/scripts/details.py "商家别名"商家别名可在Yelp的URL中找到(例如:)。
the-laundry-corner-san-franciscophone_search.py - Reverse Lookup
phone_search.py - 反向电话号码查询
bash
uv run python tools/yelp-search/scripts/phone_search.py "+14155551234"bash
uv run python tools/yelp-search/scripts/phone_search.py "+14155551234"get_reviews.py - Extract Review Text (Slow)
get_reviews.py - 提取评论文本(速度慢)
bash
uv run python tools/yelp-search/scripts/get_reviews.py "Business Name" -l "City" -n 3Note: Uses browser-use which is slow (~30-60s). Yelp blocks direct scraping, so it searches DuckDuckGo for cached reviews as a workaround.
bash
uv run python tools/yelp-search/scripts/get_reviews.py "商家名称" -l "城市" -n 3注意: 使用browser-use,速度较慢(约30-60秒)。由于Yelp阻止直接爬取,因此通过搜索DuckDuckGo的缓存评论作为替代方案。
scrape_reviews.py - Direct Yelp Scraping (Alternative)
scrape_reviews.py - 直接爬取Yelp评论(替代方案)
bash
uv run python tools/yelp-search/scripts/scrape_reviews.py "https://www.yelp.com/biz/business-alias" -n 5Requires Browserbase credentials:
BROWSERBASE_API_KEY=your_key_here
BROWSERBASE_PROJECT_ID=your_project_idNote: Uses Browserbase with proxies to bypass Yelp's CAPTCHA. More reliable than but requires a Browserbase account.
get_reviews.pybash
uv run python tools/yelp-search/scripts/scrape_reviews.py "https://www.yelp.com/biz/business-alias" -n 5需要Browserbase凭证:
BROWSERBASE_API_KEY=your_key_here
BROWSERBASE_PROJECT_ID=your_project_id注意: 使用带代理的Browserbase绕过Yelp的验证码。比更可靠,但需要Browserbase账户。
get_reviews.pyBest Practices
最佳实践
Evaluating Quality Without Review Text
无需评论文本评估商家质量
The API provides rating + review_count which is usually sufficient:
| Rating | Review Count | Interpretation |
|---|---|---|
| 4.5+ | 50+ | Excellent, reliable data |
| 4.5+ | <20 | Promising but limited data |
| 4.0-4.4 | 100+ | Good, well-established |
| <4.0 | any | Proceed with caution |
API提供的评分+评论数量通常已足够:
| 评分 | 评论数量 | 解读 |
|---|---|---|
| 4.5+ | 50+ | 优秀,数据可靠 |
| 4.5+ | <20 | 前景良好,但数据有限 |
| 4.0-4.4 | 100+ | 良好,已建立口碑 |
| <4.0 | 任意 | 谨慎选择 |
Finding Services with Specific Needs
寻找有特定需求的服务
When looking for services with specific requirements (weekend hours, pickup/delivery, etc.):
- Search with to get best options
--sort-by rating - Get details on top candidates to check hours
- Filter for businesses open when you need them
- Contact directly to confirm specific services (pickup, delivery, etc.) since Yelp doesn't always have this info
当寻找有特定要求的服务(周末营业、上门取送等)时:
- 搜索时使用获取最佳选项
--sort-by rating - 查看详情,检查候选商家的营业时间
- 筛选出符合你时间需求的商家
- 直接联系确认特定服务(上门取送等),因为Yelp并不总是包含此类信息
Search Tips
搜索技巧
- Use specific terms: not just
"laundry pickup""laundry" - Search near an address for accurate distance:
-l "123 Main St, City" - Sort by first, then check
ratingon resultsdistance - Check - high ratings with few reviews may be unreliable
review_count
- 使用具体关键词:例如用而非仅
"laundry pickup""laundry" - 搜索时指定具体地址以获得准确的距离:
-l "123 Main St, City" - 先按排序,再查看结果的
ratingdistance - 查看- 高评分但评论数量少的商家可能不可靠
review_count
Response Data
返回数据
Each business result includes:
- name - Business name
- phone - Phone number (use for texting/calling)
- rating - Yelp rating (1-5 stars)
- review_count - Number of reviews
- price - Price level ($ to $$$$)
- location - Full address
- hours - Operating hours by day (in details)
- distance - Distance from search location
- categories - Business categories
- is_open_now - Current open/closed status
每个商家结果包含:
- name - 商家名称
- phone - 电话号码(用于联系)
- rating - Yelp评分(1-5星)
- review_count - 评论数量
- price - 价格等级($到$$$$)
- location - 完整地址
- hours - 按天划分的营业时间(在详情中)
- distance - 与搜索地点的距离
- categories - 商家类别
- is_open_now - 当前营业状态
Limitations
限制
| Feature | Status | Notes |
|---|---|---|
| Business search | ✅ Works | Fast, reliable |
| Business details | ✅ Works | Includes hours |
| Phone lookup | ✅ Works | Reverse search |
| Review text (API) | ❌ Paid only | Requires enterprise tier |
| Review text (scraping) | ⚠️ Slow | browser-use workaround via DuckDuckGo |
- Free API tier: 500 calls/day
- Results limited to 50 per request
- Some business info (pickup/delivery) not in API - contact directly
| 功能 | 状态 | 说明 |
|---|---|---|
| 商家搜索 | ✅ 可用 | 快速、可靠 |
| 商家详情 | ✅ 可用 | 包含营业时间 |
| 电话号码查询 | ✅ 可用 | 反向搜索 |
| 评论文本(API) | ❌ 仅付费可用 | 需要企业版 |
| 评论文本(爬取) | ⚠️ 速度慢 | 通过browser-use借助DuckDuckGo实现的替代方案 |
- 免费API层级:每天500次调用
- 每次请求最多返回50条结果
- 部分商家信息(上门取送等)未包含在API中 - 需直接联系商家确认