Can I get the number of Facebook Likes a page that is not on my domain received?

Deadly 提交于 2019-11-29 02:21:58

问题


Is it possible to get the number of Facebook Likes made on any url, even if I don't own that url's domain?


回答1:


Yes, you can query specific URLs:

https://api.facebook.com/method/fql.query?query=select%20like_count%20from%20link_stat%20where%20url=%27https://stackoverflow.com/%27&format=json




回答2:


But ofcourse you can sir:

Page likes

If it's a page you're wanting the amount of likes of, try such a thing as this:

http://graph.facebook.com/[Page name or ID here without the brackets]?fields=likes

Example:

http://graph.facebook.com/Facebook?fields=likes

Result:

{
    "likes": 90064323,
    "id": "20531316728"
}

Specific URL likes

If it's a specific URL you want to get the likes of, try Facebook's FQL. You can query the Facebook databases this way and get some info on URL's, here's an Example:

https://api.facebook.com/method/fql.query?query=select like_count from link_stat where url='https://www.facebook.com/'&format=json

Result:

[{"like_count":1433567}]

The format in which this is returned can either be XML or JSON, where XML is the default. You can chance the format by adding the

&format=json

at the end.

There are multiple fields and tables that can be queried from, you can see all that good stuff in the sources.

Hope this helped some people, cause I was searching quite abit for it.

Have a nice day.

Sources:
Graph API: http://developers.facebook.com/docs/reference/api/
FQL: http://developers.facebook.com/docs/reference/fql




回答3:


You can always try by searching the social graph. For example, the Apple's Facebook page has about 162K likes https://graph.facebook.com/108521342513509

But if you try to get the "likes" number directly, you don't get anything. http://graph.facebook.com/108521342513509/likes

Here is the link to the documentation. You might try use the "search" URL. http://developers.facebook.com/docs/api



来源:https://stackoverflow.com/questions/4510044/can-i-get-the-number-of-facebook-likes-a-page-that-is-not-on-my-domain-received

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!