是否有可能从Facebook的Graph API获取用户的国家代码?

时间:2012-03-22 09:18:40

标签: facebook facebook-graph-api facebook-fql country-codes

当我试图通过FQL获取用户的当前位置时,Graph API返回了类似的内容;

{
  "data": [
    {
      "current_location": {
        "city": "Izmir",
        "state": "Izmir",
        "country": "Turkey",
        "zip": "",
        "id": 107968765903327,
        "name": "İzmir, Turkey"
      }
    }
  ]
}

使用上面的图表ID,我检查了https://graph.facebook.com/107968765903327的位置信息,这次我获得了有关该城市的更多数据;

{
   "id": "107968765903327",
   "name": "\u0130zmir, Turkey",
   "link": "http://www.facebook.com/pages/\u0025C4\u0025B0zmir-Turkey/107968765903327",
   "likes": 178460,
   "category": "City",
   "is_published": true,
   "is_community_page": true,
   "description": "\u003Cp>\u003Cb>Izmir\u003C/b> is a large ...",
   "location": {
      "latitude": 38.4072,
      "longitude": 27.1503
   },
   "checkins": 9059,
   "talking_about_count": 238710
}

但是,如您所见,国家/地区代码没有机会使用这些选项。还有其他建议吗?

1 个答案:

答案 0 :(得分:4)

反向地理编码可以提供帮助 见https://developers.google.com/maps/documentation/geocoding/