経度と緯度を指定し、ステータスを更新する時に使用できるplace_idを最大20個まで検索できます。
This request is an informative call and will deliver generalized results about geography.
https://api.twitter.com/1.1/geo/reverse_geocode.json
検索する周辺の経度。値が-90.0 から +90.0 の範囲でないと(北の方角が正)、このパラメータは無視されます。
対応するlongパラメータが設定されていない場合も無視されます。
サンプル値: 37.7821120598956
検索する周辺の緯度。-180.0 から +180.0 の範囲が設定できます(東の方角が正)。この範囲外の場合、 geo_enabledが無効になっている場合、対応するlatパラメータが設定されていない場合、このパラメータは無視されます。
サンプル値: -122.400612831116
検索する “範囲(region)”のヒント。
単に数字だけを設定した場合、メートル単位の半径として使われます。末尾にft の文字列を付けると、単位をフィートに変更することができます。
設定しなかった場合、0mを設定したと見なされます。 If coming from a device, in practice, this value is whatever accuracy the device has measuring its location (whether it be coming from a GPS, WiFi triangulation, etc.).
サンプル値: 5ft
これは取得する場所タイプの最少粒度で、poi, neighborhood, city, admin, countryのうちどれかを使用します。
リクエストでgranularity を設定しなかった場合は、neighborhood が設定されたと見なされます。
例えば、今パラメータにcityを設定すると、 cityやadmin や countryのタイプを持っている場所を検索します。
サンプル値: city
取得する検索結果数のヒント。常にここで設定したmax_resultsと同じ数の結果が取得できるとは限りませんが、その代わり同等数の “(近隣)nearby”の検索結果を取得します。 理想としては、ユーザーに表示したいだけの場所情報数を設定します。
サンプル値: 3
これを設定すると、応答には指定した名前のコールバックを持つ JSONP 形式が使われます。
ログイン して登録アプリケーションの一覧を参照してください。
GET
https://api.twitter.com/1.1/geo/reverse_geocode.json?lat=37.76893497&long=-122.42284884
{
"query": {
"params": {
"accuracy": 0,
"coordinates": {
"coordinates": [
-122.42284884,
37.76893497
],
"type": "Point"
},
"granularity": "neighborhood"
},
"type": "reverse_geocode",
"url": "https://api.twitter.com/1.1/geo/reverse_geocode.json?accuracy=0&granularity=neighborhood&lat=37.76893497&long=-122.42284884"
},
"result": {
"places": [
{
"attributes": {},
"bounding_box": {
"coordinates": [
[
[
-122.42676492,
37.75983003
],
[
-122.420736,
37.75983003
],
[
-122.420736,
37.77226299
],
[
-122.42676492,
37.77226299
]
]
],
"type": "Polygon"
},
"contained_within": [
{
"attributes": {},
"bounding_box": {
"coordinates": [
[
[
-122.51368188,
37.70813196
],
[
-122.35845384,
37.70813196
],
[
-122.35845384,
37.83245301
],
[
-122.51368188,
37.83245301
]
]
],
"type": "Polygon"
},
"country": "United States",
"country_code": "US",
"full_name": "San Francisco, CA",
"id": "5a110d312052166f",
"name": "San Francisco",
"place_type": "city",
"url": "https://api.twitter.com/1.1/geo/id/5a110d312052166f.json"
}
],
"country": "United States",
"country_code": "US",
"full_name": "Mission Dolores, San Francisco",
"id": "cf7afb4ee6011bca",
"name": "Mission Dolores",
"place_type": "neighborhood",
"url": "https://api.twitter.com/1.1/geo/id/cf7afb4ee6011bca.json"
},
{
"attributes": {},
"bounding_box": {
"coordinates": [
[
[
-122.51368188,
37.70813196
],
[
-122.35845384,
37.70813196
],
[
-122.35845384,
37.83245301
],
[
-122.51368188,
37.83245301
]
]
],
"type": "Polygon"
},
"contained_within": [
{
"attributes": {},
"bounding_box": {
"coordinates": [
[
[
-124.482003,
32.528832
],
[
-114.131211,
32.528832
],
[
-114.131211,
42.009517
],
[
-124.482003,
42.009517
]
]
],
"type": "Polygon"
},
"country": "United States",
"country_code": "US",
"full_name": "California, US",
"id": "fbd6d2f5a4e4a15e",
"name": "California",
"place_type": "admin",
"url": "https://api.twitter.com/1.1/geo/id/fbd6d2f5a4e4a15e.json"
}
],
"country": "United States",
"country_code": "US",
"full_name": "San Francisco, CA",
"id": "5a110d312052166f",
"name": "San Francisco",
"place_type": "city",
"url": "https://api.twitter.com/1.1/geo/id/5a110d312052166f.json"
},
{
"attributes": {},
"bounding_box": {
"coordinates": [
[
[
-124.482003,
32.528832
],
[
-114.131211,
32.528832
],
[
-114.131211,
42.009517
],
[
-124.482003,
42.009517
]
]
],
"type": "Polygon"
},
"contained_within": [
{
"attributes": {},
"bounding_box": null,
"country": "United States",
"country_code": "US",
"full_name": "United States",
"id": "96683cc9126741d1",
"name": "United States",
"place_type": "country",
"url": "https://api.twitter.com/1.1/geo/id/96683cc9126741d1.json"
}
],
"country": "United States",
"country_code": "US",
"full_name": "California, US",
"id": "fbd6d2f5a4e4a15e",
"name": "California",
"place_type": "admin",
"url": "https://api.twitter.com/1.1/geo/id/fbd6d2f5a4e4a15e.json"
},
{
"attributes": {},
"bounding_box": null,
"contained_within": [],
"country": "United States",
"country_code": "US",
"full_name": "United States",
"id": "96683cc9126741d1",
"name": "United States",
"place_type": "country",
"url": "https://api.twitter.com/1.1/geo/id/96683cc9126741d1.json"
}
]
}
}