Google Places

Query Google Places API (New) via the goplaces CLI for text search, place details, resolve, and reviews.

goplaces is a modern Go CLI and client library for Google's Places API (New) by Peter Steinberger (steipete). It wraps Google's next-generation Places API with a clean, scriptable interface for text search, nearby search, autocomplete, place details (hours, phone, website, ratings, reviews), photo URLs, route-based search, and directions. What sets goplaces apart is its dual-output design: colorful human-readable output for interactive use, and `--json` for scriptable pipelines. It handles the complexity of Google's API — field masks, session tokens, pagination, locale hints — so you don't have to. Every command supports location bias (lat/lng/radius), type filtering, price level ranges, and minimum ratings. The route search feature is particularly clever: find places along a driving route between two points using the Routes API. Combined with the directions command (distance, duration, turn-by-turn steps), it enables trip-planning workflows entirely from the terminal. For OpenClaw users, goplaces means your AI assistant can answer location questions with real data: 'Find the best-rated Italian restaurants near me' or 'What are the hours for that coffee shop?' The JSON output makes it easy to process results programmatically. Setup requires a Google Cloud project with Places API (New) and optionally Routes API enabled. API keys should be restricted to these specific APIs, and you should set budget alerts — Places API calls are billed per request. Best suited for: anyone needing location/place data from the terminal, AI assistants answering location queries, developers building location-aware automations, trip planning workflows.

Tags: google, places, location, search, maps

Category: Location

Use Cases

  • Find nearby restaurants with ratings and hours for dinner planning
  • Get place details (phone, website, hours) for business research
  • Route-based search: find gas stations or rest stops along a road trip
  • Address resolution: convert fuzzy location strings to precise places
  • Autocomplete for interactive location search in chat
  • Read reviews for local businesses without opening a browser

Tips

  • Always restrict your API key to only Places API (New) and Routes API in Cloud Console
  • Use `--json` for scriptable output and pipe to jq for filtering
  • Set GOOGLE_PLACES_API_KEY in your shell profile for persistent auth
  • Use location bias (--lat, --lng, --radius) to get relevant local results
  • Combine with OpenClaw cron for automated location monitoring (e.g., new restaurant alerts)
  • The resolve command is great for normalizing fuzzy location strings to precise places
  • Use autocomplete with session tokens to reduce API costs for interactive searches

Known Issues & Gotchas

  • Requires Google Cloud project setup with Places API (New) enabled — make sure it says '(New)'
  • Places API has usage costs — set budget alerts in Google Cloud Console
  • Routes API must be enabled separately for route search and directions commands
  • API key should be restricted to Places API (New) and Routes API only for security
  • Free tier is very limited — most production use requires a billing account
  • Place IDs can change over time — don't cache them indefinitely
  • Review data requires --reviews flag and may incur additional API costs

Alternatives

  • Google Maps CLI (direct curl)
  • Foursquare Places API
  • Overpass API (OpenStreetMap)
  • Yelp Fusion API

Community Feedback

Modern Go client + CLI for the Google Places API (New). Fast for humans, tidy for scripts. Text search with filters, autocomplete, nearby search, route search, directions, and place details with reviews.

— GitHub

Query Google Places API (New) via the goplaces CLI for text search, place details, resolve, and reviews. Use for human-friendly place lookup or JSON output.

— Agent Skills Registry

New goplaces CLI is up, now includes directions and user reviews. Google Places from your terminal.

— Twitter/X (steipete)

Configuration Examples

Setup and basic search

# Set API key
export GOOGLE_PLACES_API_KEY="your-key-here"

# Text search
goplaces search "best pizza in Mumbai" --json

# With filters
goplaces search "coffee" --type cafe --open-now --min-rating 4.0

Place details with reviews

# Get details by place ID
goplaces details ChIJN1t_tDeuEmsRUsoyG83frY4 --reviews --json

# Resolve a fuzzy location
goplaces resolve "Taj Mahal Hotel Mumbai" --json

Route search and directions

# Find places along a route
goplaces route "Mumbai" "Pune" --type gas_station

# Get directions
goplaces directions "Mumbai" "Pune" --json | jq '.routes[0].duration'

Installation

brew install steipete/tap/goplaces

Homepage: https://github.com/steipete/goplaces

Source: bundled