Our website allow people to upload images and then share them on twitter and/or like them on facebook. There's a trending page with the top X images based on the total number of twitter mentions and facebook likes of a specific page.
The only way at the moment I can see we could achieve that is by making 2 API calls (at least) on every single image to get the count for each social website and then calculate the total to finally order the images by the most "trending" first. I don't think that's the way it should be as it could possibily take ages to do this if we have, let's say, 3000 images to order.
I have no idea on how to achieve what we want (and if it is even possible), that's why the only solutions I can think of for now is either to have our own "like" system or to get the counts hourly and creating a kind of cache (but that would still mean a LOT of API calls to to every hour).
Maybe you can just rank images based on the number of views on your server. If you'd like you can take the 10% best viewed images and rank those based on mentions/likes (as well). This requires 90% less API calls but gives a satisfying result (I think).