Restaurant Search
Find Japanese restaurants using the
CLI (HotPepper Gourmet API).
https://github.com/jackchuka/hpp
Prerequisites
- CLI installed and env var set
Workflow
1. Parse the request
Extract from the user's request:
- Location: Station name, area name, or coordinates
- Party size: Number of people (maps to )
- Day/time: Determines which restaurants are open (check / fields)
- Genre preference: e.g., izakaya, Chinese, Italian (maps to )
- Budget: Price range (maps to )
- Features: Private rooms (), non-smoking (), WiFi (), free drink (), etc.
- Keywords: Free text like "ramen", "sushi" (maps to )
2. Resolve the area code
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.
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
,
,
instead.
3. Resolve genre codes (if needed)
If the user requests a specific cuisine type:
Common 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.
4. Resolve budget codes (if needed)
If the user specifies a budget:
Common 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円~ |
5. Search restaurants
Build the
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:
| 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 | --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.
6. Present results
Display results as a markdown table with these columns:
| Column | Source |
|---|
| # | Row number |
| Restaurant | |
| Genre | |
| Budget | |
| Access | (summarize to station + walk time) |
| Private Room | (yes/no/semi) |
| Hours | (show relevant day only) |
| Link | (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).
7. Refine (if requested)
If the user wants to narrow down, add more flags and re-search. Common refinements:
- "with private rooms" → add
- "under 4000 yen" → add
- "non-smoking" → add
- "show me more" → increase or use for pagination
Other Useful Commands
- — Look up a specific restaurant by name
- — Browse special features/tags
- — List accepted credit card types
Important Notes
- Always use to limit results (default 10, max 100)
- The API returns Japanese text — present it as-is, do not translate unless asked
- Monday = 月, check / fields to verify the restaurant is open on the requested day
- When the user specifies a day, check the field for regular holidays (e.g., 日 = Sunday)
- Coupon links are available in — mention if the user asks about deals