local-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Local Search with Google Maps

基于Google Maps的本地搜索

STOP — Read before making any API call. enrichx402.com endpoints are not the same as each provider's native API. All paths use the format
https://enrichx402.com/api/{provider}/{action}
. You MUST either:
  1. Copy exact URLs from the Quick Reference table below, OR
  2. Run
    x402.discover_api_endpoints(url="https://enrichx402.com")
    to get the correct paths
Guessing paths will fail with 405 errors (wrong path) or 404 errors (missing
/api/
prefix).
Access Google Maps Places API through x402-protected endpoints.
注意 — 调用任何API前请仔细阅读。 enrichx402.com的端点并非各服务商的原生API。所有路径均采用
https://enrichx402.com/api/{provider}/{action}
格式。您必须:
  1. 从下方快速参考表中复制准确的URL,或者
  2. 调用
    x402.discover_api_endpoints(url="https://enrichx402.com")
    获取正确路径
猜测路径会导致失败,返回405错误(路径错误)或404错误(缺少
/api/
前缀)。
通过x402保护的端点访问Google Maps Places API。

Setup

设置

See rules/getting-started.md for installation and wallet setup.
请查看 rules/getting-started.md 了解安装和钱包设置步骤。

Quick Reference

快速参考

TaskEndpointPriceData Included
Text search (basic)
https://enrichx402.com/api/google-maps/text-search/partial
$0.02Name, address, rating
Text search (full)
https://enrichx402.com/api/google-maps/text-search/full
$0.08+ reviews, atmosphere
Nearby search (basic)
https://enrichx402.com/api/google-maps/nearby-search/partial
$0.02Name, address, rating
Nearby search (full)
https://enrichx402.com/api/google-maps/nearby-search/full
$0.08+ reviews, atmosphere
Place details (basic)
https://enrichx402.com/api/google-maps/place-details/partial
$0.02Core info
Place details (full)
https://enrichx402.com/api/google-maps/place-details/full
$0.05All fields
See rules/partial-vs-full.md for tier selection guidance.
任务端点价格包含数据
文本搜索(基础版)
https://enrichx402.com/api/google-maps/text-search/partial
0.02美元名称、地址、评分
文本搜索(完整版)
https://enrichx402.com/api/google-maps/text-search/full
0.08美元+ 评论、氛围信息
附近搜索(基础版)
https://enrichx402.com/api/google-maps/nearby-search/partial
0.02美元名称、地址、评分
附近搜索(完整版)
https://enrichx402.com/api/google-maps/nearby-search/full
0.08美元+ 评论、氛围信息
地点详情(基础版)
https://enrichx402.com/api/google-maps/place-details/partial
0.02美元核心信息
地点详情(完整版)
https://enrichx402.com/api/google-maps/place-details/full
0.05美元所有字段
请查看 rules/partial-vs-full.md 了解版本选择指南。

Text Search

文本搜索

Search for places by text query:
mcp
x402.fetch(
  url="https://enrichx402.com/api/google-maps/text-search/partial",
  method="POST",
  body={
    "textQuery": "coffee shops in downtown Seattle"
  }
)
Parameters:
  • textQuery
    - Search query (required)
  • locationBias
    - Prefer results near a location
  • minRating
    - Minimum rating filter (1-5)
  • openNow
    - Only open places
  • maxResultCount
    - Limit results (default: 20)
Full tier adds: reviews, atmosphere data, photos, price level.
通过文本查询搜索地点:
mcp
x402.fetch(
  url="https://enrichx402.com/api/google-maps/text-search/partial",
  method="POST",
  body={
    "textQuery": "coffee shops in downtown Seattle"
  }
)
参数:
  • textQuery
    - 搜索查询(必填)
  • locationBias
    - 优先返回指定位置附近的结果
  • minRating
    - 最低评分筛选(1-5)
  • openNow
    - 仅返回当前营业的地点
  • maxResultCount
    - 结果数量限制(默认:20)
完整版额外包含: 评论、氛围数据、照片、价格等级。

Nearby Search

附近搜索

Search for places near a location:
mcp
x402.fetch(
  url="https://enrichx402.com/api/google-maps/nearby-search/partial",
  method="POST",
  body={
    "locationRestriction": {
      "circle": {
        "center": {
          "latitude": 47.6062,
          "longitude": -122.3321
        },
        "radius": 1000
      }
    },
    "includedTypes": ["restaurant", "cafe"]
  }
)
Parameters:
  • locationRestriction
    - Circle with center (lat/lng) and radius in meters
  • includedTypes
    - Place types to include
  • excludedTypes
    - Place types to exclude
  • minRating
    - Minimum rating
  • openNow
    - Only open places
搜索指定位置附近的地点:
mcp
x402.fetch(
  url="https://enrichx402.com/api/google-maps/nearby-search/partial",
  method="POST",
  body={
    "locationRestriction": {
      "circle": {
        "center": {
          "latitude": 47.6062,
          "longitude": -122.3321
        },
        "radius": 1000
      }
    },
    "includedTypes": ["restaurant", "cafe"]
  }
)
参数:
  • locationRestriction
    - 包含中心坐标(纬度/经度)和半径(米)的圆形范围
  • includedTypes
    - 要包含的地点类型
  • excludedTypes
    - 要排除的地点类型
  • minRating
    - 最低评分
  • openNow
    - 仅返回当前营业的地点

Place Details

地点详情

Get detailed info for a specific place:
mcp
x402.fetch(
  url="https://enrichx402.com/api/google-maps/place-details/partial",
  method="POST",
  body={
    "placeId": "ChIJN1t_tDeuEmsRUsoyG83frY4"
  }
)
Input:
  • placeId
    - Google Place ID (from search results)
Partial returns: Name, address, phone, website, hours, rating, types.
Full returns: + reviews, atmosphere (wheelchair access, pets allowed), photos, price level.
获取特定地点的详细信息:
mcp
x402.fetch(
  url="https://enrichx402.com/api/google-maps/place-details/partial",
  method="POST",
  body={
    "placeId": "ChIJN1t_tDeuEmsRUsoyG83frY4"
  }
)
输入:
  • placeId
    - Google地点ID(来自搜索结果)
基础版返回: 名称、地址、电话、官网、营业时间、评分、类型。
完整版返回: + 评论、氛围信息(轮椅通道、允许宠物等)、照片、价格等级。

Common Place Types

常见地点类型

Use these with
includedTypes
/
excludedTypes
:
Food & Drink: restaurant, cafe, bar, bakery, coffee_shop
Lodging: hotel, motel, lodging, guest_house
Shopping: shopping_mall, store, supermarket, clothing_store
Services: bank, atm, gas_station, car_repair, car_wash
Health: hospital, pharmacy, doctor, dentist
Entertainment: movie_theater, museum, park, gym
可在
includedTypes
/
excludedTypes
中使用以下类型:
餐饮: restaurant, cafe, bar, bakery, coffee_shop
住宿: hotel, motel, lodging, guest_house
购物: shopping_mall, store, supermarket, clothing_store
服务: bank, atm, gas_station, car_repair, car_wash
医疗: hospital, pharmacy, doctor, dentist
娱乐: movie_theater, museum, park, gym

Workflows

工作流

Find Businesses in Area

查找指定区域内的商家

  1. (Optional) Check balance:
    x402.get_wallet_info
  2. Discover endpoints (required before first fetch):
    x402.discover_api_endpoints(url="https://enrichx402.com")
  3. Text search (partial) to find options
  4. Review results and select top picks
  5. Get full details for selected places
mcp
x402.fetch(
  url="https://enrichx402.com/api/google-maps/text-search/partial",
  method="POST",
  body={"textQuery": "Italian restaurants downtown Portland"}
)
mcp
x402.fetch(
  url="https://enrichx402.com/api/google-maps/place-details/full",
  method="POST",
  body={"placeId": "ChIJ..."}
)
  1. (可选)查看余额:
    x402.get_wallet_info
  2. 发现端点(首次调用前必填):
    x402.discover_api_endpoints(url="https://enrichx402.com")
  3. 使用文本搜索(基础版)查找选项
  4. 查看结果并选择优先选项
  5. 获取选中地点的完整版详情
mcp
x402.fetch(
  url="https://enrichx402.com/api/google-maps/text-search/partial",
  method="POST",
  body={"textQuery": "Italian restaurants downtown Portland"}
)
mcp
x402.fetch(
  url="https://enrichx402.com/api/google-maps/place-details/full",
  method="POST",
  body={"placeId": "ChIJ..."}
)

Nearby Search with Filters

带筛选条件的附近搜索

  • Get coordinates for the area
  • Search with location restriction and filters
  • Present sorted results
mcp
x402.fetch(
  url="https://enrichx402.com/api/google-maps/nearby-search/partial",
  method="POST",
  body={
    "locationRestriction": {
      "circle": {
        "center": {"latitude": 40.7128, "longitude": -74.0060},
        "radius": 500
      }
    },
    "includedTypes": ["restaurant"],
    "minRating": 4.0,
    "openNow": true
  }
)
  • 获取目标区域的坐标
  • 使用位置限制和筛选条件进行搜索
  • 展示排序后的结果
mcp
x402.fetch(
  url="https://enrichx402.com/api/google-maps/nearby-search/partial",
  method="POST",
  body={
    "locationRestriction": {
      "circle": {
        "center": {"latitude": 40.7128, "longitude": -74.0060},
        "radius": 500
      }
    },
    "includedTypes": ["restaurant"],
    "minRating": 4.0,
    "openNow": true
  }
)

Compare Places with Reviews

对比带评论的地点

  • Search to get place IDs
  • Fetch full details for each candidate
  • Compare ratings, reviews, and amenities
mcp
x402.fetch(
  url="https://enrichx402.com/api/google-maps/place-details/full",
  method="POST",
  body={"placeId": "place_id_here"}
)
  • 搜索获取地点ID
  • 获取每个候选地点的完整版详情
  • 对比评分、评论和设施
mcp
x402.fetch(
  url="https://enrichx402.com/api/google-maps/place-details/full",
  method="POST",
  body={"placeId": "place_id_here"}
)

Cost Optimization

成本优化

Use Partial Tier When:

适合使用基础版的场景:

  • Just need name, address, basic info
  • Browsing/discovering options
  • Initial search before drilling down
  • 仅需要名称、地址等基础信息
  • 浏览/发现选项
  • 深入查询前的初步搜索

Use Full Tier When:

适合使用完整版的场景:

  • Need reviews/ratings details
  • Need atmosphere info (accessibility, etc.)
  • Final decision-making
  • 需要评论/评分详情
  • 需要氛围信息(无障碍设施等)
  • 最终决策阶段

Efficient Patterns

高效使用模式

  1. Search partial, detail full:
    • Text search (partial) to find places
    • Place details (full) for the one you care about
  2. Batch searches:
    • Combine filters to reduce calls
    • Use
      maxResultCount
      to limit results
  3. Cache place IDs:
    • Place IDs are stable
    • Re-fetch details only when needed
  1. 基础版搜索,完整版查详情:
    • 使用文本搜索(基础版)查找地点
    • 对关注的地点使用地点详情(完整版)
  2. 批量搜索:
    • 组合筛选条件以减少调用次数
    • 使用
      maxResultCount
      限制结果数量
  3. 缓存地点ID:
    • 地点ID是稳定的
    • 仅在需要时重新获取详情

Response Data

响应数据

Partial Tier Fields

基础版字段

  • name
    - Place name
  • formattedAddress
    - Full address
  • location
    - Lat/lng coordinates
  • rating
    - Average rating (1-5)
  • userRatingCount
    - Number of ratings
  • types
    - Place type categories
  • businessStatus
    - OPERATIONAL, CLOSED, etc.
  • regularOpeningHours
    - Hours of operation
  • nationalPhoneNumber
    - Phone number
  • websiteUri
    - Website URL
  • name
    - 地点名称
  • formattedAddress
    - 完整地址
  • location
    - 经纬度坐标
  • rating
    - 平均评分(1-5)
  • userRatingCount
    - 评分数量
  • types
    - 地点类型分类
  • businessStatus
    - 营业状态(运营中、已关闭等)
  • regularOpeningHours
    - 营业时间
  • nationalPhoneNumber
    - 电话号码
  • websiteUri
    - 官网URL

Full Tier Additional Fields

完整版额外字段

  • reviews
    - User reviews with text and ratings
  • priceLevel
    - $ to $$$$
  • accessibilityOptions
    - Wheelchair accessible, etc.
  • parkingOptions
    - Parking availability
  • paymentOptions
    - Accepted payment methods
  • photos
    - Photo references
  • reviews
    - 包含文本和评分的用户评论
  • priceLevel
    - $到$$$$
  • accessibilityOptions
    - 轮椅通道等无障碍设施
  • parkingOptions
    - 停车情况
  • paymentOptions
    - 支持的支付方式
  • photos
    - 照片引用