地名の候補検索
GET
/places/autocomplete入力中の文字列から地名の候補を返します。Google Places API をサーバー側で呼ぶため、クライアントに API キーを持たせる必要はありません。プロフィールの居住地入力に使います。
| 認証 | 要ログイン |
|---|
クエリパラメータ
inputstring必須入力中の文字列。空のときは候補なしを返します。
languagestring候補の言語(ja | en、既定 ja)。
granularitystring候補を絞る単位をカンマ区切りで指定(country,state,city)。省略すると建物・住所まで含みます。
レスポンス
| フィールド | 型 | 説明 |
|---|---|---|
predictions | object[] | { placeId, text, secondaryText } の配列。 |
リクエスト
curl https://api.4s.link/places/autocomplete \-H "Authorization: Bearer 4s_at_..."
レスポンス例
{"predictions": [{"placeId": "ChIJ...","text": "東京都港区","secondaryText": "日本"}]}