ShintoTuna
ShintoTuna

Reputation: 3787

Facebook API and cron

I am developing a Facebook app where I have multiple (~200) pages and users can 'like' them. Based on likes I create a table of best pages.

I am using a REST API to get likes like so:

http://api.ak.facebook.com/restserver.php?v=1.0&method=links.getStats&format=json&urls=%%URL%%

Having up to 75 URLs in a single call plus if total number exceeds 75 I sleep(5) and do a next call until all URLs are passed and responses received. After I sync the 'like' amounts to db. This function is going to run with cron ideally every 5 minutes or so.

My question is how often would it be appropriate to make those calls and can Facebook restrict these calls in any way if I exceed some sort of limit (if there is such)?

Any suggestions are welcome.

Upvotes: 0

Views: 814

Answers (2)

Nitzan Tomer
Nitzan Tomer

Reputation: 164137

In the Facebook Platform Policies it states:

  1. If you exceed, or plan to exceed, any of the following thresholds please contact us by creating a confidential bug report with the "threshold policy" tag as you may be subject to additional terms: (>5M MAU) or (>100M API calls per day) or (>50M impressions per day).

So if you plan to exceed that, contact them.

Why are you using the rest api? It has been deprecated and you should switch to the graph api. Also, the graph api has the Batch Requests feature which will let you aggregate api calls into one request.


Edit

The equivelent for what you're trying to do (I think) is the use the FQL table link_stat.

Something like:

SELECT 
    share_count, 
    like_count, 
    comment_count, 
    total_count, 
    click_count 
FROM 
    link_stat 
WHERE 
    url="URL"

Upvotes: 2

Byron Voorbach
Byron Voorbach

Reputation: 4485

To be honest, I'm not sure what kind of restriction facebook has on using their REST api. What I do know is that Facebook is in the process of deprecating their REST api.

Source:

"We are in the process of deprecating the REST API. If you are building a new Facebook app, please use the Graph API. While there is still functionality that we have not ported over yet, the Graph API is the center of Facebook Platform moving forward and where all new features will be found."

https://developers.facebook.com/docs/reference/rest/

Good luck with your app!

Upvotes: 0

Related Questions