Facebook API:如何获取组成员的数量 [英] Facebook API: How to get count of group members
问题描述
我正在使用PHP客户端和FQL开发fb应用程序,看起来fb api不支持此功能.您最多可以使用FQL获得500个随机成员.但是,如果组中的成员超过500个,则无法获取成员总数. 我只需要数字,不用关心会员的详细信息.
Im working on fb app using PHP client and FQL.Looks like that fb api doesnt support this. You can get max random 500 members with FQL. But when group has more than 500 members there is no way how to get total count of members. I need only number dont care about member details.
任何人都可以帮助我吗?
Anyone can help me please?
推荐答案
您可以使用summary参数,该参数将返回total_count值.
You can use the summary parameter which will return a total_count value.
/v2.11/{GROUP_ID}?fields=members.limit(0).summary(true)
在搜索群组时也可以使用:
It also works when searching for groups:
/v2.11/search?q=stackoverflow&type=group&fields=id,name,members.limit(0).summary(true)
{
"data": [
{
"id": "667082816766625",
"name": "Web Development Insiders",
"members": {
"data": [
],
"summary": {
"total_count": 2087
}
}
},
{
"id": "319262381492750",
"name": "WEB Developers India",
"members": {
"data": [
],
"summary": {
"total_count": 10240
}
}
}...
]
}
这篇关于Facebook API:如何获取组成员的数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!