← 返回
开发者工具 Key

Local Places

Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
通过 localhost 的 Google Places API 代理搜索地点(餐厅、咖啡馆等)。
steipete
开发者工具 clawhub v1.0.0 1 版本 98503.4 Key: 需要
★ 26
Stars
📥 8,958
下载
💾 1,671
安装
1
版本
#latest

概述

📍 Local Places

Find places, Go fast

Search for nearby places using a local Google Places API proxy. Two-step flow: resolve location first, then search.

Setup

cd {baseDir}
echo "GOOGLE_PLACES_API_KEY=your-key" > .env
uv venv && uv pip install -e ".[dev]"
uv run --env-file .env uvicorn local_places.main:app --host 127.0.0.1 --port 8000

Requires GOOGLE_PLACES_API_KEY in .env or environment.

Quick Start

  1. Check server: curl http://127.0.0.1:8000/ping
  1. Resolve location:
  2. curl -X POST http://127.0.0.1:8000/locations/resolve \
      -H "Content-Type: application/json" \
      -d '{"location_text": "Soho, London", "limit": 5}'
    
  1. Search places:
  2. curl -X POST http://127.0.0.1:8000/places/search \
      -H "Content-Type: application/json" \
      -d '{
        "query": "coffee shop",
        "location_bias": {"lat": 51.5137, "lng": -0.1366, "radius_m": 1000},
        "filters": {"open_now": true, "min_rating": 4.0},
        "limit": 10
      }'
    
  1. Get details:
  2. curl http://127.0.0.1:8000/places/{place_id}
    

Conversation Flow

  1. If user says "near me" or gives vague location → resolve it first
  2. If multiple results → show numbered list, ask user to pick
  3. Ask for preferences: type, open now, rating, price level
  4. Search with location_bias from chosen location
  5. Present results with name, rating, address, open status
  6. Offer to fetch details or refine search

Filter Constraints

  • filters.types: exactly ONE type (e.g., "restaurant", "cafe", "gym")
  • filters.price_levels: integers 0-4 (0=free, 4=very expensive)
  • filters.min_rating: 0-5 in 0.5 increments
  • filters.open_now: boolean
  • limit: 1-20 for search, 1-10 for resolve
  • location_bias.radius_m: must be > 0

Response Format

{
  "results": [
    {
      "place_id": "ChIJ...",
      "name": "Coffee Shop",
      "address": "123 Main St",
      "location": {"lat": 51.5, "lng": -0.1},
      "rating": 4.6,
      "price_level": 2,
      "types": ["cafe", "food"],
      "open_now": true
    }
  ],
  "next_page_token": "..." 
}

Use next_page_token as page_token in next request for more results.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-27 23:42 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,779
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 65 📥 179,827
productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 444 📥 226,098