在批量请求中获取Facebook用户信息?

Ann*_*Fr. 1 facebook facebook-graph-api

我可以使用以下内容https://graph.facebook.com/user_id来获取用户的数据(如name,gender等).

有没有办法可以做类似的事情 https://graph.facebook.com/user1_id, user2_id, user3_id, ...?所以我会在一个请求中获取所有数据?

Bha*_*til 5

是的,我尝试了以下行,它正在运行.

https://graph.facebook.com/?ids=19292868552,bharatpatil007,220439

它正在发挥作用.结果如下

{
   "19292868552": {
      "id": "19292868552",
      "name": "Facebook Platform",
      "picture": "http://profile.cc.fbcdn.net/hprofile-cc-ash2/211033_19292868552_7506301_s.jpg",
      "link": "http://www.facebook.com/platform",
      "likes": 2479998,
      "category": "Product/service",
      "website": "http://developers.facebook.com",
      "username": "platform",
      "founded": "May 2007",
      "company_overview": "Facebook Platform enables anyone to build social apps on Facebook and the web.",
      "mission": "To make the web more open and social."
   },
   "220439": {
      "id": "220439",
      "name": "Bret Taylor",
      "first_name": "Bret",
      "last_name": "Taylor",
      "link": "http://www.facebook.com/btaylor",
      "username": "btaylor",
      "gender": "male",
      "locale": "en_US"
   },
   "bharatpatil007": {
      "id": "793619474",
      "name": "Bharat Patil",
      "first_name": "Bharat",
      "last_name": "Patil",
      "link": "http://www.facebook.com/bharatpatil007",
      "username": "bharatpatil007",
      "gender": "male",
      "locale": "en_US"
   }
}
Run Code Online (Sandbox Code Playgroud)