Often it seems fql number for a given url like, share, comment, total counts seem to be off.
For example this url
http://www.france24.com/en/20140112-reporters-crimean-tatars-unending-exile-identity-ethnic-minority-muslims-central-asia-ukraine
FQL shows:
share_count: 18377
like_count: 16215
comment_count: 8840
total_count: 43432
The graph api shows very different numbers, and if you check facebook widget count on the url itself it has a totally different count.
Anyone knows what is going on and how to get accurate numbers.
When querying link_stat with url you supplied we see the following:
select comment_count, like_count, share_count, total_count
from link_stat where url = 'http://www.france24.com/en/20140112-reporters-crimean-tatars-unending-exile-identity-ethnic-minority-muslims-central-asia-ukraine/'
{
"data": [
{
"comment_count": 10,
"like_count": 55,
"share_count": 18,
"total_count": 83
}
]
}
But when querying link_stat with parent url of site france24.com we see exactly your numbers (weel slightly changed of course, but almost the same). So check you query - maybe you cut the url somehow in you request?
select comment_count, like_count, share_count, total_count
from link_stat where url = 'http://www.france24.com/'
{
"data": [
{
"comment_count": 8840,
"like_count": 16415,
"share_count": 18377,
"total_count": 43632
}
]
}
Perhaps my initial question was not clear, the issue was with 2 forms of the same url returning radically different results in fql, web facebook widget etc. the urls in question are
http://www.france24.com/en/20140112-reporters-crimean-tatars-unending-exile-identity-ethnic-minority-muslims-central-asia-ukraine
and
http://www.france24.com/en/20140112-reporters-crimean-tatars-unending-exile-identity-ethnic-minority-muslims-central-asia-ukraine/
The URLs are identical except the ending /
The facebook sees the url as a string. Is case sensitive and it matters how you pass it for url. So, for facebook, there are really two different urls :/ The same happens if someone writes Ukraine with "U".
http://www.france24.com/en/20140112-reporters-crimean-tatars-unending-exile-identity-ethnic-minority-muslims-central-asia-Ukraine
Related
Given a particular URL, how can I get the Facebook Share count for it?
There is one way to get the count, i know that platforms like sharedcount.com are using this:
https://api.facebook.com/method/links.getStats?urls={your-url}/&format=json
I highly suggest not using FQL anymore, it is deprecated and no longer available in v2.1+ of the Graph API: https://developers.facebook.com/docs/apps/changelog#v2_1_deprecations
Edit: This is deprecated, but there is another possibility: Get FB likes, shares and comments for a URL using PHP - with no limit
The easiest way to do this is to fire off a request to the Graph API.
The following query will select:
like_count
total_count
share_count
click_count
comment_count
https://graph.facebook.com/fql?q=SELECT%20like_count,%20total_count,%20share_count,%20click_count,%20comment_count%20FROM%20link_stat%20WHERE%20url%20=%20%27http://imdb.com%27
{
"data": [
{
"like_count": 62024,
"total_count": 191031,
"share_count": 93544,
"click_count": 71308,
"comment_count": 35463
}
]
}
Just replace the google.com with whatever URL you want to get the information for.
Facebook LIKE button shows larger amount of likes, than API!!!
I have a link: http://premija.intensa.pro/person/130/ilona_kvelde
When I create Like button on my page, it shows 48 likes at this moment (You can try to enter link in Get Code page: http://developers.facebook.com/docs/reference/plugins/like/)
But, when I execute FQL query, it shows less.
You can try in FQL Explorer
SELECT share_count, like_count, comment_count, total_count
FROM link_stat WHERE url='http://premija.intensa.pro/person/130/ilona_kvelde'
From running this in the explorer:
{
"data": [
{
"share_count": 2,
"like_count": 30,
"comment_count": 0,
"total_count": 32
}
]
}
You're right, there's a difference. There's probably some sort of time-delay, or privacy stuff, not sure. Notice that there's also a difference for running 'http://www.google.com'. But nevertheless if this is an important difference for you then you should file a bug here. Seems to be on a macro-level and thus by design, but its worth a shot.
The problem to solve:
Imagine I have a domain and corresponding web site at http://my-awesome-site
On this site I have 10,000 pages.
Each page has a Facebook Like button.
How do I retrieve the number of likes per page from the Facebook Graph?
It's possible to look up the total number of likes per URL using a simple GET request (examples: google.com, google.com/reader, news.google.com). But is it possible to get a similar list for an entire domain, broken down by page? Something with results like:
{
"id": "http://my-awesome-site/",
"shares": 12345
},
{
"id": "http://my-awesome-site/page1.html",
"shares": 5678
},
....
{
"id": "http://my-awesome-site/page10000.html",
"shares": 9012
}
You can do this also via facebook graph
seperate ids with commas
https://graph.facebook.com/?ids=http://techcrunch.com,http://mashable.com
the result will be a json, shown below
{
"http://mashable.com": {
"id": "http://mashable.com",
"shares": 14436
},
"http://techcrunch.com": {
"id": "http://techcrunch.com",
"shares": 2144
}
}
I think that the best you can do is (using the link_stat table):
SELECT url, share_count
FROM link_stat
WHERE url IN ("http://my-awesome-site/", "http://my-awesome-site/page1.html"...)
But if you have 10,000 pages you'll have to break it into multiple requests.
You can however use the Batch Requests api to then combine some requests.
That solution should lower the amount of http requests considerably if that is what you're after.
I am looking for a way to query facebook pages that for example, have something to do with food.
Not to difficult ;)
$pages = $facebook->api('search?q=food&type=page');
But... I want to get the largest pages (most likes) of that category. Search get's close, but I can't influence the return order (I think).
I have been looking here: https://developers.facebook.com/docs/reference/fql/page/
to see if I can get it to work with a query, but it seems I can only query information about a specific page.
I have been looking for several solutions without succes. Is this even possible at all? Any help would be much appreciated!
How about this:
Make that request to "search?q=food&type=page", then take the results and iterate over them.
For each result make the following FQL query:
SELECT
name, username, fan_count
FROM
page
WHERE
page_id="ITERATION_PAGE_ID"
For example, the first result I get has the id "25255939006", the FQL will be:
SELECT name, username, fan_count FROM page WHERE
page_id="25255939006"
And the result is:
{
"data": [
{
"name": "Food",
"username": "",
"fan_count": 146291
}
]
}
Hope this is what you were after.
I am trying to learn how to use the Facebook Open Graph API and have a question on how to determine the object_id of my site. I need this object_id so that I can do other queries, such as I want to get a list of users who have liked my site within a given time period.
Based on other Stackoverflow questions I have seen that I should be able to run this query to get the object_id
select id from object_url where url in ('www.bubbasgameroom.com', 'bubbasgameroom.com')
When I run that query it comes back with an empty result. When I run the following query, I see that my page has been liked 21 times
select total_count from link_stat where url in ('www.bubbasgameroom.com', 'bubbasgameroom.com')
What am I missing here? Any help will be greatly appreciated.
Thanks!
Most likely the url should be identical to the og:url meta tag if used on your website. Also you need to append the http:// part for it to work. For example this would work:
SELECT url,site,id
FROM object_url
WHERE url IN (
'http://developers.facebook.com',
'http://www.imdb.com/'
)
Result:
[
{
"url": "http://developers.facebook.com",
"site": "developers.facebook.com",
"id": 113167538713703
},
{
"url": "http://www.imdb.com/",
"site": "www.imdb.com",
"id": 6903354771
}
]
But this doesn't:
SELECT url,site,id
FROM object_url
WHERE url IN (
'developers.facebook.com',
'www.imdb.com/'
)