goplaces 是做什么的?
现代化的 Google Places API(新版)命令行工具。默认输出人类可读的结果,使用 --json 可获得脚本友好的格式。
安装
- Homebrew:
brew install steipete/tap/goplaces
配置
- 必需:
GOOGLE_PLACES_API_KEY。 - 可选:
GOOGLE_PLACES_BASE_URL(用于测试或代理)。
常用命令
- 搜索:
goplaces search "coffee" --open-now --min-rating 4 --limit 5 - 位置偏置:
goplaces search "pizza" --lat 40.8 --lng -73.9 --radius-m 3000 - 分页:
goplaces search "pizza" --page-token "NEXT_PAGE_TOKEN" - 解析:
goplaces resolve "Soho, London" --limit 5 - 详情:
goplaces details <place_id> --reviews - JSON 输出:
goplaces search "sushi" --json
备注
--no-color或NO_COLOR环境变量可禁用 ANSI 颜色。- 价格等级:0..4(免费 -> 非常昂贵)。
- 类型筛选仅发送第一个
--type值(API 只接受一个)。