goplaces 是做什麼的?
使用新版 Google Places API 的命令列工具。預設輸出人類可讀格式,加上 --json 可輸出供腳本使用的 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(0 免費,4 非常昂貴)。
- 類型篩選只傳送第一個
--type值(API 僅接受一個)。