restaurant-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Restaurant Search

餐厅搜索

Find Japanese restaurants using the
hpp
CLI (HotPepper Gourmet API). https://github.com/jackchuka/hpp
使用
hpp
CLI(HotPepper Gourmet API)查找日本餐厅。 https://github.com/jackchuka/hpp

Prerequisites

前置条件

  • hpp
    CLI installed and
    HOTPEPPER_API_KEY
    env var set
  • 已安装
    hpp
    CLI并设置
    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
    open
    /
    close
    fields)
  • Genre preference: e.g., izakaya, Chinese, Italian (maps to
    --genre
    )
  • Budget: Price range (maps to
    --budget
    )
  • Features: Private rooms (
    --private-room
    ), non-smoking (
    --non-smoking
    ), WiFi (
    --wifi
    ), free drink (
    --free-drink
    ), etc.
  • Keywords: Free text like "ramen", "sushi" (maps to
    --keyword
    )
从用户请求中提取以下信息:
  • 位置:车站名、区域名或坐标
  • 用餐人数:人数(对应参数
    --party-capacity
  • 日期/时间:确定哪些餐厅处于营业状态(查看
    open
    /
    close
    字段)
  • 菜系偏好:例如居酒屋、中式、意式(对应参数
    --genre
  • 预算:价格范围(对应参数
    --budget
  • 特色服务:私人包厢(
    --private-room
    )、无烟区(
    --non-smoking
    )、WiFi(
    --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.,
X085
for 浜松町) along with parent middle/large area codes.
If 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
--lat
,
--lng
,
--range
instead.
API需要区域代码而非自由文本格式的位置名称。解析位置的命令如下:
bash
hpp area small --keyword "<location-name>"
该命令返回小区域代码(例如浜松町对应
X085
)以及上级中/大区域代码。
如果没有匹配的小区域,尝试搜索中区域:
bash
hpp area middle --keyword "<location-name>"
如果用户提供坐标(纬度/经度),则跳过区域查找,直接使用
--lat
--lng
--range
参数。

3. Resolve genre codes (if needed)

3. 解析菜系代码(如有需要)

If the user requests a specific cuisine type:
bash
hpp genre
Common genre codes:
CodeGenre
G001居酒屋
G002ダイニングバー・バル
G003創作料理
G004和食
G005洋食
G006イタリアン・フレンチ
G007中華
G008焼肉・ホルモン
G009アジア・エスニック
G010各国料理
G011カラオケ・パーティ
G012バー・カクテル
G013ラーメン
G014カフェ・スイーツ
G016お好み焼き・もんじゃ
G017韓国料理
If unsure, run
hpp genre
to get the full list.
如果用户指定了特定菜系类型:
bash
hpp genre
常见菜系代码:
代码菜系
G001居酒屋
G002餐吧/酒吧
G003创意料理
G004日式料理
G005西式料理
G006意式/法式料理
G007中式料理
G008烤肉/内脏料理
G009亚洲/民族料理
G010各国料理
G011卡拉OK/聚会场所
G012酒吧/鸡尾酒
G013拉面
G014咖啡馆/甜品店
G016大阪烧/文字烧
G017韩式料理
若不确定,可运行
hpp genre
获取完整列表。

4. Resolve budget codes (if needed)

4. 解析预算代码(如有需要)

If the user specifies a budget:
bash
hpp budget
Common budget codes:
CodeRange
B001~1500円
B0022001~3000円
B0033001~4000円
B0084001~5000円
B0045001~7000円
B0057001~10000円
B00610001~15000円
B01215001~20000円
B01320001~30000円
B01430001円~
如果用户指定了预算范围:
bash
hpp budget
常见预算代码:
代码价格范围
B001~1500日元
B0022001~3000日元
B0033001~4000日元
B0084001~5000日元
B0045001~7000日元
B0057001~10000日元
B00610001~15000日元
B01215001~20000日元
B01320001~30000日元
B01430001日元~

5. Search restaurants

5. 搜索餐厅

Build the
hpp search
command with resolved codes and flags:
bash
hpp search --small-area <code> --party-capacity <N> --count 10
Key flags to apply based on user needs:
NeedFlag
Party size
--party-capacity <N>
Genre
--genre <code>
Budget
--budget <code>
Private room
--private-room
Non-smoking
--non-smoking
WiFi
--wifi
All-you-can-drink
--free-drink
All-you-can-eat
--free-food
English menu
--english
Card payment
--card
Late night (after 11pm)
--midnight
Lunch
--lunch
Keyword
--keyword "<text>"
Coordinates
--lat <lat> --lng <lng> --range <1-5>
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 search
命令:
bash
hpp search --small-area <code> --party-capacity <N> --count 10
根据用户需求添加关键参数:
用户需求参数
用餐人数
--party-capacity <N>
菜系
--genre <code>
预算
--budget <code>
私人包厢
--private-room
无烟区
--non-smoking
WiFi
--wifi
无限畅饮
--free-drink
无限畅吃
--free-food
英文菜单
--english
支持刷卡
--card
深夜营业(23点后)
--midnight
午餐
--lunch
关键词
--keyword "<text>"
坐标
--lat <lat> --lng <lng> --range <1-5>
坐标搜索的范围值:1=300米,2=500米,3=1公里,4=2公里,5=3公里。
始终使用JSON格式输出(默认格式)以便解析,然后将结果以表格形式展示。

6. Present results

6. 展示结果

Display results as a markdown table with these columns:
ColumnSource
#Row number
Restaurant
name
Genre
genre.name
Budget
budget.average
Access
access
(summarize to station + walk time)
Private Room
private_room
(yes/no/semi)
Hours
open
(show relevant day only)
Link
urls.pc
(as clickable markdown 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表格形式展示结果,包含以下列:
列名数据来源
序号行号
餐厅名称
name
菜系
genre.name
预算
budget.average
交通方式
access
(总结为车站+步行时间)
私人包厢
private_room
(是/否/半包厢)
营业时间
open
(仅显示对应日期的营业时间)
链接
urls.pc
(作为可点击的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
    --count
    or use
    --start
    for pagination
如果用户想要缩小搜索范围,添加更多参数重新搜索。常见优化方式:
  • “带私人包厢” → 添加
    --private-room
  • “4000日元以下” → 添加
    --budget B001,B002,B003
  • “无烟区” → 添加
    --non-smoking
  • “显示更多结果” → 增加
    --count
    或使用
    --start
    进行分页

Other Useful Commands

其他实用命令

  • hpp shop --name "<name>"
    — Look up a specific restaurant by name
  • hpp special list
    — Browse special features/tags
  • hpp creditcard
    — List accepted credit card types
  • hpp shop --name "<name>"
    — 按名称查找特定餐厅
  • hpp special list
    — 浏览特色服务/标签
  • hpp creditcard
    — 查看支持的信用卡类型

Important Notes

重要注意事项

  • Always use
    --count
    to limit results (default 10, max 100)
  • The API returns Japanese text — present it as-is, do not translate unless asked
  • Monday = 月, check
    open
    /
    close
    fields to verify the restaurant is open on the requested day
  • When the user specifies a day, check the
    close
    field for regular holidays (e.g., 日 = Sunday)
  • Coupon links are available in
    coupon_urls.sp
    — mention if the user asks about deals
  • 始终使用
    --count
    限制结果数量(默认10条,最多100条)
  • API返回日文文本——原样展示,除非用户要求否则不要翻译
  • 周一=月,需查看
    open
    /
    close
    字段确认餐厅在请求日期是否营业
  • 当用户指定日期时,查看
    close
    字段确认常规休息日(例如日=周日)
  • 优惠券链接可在
    coupon_urls.sp
    中获取——如果用户询问优惠信息可提及