restaurant-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRestaurant Search
餐厅搜索
Find Japanese restaurants using the CLI (HotPepper Gourmet API).
https://github.com/jackchuka/hpp
hpp使用 CLI(HotPepper Gourmet API)查找日本餐厅。
https://github.com/jackchuka/hpp
hppPrerequisites
前置条件
- CLI installed and
hppenv var setHOTPEPPER_API_KEY
- 已安装CLI并设置
hpp环境变量HOTPEPPER_API_KEY
Workflow
操作流程
1. Parse the request
1. 解析请求
Extract from the user's request:
- Location: Station name, area name, or coordinates
- Party size: Number of people (maps to )
--party-capacity - Day/time: Determines which restaurants are open (check /
openfields)close - Genre preference: e.g., izakaya, Chinese, Italian (maps to )
--genre - Budget: Price range (maps to )
--budget - Features: Private rooms (), non-smoking (
--private-room), WiFi (--non-smoking), free drink (--wifi), etc.--free-drink - Keywords: Free text like "ramen", "sushi" (maps to )
--keyword
从用户请求中提取以下信息:
- 位置:车站名、区域名或坐标
- 用餐人数:人数(对应参数)
--party-capacity - 日期/时间:确定哪些餐厅处于营业状态(查看/
open字段)close - 菜系偏好:例如居酒屋、中式、意式(对应参数)
--genre - 预算:价格范围(对应参数)
--budget - 特色服务:私人包厢()、无烟区(
--private-room)、WiFi(--non-smoking)、无限畅饮(--wifi)等--free-drink - 关键词:自由文本如“拉面”、“寿司”(对应参数)
--keyword
2. Resolve the area code
2. 解析区域代码
The API requires area codes, not free-text location names. Resolve the location:
bash
hpp area small --keyword "<location-name>"This returns small area codes (e.g., for 浜松町) along with parent middle/large area codes.
X085If no small area matches, try middle area:
bash
hpp area middle --keyword "<location-name>"If the user provides coordinates (lat/lng), skip area lookup and use , , instead.
--lat--lng--rangeAPI需要区域代码而非自由文本格式的位置名称。解析位置的命令如下:
bash
hpp area small --keyword "<location-name>"该命令返回小区域代码(例如浜松町对应)以及上级中/大区域代码。
X085如果没有匹配的小区域,尝试搜索中区域:
bash
hpp area middle --keyword "<location-name>"如果用户提供坐标(纬度/经度),则跳过区域查找,直接使用、、参数。
--lat--lng--range3. Resolve genre codes (if needed)
3. 解析菜系代码(如有需要)
If the user requests a specific cuisine type:
bash
hpp genreCommon genre codes:
| Code | Genre |
|---|---|
| G001 | 居酒屋 |
| G002 | ダイニングバー・バル |
| G003 | 創作料理 |
| G004 | 和食 |
| G005 | 洋食 |
| G006 | イタリアン・フレンチ |
| G007 | 中華 |
| G008 | 焼肉・ホルモン |
| G009 | アジア・エスニック |
| G010 | 各国料理 |
| G011 | カラオケ・パーティ |
| G012 | バー・カクテル |
| G013 | ラーメン |
| G014 | カフェ・スイーツ |
| G016 | お好み焼き・もんじゃ |
| G017 | 韓国料理 |
If unsure, run to get the full list.
hpp genre如果用户指定了特定菜系类型:
bash
hpp genre常见菜系代码:
| 代码 | 菜系 |
|---|---|
| G001 | 居酒屋 |
| G002 | 餐吧/酒吧 |
| G003 | 创意料理 |
| G004 | 日式料理 |
| G005 | 西式料理 |
| G006 | 意式/法式料理 |
| G007 | 中式料理 |
| G008 | 烤肉/内脏料理 |
| G009 | 亚洲/民族料理 |
| G010 | 各国料理 |
| G011 | 卡拉OK/聚会场所 |
| G012 | 酒吧/鸡尾酒 |
| G013 | 拉面 |
| G014 | 咖啡馆/甜品店 |
| G016 | 大阪烧/文字烧 |
| G017 | 韩式料理 |
若不确定,可运行获取完整列表。
hpp genre4. Resolve budget codes (if needed)
4. 解析预算代码(如有需要)
If the user specifies a budget:
bash
hpp budgetCommon budget codes:
| Code | Range |
|---|---|
| B001 | ~1500円 |
| B002 | 2001~3000円 |
| B003 | 3001~4000円 |
| B008 | 4001~5000円 |
| B004 | 5001~7000円 |
| B005 | 7001~10000円 |
| B006 | 10001~15000円 |
| B012 | 15001~20000円 |
| B013 | 20001~30000円 |
| B014 | 30001円~ |
如果用户指定了预算范围:
bash
hpp budget常见预算代码:
| 代码 | 价格范围 |
|---|---|
| B001 | ~1500日元 |
| B002 | 2001~3000日元 |
| B003 | 3001~4000日元 |
| B008 | 4001~5000日元 |
| B004 | 5001~7000日元 |
| B005 | 7001~10000日元 |
| B006 | 10001~15000日元 |
| B012 | 15001~20000日元 |
| B013 | 20001~30000日元 |
| B014 | 30001日元~ |
5. Search restaurants
5. 搜索餐厅
Build the command with resolved codes and flags:
hpp searchbash
hpp search --small-area <code> --party-capacity <N> --count 10Key flags to apply based on user needs:
| Need | Flag |
|---|---|
| Party size | |
| Genre | |
| Budget | |
| Private room | |
| Non-smoking | |
| WiFi | |
| All-you-can-drink | |
| All-you-can-eat | |
| English menu | |
| Card payment | |
| Late night (after 11pm) | |
| Lunch | |
| Keyword | |
| Coordinates | |
Range values for coordinate search: 1=300m, 2=500m, 3=1km, 4=2km, 5=3km.
Always use JSON output (default) for parsing, then present results as a table.
结合解析后的代码和参数构建命令:
hpp searchbash
hpp search --small-area <code> --party-capacity <N> --count 10根据用户需求添加关键参数:
| 用户需求 | 参数 |
|---|---|
| 用餐人数 | |
| 菜系 | |
| 预算 | |
| 私人包厢 | |
| 无烟区 | |
| WiFi | |
| 无限畅饮 | |
| 无限畅吃 | |
| 英文菜单 | |
| 支持刷卡 | |
| 深夜营业(23点后) | |
| 午餐 | |
| 关键词 | |
| 坐标 | |
坐标搜索的范围值:1=300米,2=500米,3=1公里,4=2公里,5=3公里。
始终使用JSON格式输出(默认格式)以便解析,然后将结果以表格形式展示。
6. Present results
6. 展示结果
Display results as a markdown table with these columns:
| Column | Source |
|---|---|
| # | Row number |
| Restaurant | |
| Genre | |
| Budget | |
| Access | |
| Private Room | |
| Hours | |
| Link | |
After the table, add brief recommendations highlighting the best options for the user's specific needs (e.g., closest to station, best for groups, has private rooms).
以Markdown表格形式展示结果,包含以下列:
| 列名 | 数据来源 |
|---|---|
| 序号 | 行号 |
| 餐厅名称 | |
| 菜系 | |
| 预算 | |
| 交通方式 | |
| 私人包厢 | |
| 营业时间 | |
| 链接 | |
表格下方添加简短推荐,突出最符合用户特定需求的选项(例如离车站最近、最适合团体、有私人包厢等)。
7. Refine (if requested)
7. 优化搜索(如有需求)
If the user wants to narrow down, add more flags and re-search. Common refinements:
- "with private rooms" → add
--private-room - "under 4000 yen" → add
--budget B001,B002,B003 - "non-smoking" → add
--non-smoking - "show me more" → increase or use
--countfor pagination--start
如果用户想要缩小搜索范围,添加更多参数重新搜索。常见优化方式:
- “带私人包厢” → 添加
--private-room - “4000日元以下” → 添加
--budget B001,B002,B003 - “无烟区” → 添加
--non-smoking - “显示更多结果” → 增加或使用
--count进行分页--start
Other Useful Commands
其他实用命令
- — Look up a specific restaurant by name
hpp shop --name "<name>" - — Browse special features/tags
hpp special list - — List accepted credit card types
hpp creditcard
- — 按名称查找特定餐厅
hpp shop --name "<name>" - — 浏览特色服务/标签
hpp special list - — 查看支持的信用卡类型
hpp creditcard
Important Notes
重要注意事项
- Always use to limit results (default 10, max 100)
--count - The API returns Japanese text — present it as-is, do not translate unless asked
- Monday = 月, check /
openfields to verify the restaurant is open on the requested dayclose - When the user specifies a day, check the field for regular holidays (e.g., 日 = Sunday)
close - Coupon links are available in — mention if the user asks about deals
coupon_urls.sp
- 始终使用限制结果数量(默认10条,最多100条)
--count - API返回日文文本——原样展示,除非用户要求否则不要翻译
- 周一=月,需查看/
open字段确认餐厅在请求日期是否营业close - 当用户指定日期时,查看字段确认常规休息日(例如日=周日)
close - 优惠券链接可在中获取——如果用户询问优惠信息可提及
coupon_urls.sp