0

Hope someone can help me out here.

I'm trying to extract the number of likes that the like buttons are getting on each of my webpages. Instead of giving me any information about the page though, I'm getting what is shown below (for example), without any stats. How would I get it so that the number of likes shows up on the API page for each of my individual pages? Do I need some kind of tag on each of my pages?

Again, I just want to be able to extract the number of likes that each of my pages gets.

Thanks so much! :)

Dan

{
   "id": "http://samplewebsite.com/3242342234"
}

1 Answers1

1

Like this: https://graph.facebook.com/YOUR_PAGE_ID

Edit:

If the first URL doesn't work, try this: https://api.facebook.com/method/fql.query?query=select like_count from link_stat where url=YOUR_URL

Yan Berk
  • 14,328
  • 9
  • 55
  • 52
  • Thanks, I realize that, but on that page, all that is showing up is: { "id": "http://samplewebsite.com/3242342234" } How do I get it to show the number of likes? What header am I missing on my site? – Daniel J. King Apr 13 '12 at 13:47
  • Please post the URL of your page on Facebook. The result you are receiving is wrong. – Yan Berk Apr 13 '12 at 13:49
  • Yes, I know...but I'm using this as an example. I'd rather not share my url here. – Daniel J. King Apr 13 '12 at 13:50
  • For instance the ID for the Coca Cola page is: 40796308305 and the result is: https://graph.facebook.com/40796308305 Are you sure you are using the correct ID? – Yan Berk Apr 13 '12 at 13:53
  • Hi Yan, I realize that you use IDs for Facebook pages. However, I want to find the like statistics of my *webpage URLs* instead. For example, you can see the number of likes on https://graph.facebook.com/platform. I'd like to do the same with my webpages. See what I mean? – Daniel J. King Apr 13 '12 at 13:55
  • Ok, I got it. The way to do it: https://graph.facebook.com/?ids=YOUR_URL Read more: http://stackoverflow.com/questions/3581488/facebook-graph-api-get-id-for-a-url – Yan Berk Apr 13 '12 at 14:00
  • Hi Yan, Thanks for the link...that's exactly my problem. It's returning limited information for me. I have the Like/Send button on my pages...but if I'm missing the fb:og tags, is that what is making a difference? – Daniel J. King Apr 13 '12 at 14:07
  • If that doesn't work try the following FQL query: "https://api.facebook.com/method/fql.query?query=select like_count from link_stat where url=YOUR_URL" – Yan Berk Apr 13 '12 at 14:23
  • Yan, I'm not a programmer so I'm not sure what to make of your last message...what can I tell my programmer to do with that? Here's the thing: When I go to the url http://graph.facebook.com/http://mywebsite.com/image.aspx?imagenum=403251, it shows the following: { "id": "http://mywebsite.com/image.aspx" } So it doesn't seem to be seeing the whole URL, you know? – Daniel J. King Apr 13 '12 at 14:44
  • Note: *I'm actually visiting my real URL...not mywebsite.com* – Daniel J. King Apr 13 '12 at 14:46
  • the comment section cut a part of my URL. Please see my edited message and replace YOUR_URL with your actual URL. – Yan Berk Apr 13 '12 at 14:48
  • Would you mind adding me on Skype? Username: deankeen. I have to go for now, but I'd skype you later if you don't mind? – Daniel J. King Apr 13 '12 at 14:50