360 Secure SkillHub
360 安全技能中心

Google Places Search

通过本地 Python 脚本调用 Google Places API,支持关键词搜索、按 place_id 查询详情和按经纬度附近搜索,返回名称、地址、评分、评论数、价格等级、营业状态、电话、网站与地图链接等结构化结果,用于本地商家查找、餐厅推荐与旅行规划。

daveperham
daveperham
热度 20.56
最近更新 2026-05-20 03:33:05
分类:生活依赖:代码执行 / 第三方 API应用场景:旅行 / 推荐 / 购物

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add toji-google-places
Metadata
name
google-places
description
Search for nearby businesses, restaurants, services, and places using the Google Places API. Get ratings, reviews, hours, contact info, and directions. Use when a user asks for recommendations, "find me a...", "what's nearby", "best X near Y", travel planning, or local business lookups.
metadata
{"openclaw":{"emoji":"📍"}}

Google Places — Location & Business Search

Search for places, get business details, and find recommendations via Google Places API.

When to Use

✅ USE this skill when:

  • User asks "find me a...", "best X near Y", "what's open near me"
  • Restaurant/bar/cafe recommendations
  • Business lookups (hours, phone, address, ratings)
  • Travel planning (hotels, attractions, things to do in X)
  • "Is X open right now?"
  • Price comparisons for local services
  • Directions or distance between places

❌ DON'T use this skill when:

  • General web search (use web_search tool)
  • News or current events (use Sonar)
  • Non-location queries

API Key

Stored in the script. Key: AIzaSyBPr1G_HLss2GJFSXFLqk0RVO8Vd3oBoEU

Usage

Search for places

python3 ~/.openclaw/workspace/skills/google-places/scripts/places.py search \
  --query "best ramen near Boston MA" \
  --limit 5

Get place details

python3 ~/.openclaw/workspace/skills/google-places/scripts/places.py details \
  --place-id "ChIJN1t_tDeuEmsRUsoyG83frY4"

Nearby search (by coordinates)

python3 ~/.openclaw/workspace/skills/google-places/scripts/places.py nearby \
  --lat 42.3601 --lng -71.0589 \
  --type restaurant \
  --radius 1500

Options

Flag Description Default
--query Text search query Required for search
--place-id Google Place ID Required for details
--lat / --lng Coordinates for nearby search Optional
--type Place type filter (restaurant, cafe, hotel, etc.) Optional
--radius Search radius in meters 5000
--limit Max results 5
--open-now Only show currently open places false

Output

Returns JSON with:

  • Name, address, rating (1-5), total reviews
  • Price level ($-$$$$)
  • Open/closed status and hours
  • Phone number, website
  • Google Maps link
  • Top reviews (for details)

Tips

  • Always include a location in the query for best results
  • Use --open-now flag when the user asks "what's open"
  • For detailed info (hours, reviews, phone), use the details command with the place_id from search results
  • Price levels: 0=Free, 1=$, 2=$$, 3=$$$, 4=$$$$