我正在使用图形API (PHP )来获取特定帖子的共享、喜欢和评论的数量。
现在,我发送了3个api请求来获取这些数字:
$post = $facebook->api([post_id_here] . '?summary=1', 'get'); // from this I can get number of shares
$likes = $facebook->api([post_id_here] . '/likes?summary=1', 'get');
$comments = $facebook->api([post_id_here] . '/comments?summary=1', 'get');我的问题是,是否有办法通过只发送一个api请求来获取这些信息?
我需要减少api调用的数量,因为Facebook对它有限制,而且我每天更新的数据库中的帖子越来越多。
批调用不是我所需要的,因为它也是单独的请求。
谢谢
发布于 2014-04-06 18:53:51
是的,你可以使用- fields。
$facebook->api([post_id_here] . '{post-id}?fields=shares,likes,comments', 'get');https://stackoverflow.com/questions/22660685
复制相似问题