1

我正在创建移动应用程序,并且我有一个众包数据库,每个地方(酒吧、咖啡馆、餐厅等)和地址的大致纬度/经度。

我需要做的进一步 - 将这个地方与适当的 FB 页面联系起来(或者至少尝试这样做)。但我找不到任何可用的公共 API 可以让我这样做。谁能指出我正确的方向或提出解决方法?

4

1 回答 1

3

You need to use the Facebook Graph search functionality with 'type' set as 'place' and 'center' containing the latitude/longitude values. E.g.: https://graph.facebook.com/search?type=place&center=37.76,-122.427&distance=1000&access_token=insert access token

This will provide you a list of nearby locations. E.g: {

   "data": [
      {
         "name": "Dolores Park",
         "location": {
            "street": "18th St & Dolores St",
            "city": "San Francisco",
            "state": "CA",
            "country": "United States",
            "zip": "94110",
            "latitude": 37.75956104478,
            "longitude": -122.42694721103
         },
         "category": "Landmark",
         "id": "105687759464007"
      }
      ....

Once you have the id, you can then use it to get more information (e.g. the page url) via the Graph API. E.g.: http://graph.facebook.com/105687759464007

于 2012-09-10T19:19:17.330 回答