Hacker News new | past | comments | ask | show | jobs | submit login
See how many times a URL has been shared on Facebook (facebook.com)
305 points by jf on March 20, 2011 | hide | past | favorite | 55 comments



Twitter: http://urls.api.twitter.com/1/urls/count.json?url=http://new...

LinkedIn: http://www.linkedin.com/cws/share-count?url=http://news.ycom...

These APIs are marked private (as opposed to Facebook's) so use at your own risk.


I packaged a few of the private ones with this weekend project: http://sharedcount.com Unfortunately, only Facebook does URL normalization for you, so dumb things like trailing slashes have a big effect on the count.


> Unfortunately, only Facebook does URL normalization for you, so dumb things like trailing slashes have a big effect on the count.

Is that true?

http://urls.api.twitter.com/1/urls/count.json?url=http://new...

http://urls.api.twitter.com/1/urls/count.json?url=http://new...

http://urls.api.twitter.com/1/urls/count.json?url=http://new...


I stand corrected. Twitter used to suck at URL normalization, but it looks like they must have fixed it. But, Delicious and Digg both are a pain.


Is there an API for complete URL normalization, including unshortening URLs?

Facebook and Twitter, do basic normalization, but do not unshorten shortened links.

edit: This has already been discussed on HN: http://news.ycombinator.com/item?id=577457

edit 2: graphs.facebook.com will aggressively and unfortunately normalize any YouTube link to youtube.com. See, for example, http://graph.facebook.com/http://www.youtube.com/watch?v=ZB8... This give the number of shares for youtube.com, not this individual video. I am not sure how to get facebook share stats for a particular YouTube video.


Seeing the comment counts makes me wonder what the comments were. Is there any way to see those?


Very nice, thanks for sharing. Bit of constructive feedback, the fact that the text box deletes itself as soon as you click in it is hella annoying,


Noted, and fixed. I was using HTML5 placeholder. I'll just put it in the value instead.


Perhaps you'd like to also display the Google Page Rank, or something to that effect, like the shares of the domain.



And with this you can actually check multiple sites in one call:

https://www.googleapis.com/buzz/v1/activities/count?alt=json...


The Twitter information is also available via Topsy's public Otter API. See trackback_total:

http://otter.topsy.com/urlinfo.json?url=http://news.ycombina...

http://otter.topsy.com


Thanks for sharing these - tremendously helpful!


Qaiku (public API, needs authentication): http://www.qaiku.com/api/statuses/replies/byurl.json?externa...


thanks



I use that on my HN mashup... http://hnfluence.com/

Also my nyt mashup... http://influentialtimes.com/


What API/URL do you use to get the bit.ly counts?



That's the one. All the api's I'm using here return json. The only tricky part when dealing with these api's is making sure the json can be parsed, trapping errors, making sure variables exist before calling them... that kind of thing.


There is a guy at Yahoo that took a long list of news articles, etc and analyzed over 40MM "Likes" this way. Pretty cool charts came out of it.

http://news.ycombinator.com/item?id=2300300


This guy is me :)


Yuri Lifshits made an entertaining presentation at yesterday's SHDH with data from graph.facebook.com. Link: http://ediscope.labs.yahoo.net/.


That's exactly how I learned that you can use http://graph.facebook.com in this way!

For those of you who weren't at SHDH, you can see Yury's talk from last night here: http://www.ustream.tv/recorded/13439718 - his talk starts at 14:40.


Also, probably goes without saying, but this method includes JSONP support: http://graph.facebook.com/http://news.ycombinator.com/?callb...


Statistically speaking it would be flawed to use this to compare and prioritize a list of urls in order to rank them by interestingness/attention/etc.

The reason is that pages that have Facebook like buttons embedded on them are statistically speaking going to have a higher chance of getting shared than those that don't (such as Hacker News - which doesn't have such buttons).

I guess it depends what you might use this for, but to me it seems to only have limited value.


We've been doing that on Maemo News (http://maemo.org/news/) for a few years now. Works well, especially if you couple it with local, HN-style voting and assign a separate weight for each relevancy source


Does anyone know at what point your IP would get throttled? If so, any usage guidelines if you plan on analyzing a large url set?


Is their a way to see the specific names of each user who shared the URL on Facebook. For example, if a URL has been shared on Facebook through 9300 Users is it possible to get a list of all the users name(s) or is their a easy wat to see which users shared the url.



Here is a PHP lib for getting these counts across quite a few services: https://github.com/nemein/com_meego_planet/blob/master/calcu...



Nice find. Facebook should have a morning paper about all of the changes & additions they make. They never seem to stick to any one way of doing anything and drive developers nuts!


Is their a way to see the specific names of each user who shared the URL on Facebook. For example, I have a Youtube URL that has been shared on Facebook through 9300 Users. Therefore is it possible to view the names of the 9300 users? When I right click the link on Facebook it directs me straight to the Youtube link and when i click see more it only shows the most recent 20 People who have shared the link out of the total 9300.


It's a shortcut for http://graph.facebook.com/?id=abc

Looks like fb made opengraph pages first class citizens on their namespace, should be interesting to see what else they get soon,

You can also do http://graph.facebook.com/?ids=http://news.ycombinator.com,h...

To lookup multiple urls at the same time.


Is there a way to get sum of the share count for all pages in a domain?

This one only reflects share count of the specific page--or only the homepage if you pass a domain.


We're working on this: http://www.jaxified.com/. Right now we're focused on blogs since it's easy to see new content, but we're working on adding support for static sites as well.


Add the domain to facebook.com/insights and then you can download an excel spreadsheet with the daily totals, just sum these to get the total shares/likes for a domain


And if you want to parse the Insights data into pretty pictures and graphs that are easier to analyse than raw data, sign up for our private beta at PageLever.com.


Typos even have some shares, too:

http://graph.facebook.com/http://www,google.com



You must encode it properly:

http://graph.facebook.com/http%3A%2F%2Fwww.twitter.com%2F%23...

Note that encoding '#' as %23 is sufficient.

However, it doesn't show any shares and I'm not sure if that means nobody shared your twitter URL on facebook or if there's another problem somewhere.



Another mini-app to show this and other FB sharing data: http://www.keithmander.com/temp/socialabacus/

Much like the others posted here, but a bit more AJAX and cute graphics.


See how many times a URL has been tweeted on Twitter: http://urls.api.twitter.com/1/urls/count.json?url=http://new...


Clearly their censorship efforts have failed:

http://graph.facebook.com/http://lamebook.com


hah, I've had lamespace.com for years (like, when MySpace was still relevant) but don't use it for anything.





who the hell shares a link to facebook on facebook?

"hey guys check this out"




Is this possible to see if URL was shared/liked by currently signed in facebook user?


Does this only count public posts that "everyone" can see?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: