0

特定の Facebook アプリケーションのファンの数を取得する必要があります。Facebook Graph APIのGraffitiWall アプリケーションの例を使用すると、そのページには約 120 万人のファンの総数が表示されます。ただし、Graph API はfan_count を返しません

{
 "id": "2439131959",
 "name": "Graffiti",
 "description": "Graffiti lets you draw on your friends' profiles.",
 "category": "Just For Fun",
 "link": "http://www.facebook.com/graffitiwall"
}

graffitiwall アプリケーションの「いいね」は、ページの「いいね」ですか、それともアプリケーションの「いいね」ですか? ページの場合、アプリケーション ID からページ ID をプログラムで特定するにはどうすればよいですか? アプリケーションの場合、そのファン数を取得するにはどうすればよいですか? そのアプリケーションの管理者になる必要がありますか? これは Facebook Insights を使用する場合にのみ利用できますか?

念のため、 application ID も指定してみましたが、上記のブロックも返されます。アプリケーション ページの URL を使用すると、共有値が返されます。

{
 "id": "http://www.facebook.com/graffitiwall",
 "shares": 19
}

おそらく、API ドキュメントまたはGraph API フォーラムで何かが欠けているのでしょうが、どちらの場所でも答えを見つけることができませんでした。

4

2 に答える 2

2

You can get number of fans by running FQL on page table:

FB.Data.query("select fan_count from page where page_id = 2439131959");

(fan_count is undocumented field btw, either it is deprecated or they just forgot to mention it in their docs which wouldn't surprise me much)

Not sure if you were asking about likes as well, but just in case here is an example how to get number of likes by url:

FB.Data.query('select like_count from link_stat where url="http://www.facebook.com/graffitiwall"');
于 2010-07-12T19:50:27.827 に答える
0

また、REST API を使用して fan_count を取得することもできます。

% wget https://api.facebook.com/method/pages.getinfo?access_token=[...]&fields=fan_count,name&page_ids=2439131959&format=json
[{"page_id":2439131959,"name":"Graffiti","fan_count":1263811}]

Facebook 開発者 wikiで説明されているとおりです。

于 2010-07-15T19:47:57.970 に答える