Is it possible to get the number of Facebook Likes made on any url, even if I don't own that url's domain?
-
Possible duplicate of [Graph API how get facebook page members/likes](https://stackoverflow.com/questions/14632000/graph-api-how-get-facebook-page-members-likes) – phuclv Aug 04 '17 at 02:52
3 Answers
Yes, you can query specific URLs:

- 1
- 1

- 1,453
- 17
- 22
-
1It seems to be largely under reporting various websites that I have tested against. Any ideas? Thanks. – Kenny Cason Oct 16 '13 at 23:27
-
With Facebook's penchant for continually switching things up, I'd be wary of a three year old answer--even if it is mine. Have you tried looking at what the Graph API is returning for your sites? – Mark Phillip Oct 17 '13 at 13:53
-
The count that a like button shows isn't just the value of like_count, but the sum of share_count, like_count and comment_count, which can be read from total_count. There's a website where you can check this for any given url: http://saqoo.sh/a/labs/fblinkstats/ – alpha pecap Dec 08 '14 at 19:10
-
1@alphapecap the URL you provided does not work - and it doesn't help as he asks for a api according to his tags. – flob Nov 02 '15 at 15:04
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

- 151
- 1
- 4
-
Do you know if there is a way to get the likes in this format 10000 = 10K ? – Steven Barragán Jan 22 '15 at 23:00
-
@StevenBarragán: Facebook API will not return the data in that format, you can convert that yourself – Qarib Haider May 02 '16 at 11:47
-
2Update: **fields=likes** does not apply for API 2.6, it has been changed to **fields=fan_count** – Qarib Haider May 02 '16 at 11:49
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

- 12,641
- 2
- 26
- 39
-
I need the number of likes for any web pages outside Facebook, not just Facebook pages. The "search" API call didn't return any results when I searched for URLs. – Amos Dec 26 '10 at 14:16
-
An old post, but most people use "likes" for their facebook pages, even if the like box is on a specific webpage. – Kevin Aug 31 '12 at 20:24