local-search について
x402で保護されたエンドポイントを通じてGoogle Maps Placesを検索するスキルです。テキスト・周辺検索、場所の詳細、空撮ビュー、屋上太陽光データを扱います。
主な機能
- 01テキスト・周辺検索
- 02場所の基本・詳細情報の取得
- 03空撮動画の検索と生成
- 04屋上太陽光の分析と画像
- 05検索フィルターとページネーション
活用シーン
- 01都市や指定範囲内の店舗探し
- 02レビューや設備による候補地の比較
- 03建物の太陽光発電の可能性確認
- 04住所の空撮ビュー取得
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ merit-systems/ agentcash-skills --skill local-searchインストール後、Claude Code で/local-searchを入力して読み込まれたか確認します。
同梱ファイルrules/getting-started.mdrules/partial-vs-full.md
詳細
Google Maps でローカル検索
x402 で保護されたエンドポイントを通じて、Google Maps Places API にアクセスします。
セットアップ
インストールとウォレットの設定については、rules/getting-started.md を参照してください。
クイックリファレンス
| タスク | エンドポイント | 価格 | 含まれるデータ |
|---|---|---|---|
| テキスト検索(基本) | https://stableenrich.dev/api/google-maps/text-search/partial | $0.02 | 名前、住所、評価 |
| テキスト検索(全項目) | https://stableenrich.dev/api/google-maps/text-search/full | $0.08 | + レビュー、雰囲気 |
| 周辺検索(基本) | https://stableenrich.dev/api/google-maps/nearby-search/partial | $0.02 | 名前、住所、評価 |
| 周辺検索(全項目) | https://stableenrich.dev/api/google-maps/nearby-search/full | $0.08 | + レビュー、雰囲気 |
| 場所の詳細(基本) | https://stableenrich.dev/api/google-maps/place-details/partial | $0.02 | 基本情報 |
| 場所の詳細(全項目) | https://stableenrich.dev/api/google-maps/place-details/full | $0.05 | すべてのフィールド |
| 空撮ビューの検索(GET) | https://stableenrich.dev/api/google-maps/aerial-view/lookup-video | $0.01 | 空撮動画の URI + メタデータ |
| 空撮ビューのレンダリング(POST) | https://stableenrich.dev/api/google-maps/aerial-view/render-video | $0.01 | 新しい空撮動画をレンダリング |
| 太陽光発電の建物インサイト(GET) | https://stableenrich.dev/api/google-maps/solar/building-insights | $0.02 | 屋根/太陽光発電の可能性、imageryDate |
| 太陽光発電データレイヤー(GET) | https://stableenrich.dev/api/google-maps/solar/data-layers | $0.08 | GeoTIFF の URL(rgb、dsm、flux) |
| 太陽光発電 RGB 画像(GET) | https://stableenrich.dev/api/google-maps/solar/rgb-image | $0.05 | PNG/JPEG としてレンダリングされた GeoTIFF レイヤー |
ティアの選択については、rules/partial-vs-full.md を参照してください。
テキスト検索
テキストクエリで場所を検索します。
npx agentcash@latest fetch https://stableenrich.dev/api/google-maps/text-search/partial -m POST -b '{"textQuery": "coffee shops in downtown Seattle"}'
パラメーター:
textQuery- 検索クエリ(必須)locationBias- 指定した場所の近くの結果を優先します(centerの緯度/経度と、メートル単位のradiusを含むcircle。最大 50000)includedType- 絞り込みに使用する Google Places のタイプを 1 つ指定しますminRating- 評価の最低値による絞り込み(0-5)openNow- 営業中の場所のみmaxResultCount- 1 ページあたりの結果数、1-5(デフォルト:5)priceLevels- 価格帯による絞り込み(例:PRICE_LEVEL_INEXPENSIVE)pageToken- 前回のレスポンスから取得したページネーションカーソル
ページネーション: 結果がまだある場合、レスポンスには nextPageToken が含まれます。次のページを取得するには、元のリクエストボディ全体(textQuery を含む)を再送し、コピーした pageToken をそのまま追加します。pageToken は、それを生成した検索でのみ有効です。
全項目ティアでは、レビュー、雰囲気データ、写真、価格帯が追加されます。
周辺検索
場所の近くにある場所を検索します。
npx agentcash@latest 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- 中心点(緯度/経度)とメートル単位の半径を含む円、最大 50000(必須)includedTypes- 含める場所のタイプ(公式の Google Places タイプのみ。例:restaurant。自然言語のカテゴリにはテキスト検索を使用してください)excludedTypes- 除外する場所のタイプmaxResultCount- 1 ページあたりの結果数、1-5(デフォルト:5)rankPreference-POPULARITY(デフォルト)またはDISTANCE
場所の詳細
特定の場所の詳細情報を取得します。
npx agentcash@latest fetch "https://stableenrich.dev/api/google-maps/place-details/partial?placeId=ChIJN1t_tDeuEmsRUsoyG83frY4"
入力:
placeId- Google Place ID(検索結果から取得)
部分データで返される項目: 名前、住所、電話番号、ウェブサイト、営業時間、評価、タイプ。
全項目で返される項目: + レビュー、雰囲気(車椅子でのアクセス、ペットの同伴可否)、写真、価格帯。
空撮ビュー
住所のシネマティックな空撮動画を取得します。まず既存の動画を検索し($0.01)、見つからない場合はレンダリングをリクエストします($0.01)。
npx agentcash@latest fetch "https://stableenrich.dev/api/google-maps/aerial-view/lookup-video?address=500%20W%202nd%20St%2C%20Austin%2C%20TX"
npx agentcash@latest fetch https://stableenrich.dev/api/google-maps/aerial-view/render-video -m POST -b '{"address": "500 W 2nd St, Austin, TX"}'
検索の入力: address または videoId(どちらか必須)。
レンダリングの入力: address(必須)。
返される項目: state、videoId、動画の uris(横向き/縦向き/サムネイル)、撮影メタデータ。レンダリングは非同期です。state が active になるまで lookup-video をポーリングしてください。
Solar
ある地点の住宅用太陽光発電に関する情報と画像を取得します:
npx agentcash@latest fetch "https://stableenrich.dev/api/google-maps/solar/building-insights?latitude=37.4450&longitude=-122.1390"
建物情報($0.02): latitude、longitude(必須)、requiredQuality(LOW/MEDIUM/HIGH、デフォルトはHIGH)。最も近い建物の屋根や太陽光発電の可能性、およびimageryDateを返します。
データレイヤー($0.08): latitude、longitude(必須)、radiusMeters(デフォルトは50、最大175)、view、requiredQuality、pixelSizeMeters。imageryDateとともにGeoTIFFのURL(rgbUrl、dsmUrl、flux/shade/maskのURL)を返します。
RGB画像($0.05): Solar GeoTIFFレイヤーをPNG/JPEGとしてレンダリングします。GeoTIFFのid、またはlatitude/longitudeのいずれかと、layer(rgb、dsm、annualFlux、monthlyFlux、hourlyShade、mask)、radiusMeters(デフォルトは30、最大100)、flux/shadeバンド用のmonth/hour、format、scale、crop、qualityを指定します。公開画像URLを含むJSONを返します。monthlyFlux:1か月分、または4x3のグリッド。hourlyShade:1時間分、または6x4のグリッド。
npx agentcash@latest fetch "https://stableenrich.dev/api/google-maps/solar/rgb-image?latitude=37.4450&longitude=-122.1390&layer=annualFlux"
よく使われる場所の種類
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
ワークフロー
エリア内の事業者を検索する
- (任意)残高を確認する:
npx agentcash@latest balance - 部分検索で選択肢を探す
- 検索結果を確認して候補を選ぶ
- 選択した場所の詳細情報を取得する
npx agentcash@latest fetch https://stableenrich.dev/api/google-maps/text-search/partial -m POST -b '{"textQuery": "Italian restaurants downtown Portland"}'
npx agentcash@latest fetch "https://stableenrich.dev/api/google-maps/place-details/full?placeId=ChIJ..."
フィルターを使って周辺を検索する
- エリアの座標を取得する
- 場所の制限とフィルターを指定して検索する
- 並べ替えた検索結果を提示する
npx agentcash@latest 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"],
"rankPreference": "DISTANCE"
}'
レビューで場所を比較する
- 検索して場所IDを取得する
- 候補ごとの詳細情報を取得する
- 評価、レビュー、設備を比較する
npx agentcash@latest fetch "https://stableenrich.dev/api/google-maps/place-details/full?placeId=place_id_here"
コストの最適化
部分ティアを使用する場合:
- 名前、住所、基本情報だけが必要な場合
- 選択肢を閲覧・検索する場合
- 詳細を調べる前の初回検索
フルティアを使用する場合:
- レビューや評価の詳細が必要な場合
- アクセシビリティなど、雰囲気に関する情報が必要な場合
- 最終的な意思決定を行う場合
効率的なパターン
-
部分検索を行い、詳細をフルティアで取得する:
- 部分検索で場所を探す
- 詳細を知りたい場所の詳細情報をフルティアで取得する
-
検索をまとめて行う:
- フィルターを組み合わせて呼び出し回数を減らす
maxResultCountを使用して結果数を制限する
-
場所IDをキャッシュする:
- 場所IDは安定しています
- 必要な場合にのみ詳細情報を再取得する
レスポンスデータ
部分ティアのフィールド
name- 場所名formattedAddress- 住所全体location- 緯度・経度の座標rating- 平均評価(1~5)userRatingCount- 評価数types- 場所の種類businessStatus- OPERATIONAL、CLOSEDなどregularOpeningHours- 営業時間nationalPhoneNumber- 電話番号websiteUri- ウェブサイトのURL
フルティアで追加されるフィールド
reviews- 評価付きのユーザーレビューpriceLevel- $~$$$$accessibilityOptions- 車椅子での利用可否などparkingOptions- 駐車場の有無paymentOptions- 利用可能な支払い方法photos- 写真の参照情報