local-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLocal Search with Google Maps
基于Google Maps的本地搜索
Access Google Maps Places API through x402-protected endpoints.
通过受x402保护的端点访问Google Maps Places API。
Setup
设置
See rules/getting-started.md for installation and wallet setup.
查看rules/getting-started.md了解安装和钱包设置方法。
Quick Reference
快速参考
| Task | Endpoint | Price | Data Included |
|---|---|---|---|
| Text search (basic) | | $0.02 | Name, address, rating |
| Text search (full) | | $0.08 | + reviews, atmosphere |
| Nearby search (basic) | | $0.02 | Name, address, rating |
| Nearby search (full) | | $0.08 | + reviews, atmosphere |
| Place details (basic) | | $0.02 | Core info |
| Place details (full) | | $0.05 | All fields |
See rules/partial-vs-full.md for tier selection guidance.
| 任务 | 端点 | 价格 | 包含数据 |
|---|---|---|---|
| 文本搜索(基础版) | | $0.02 | 名称、地址、评分 |
| 文本搜索(完整版) | | $0.08 | + 评论、氛围信息 |
| 附近搜索(基础版) | | $0.02 | 名称、地址、评分 |
| 附近搜索(完整版) | | $0.08 | + 评论、氛围信息 |
| 地点详情(基础版) | | $0.02 | 核心信息 |
| 地点详情(完整版) | | $0.05 | 所有字段 |
查看rules/partial-vs-full.md了解版本选择指南。
Text Search
文本搜索
Search for places by text query:
bash
npx agentcash fetch https://stableenrich.dev/api/google-maps/text-search/partial -m POST -b '{"textQuery": "coffee shops in downtown Seattle"}'Parameters:
- - Search query (required)
textQuery - - Prefer results near a location
locationBias - - Minimum rating filter (1-5)
minRating - - Only open places
openNow - - Limit results (default: 20)
maxResultCount
Full tier adds: reviews, atmosphere data, photos, price level.
通过文本查询搜索地点:
bash
npx agentcash fetch https://stableenrich.dev/api/google-maps/text-search/partial -m POST -b '{"textQuery": "coffee shops in downtown Seattle"}'参数:
- - 搜索查询(必填)
textQuery - - 优先返回指定地点附近的结果
locationBias - - 最低评分筛选(1-5)
minRating - - 仅返回当前营业的地点
openNow - - 结果数量限制(默认:20)
maxResultCount
完整版额外内容: 评论、氛围数据、照片、价格等级。
Nearby Search
附近搜索
Search for places near a location:
bash
npx agentcash fetch https://stableenrich.dev/api/google-maps/nearby-search/partial -m POST -b '{
"locationRestriction": {
"circle": {
"center": {"latitude": 47.6062, "longitude": -122.3321},
"radius": 1000
}
},
"includedTypes": ["restaurant", "cafe"]
}'Parameters:
- - Circle with center (lat/lng) and radius in meters
locationRestriction - - Place types to include
includedTypes - - Place types to exclude
excludedTypes - - Minimum rating
minRating - - Only open places
openNow
搜索指定地点附近的场所:
bash
npx agentcash fetch https://stableenrich.dev/api/google-maps/nearby-search/partial -m POST -b '{
"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:
bash
npx agentcash fetch https://stableenrich.dev/api/google-maps/place-details/partial -m POST -b '{"placeId": "ChIJN1t_tDeuEmsRUsoyG83frY4"}'Input:
- - Google Place ID (from search results)
placeId
Partial returns: Name, address, phone, website, hours, rating, types.
Full returns: + reviews, atmosphere (wheelchair access, pets allowed), photos, price level.
获取特定场所的详细信息:
bash
npx agentcash fetch https://stableenrich.dev/api/google-maps/place-details/partial -m POST -b '{"placeId": "ChIJN1t_tDeuEmsRUsoyG83frY4"}'输入:
- - Google地点ID(来自搜索结果)
placeId
基础版返回内容: 名称、地址、电话、官网、营业时间、评分、场所类型。
完整版返回内容: + 评论、氛围信息(轮椅通道、允许宠物等)、照片、价格等级。
Common Place Types
常见场所类型
Use these with / :
includedTypesexcludedTypesFood & 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
可在 / 中使用以下类型:
includedTypesexcludedTypes餐饮: 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
查找区域内的商家
- (Optional) Check balance:
npx agentcash wallet info - Text search (partial) to find options
- Review results and select top picks
- Get full details for selected places
bash
npx agentcash fetch https://stableenrich.dev/api/google-maps/text-search/partial -m POST -b '{"textQuery": "Italian restaurants downtown Portland"}'bash
npx agentcash fetch https://stableenrich.dev/api/google-maps/place-details/full -m POST -b '{"placeId": "ChIJ..."}'- (可选)查看余额:
npx agentcash wallet info - 使用文本搜索(基础版)查找可选场所
- 查看结果并选择优先选项
- 获取选中场所的完整详情
bash
npx agentcash fetch https://stableenrich.dev/api/google-maps/text-search/partial -m POST -b '{"textQuery": "Italian restaurants downtown Portland"}'bash
npx agentcash fetch https://stableenrich.dev/api/google-maps/place-details/full -m POST -b '{"placeId": "ChIJ..."}'Nearby Search with Filters
带筛选条件的附近搜索
- Get coordinates for the area
- Search with location restriction and filters
- Present sorted results
bash
npx agentcash fetch https://stableenrich.dev/api/google-maps/nearby-search/partial -m POST -b '{
"locationRestriction": {
"circle": {
"center": {"latitude": 40.7128, "longitude": -74.0060},
"radius": 500
}
},
"includedTypes": ["restaurant"],
"minRating": 4.0,
"openNow": true
}'- 获取目标区域的坐标
- 使用位置限制和筛选条件进行搜索
- 展示排序后的结果
bash
npx agentcash fetch https://stableenrich.dev/api/google-maps/nearby-search/partial -m POST -b '{
"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
bash
npx agentcash fetch https://stableenrich.dev/api/google-maps/place-details/full -m POST -b '{"placeId": "place_id_here"}'- 搜索获取地点ID
- 为每个候选场所获取完整详情
- 对比评分、评论和设施
bash
npx agentcash fetch https://stableenrich.dev/api/google-maps/place-details/full -m POST -b '{"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
高效使用模式
-
Search partial, detail full:
- Text search (partial) to find places
- Place details (full) for the one you care about
-
Batch searches:
- Combine filters to reduce calls
- Use to limit results
maxResultCount
-
Cache place IDs:
- Place IDs are stable
- Re-fetch details only when needed
-
基础搜索+完整详情:
- 使用文本搜索(基础版)查找场所
- 为关注的场所调用地点详情(完整版)
-
批量搜索:
- 组合筛选条件以减少调用次数
- 使用限制结果数量
maxResultCount
-
缓存地点ID:
- 地点ID是稳定不变的
- 仅在需要时重新获取详情
Response Data
响应数据
Partial Tier Fields
基础版字段
- - Place name
name - - Full address
formattedAddress - - Lat/lng coordinates
location - - Average rating (1-5)
rating - - Number of ratings
userRatingCount - - Place type categories
types - - OPERATIONAL, CLOSED, etc.
businessStatus - - Hours of operation
regularOpeningHours - - Phone number
nationalPhoneNumber - - Website URL
websiteUri
- - 场所名称
name - - 完整地址
formattedAddress - - 经纬度坐标
location - - 平均评分(1-5)
rating - - 评分数量
userRatingCount - - 场所类型分类
types - - 营业状态(运营中、已关闭等)
businessStatus - - 营业时间
regularOpeningHours - - 电话号码
nationalPhoneNumber - - 官网链接
websiteUri
Full Tier Additional Fields
完整版额外字段
- - User reviews with text and ratings
reviews - - $ to $$$$
priceLevel - - Wheelchair accessible, etc.
accessibilityOptions - - Parking availability
parkingOptions - - Accepted payment methods
paymentOptions - - Photo references
photos
- - 包含文本和评分的用户评论
reviews - - $ 到 $$$$
priceLevel - - 轮椅通道等无障碍设施
accessibilityOptions - - 停车设施情况
parkingOptions - - 支持的支付方式
paymentOptions - - 照片引用
photos