Facebook Marketing API Rate Limit - facebook

I know that fb have made available some documentation about the requests limits to the api https://developers.facebook.com/docs/marketing-api/api-rate-limiting,
but it is not clear how each api call is calculated...
i.e, If I want to get stats for ~10,000 adsets, how can I evenly space the time between the calls ?

The best answer i could find for this question from another SO thread -
"After some testing and discussion with the Facebook platform team, there is no official limit I'm aware of or can find in the documentation. However, I've found 600 calls per 600 seconds, per token & per IP to be about where they stop you. I've also seen some application based rate limiting but don't have any numbers.
As a general rule, one call per second should not get rate limited. On the surface this seems very restrictive but remember you can batch certain calls and use the subscription API to get changes."
Source - What's the Facebook's Graph API call limit?
Official Doc-: https://developers.facebook.com/docs/graph-api/advanced/rate-limiting

Rate limits are imposed on each app. The rate limiting tool gives you information about how close your app is to being throttled. Click on any sample to get more detail on the types of utilization.
Your app can make 200 calls per hour per user in aggregate. As an example, if your app has 100 users, this means that your app can make 20,000 calls. This isn't a per-user limit, so one user could make 19,000 of those calls and another could make 1,000. This limit is calculated based on the number of calls made in the previous hour.
Source-: https://developers.facebook.com/docs/graph-api/advanced/rate-limiting
Heavily rate-limited per ad account. For development only. Not for production apps running for live advertisers.

Related

Graph API rate limits: do test apps have their own limit?

I'm currently developing a facebook App whose purpose is to
For a given page, list the last X posts
For each of said posts, list the last Y comments
For each of said posts, list the last W reactions (e.g. likes)
For the page as a whole, display the Z most active users considering the last X posts
The app is not yet published (And, since it'll only provide server to server communication, it might never be) and it currently has one admin and 4 test users.
I'm currently hitting rate limits for the comments endpoint, whereas I've never got any alert for the reactions endpoint.
The rate limit documentation says that some endpoints do not count for rate limiting, but it doesn't say which ones. So I assume that, in my case, only the comments API calls are eating my rate limit.
One approach I might consider to go over the rate limit is to create test apps for my app. They do have their own app-id and app-secret, and share the same app-scoped User ID namespace, so user IDs will be consistent and I'll be able to use both Apps to display aggregate data.
What I don't know is do test apps have their own rate limit?, or do they "eat" part of the production app rate limit?
I want to avoid creating the logic to rotate the App credentials on each call only to discover the rate is still the same.
Edit: I created a test app and hardcoded some calls to use its credentials. However, said calls aren't shown in test app's dashboard. I believe this would mean that its calls are attributed to the main app anyway.

facebook User request limit reached

We are getting the below issue when querying facebook graph API
(#17) User request limit reached
i know that this is a throttling error on user level rate limiting as mentioned in the below link
https://developers.facebook.com/docs/marketing-api/api-rate-limiting
But we were never facing the issue before, suddenly this issue has started coming, Did facebook changed the rate limits recently ?
does anybody have any idea ?
AS Per doc:
Your app can make 200 calls per hour per user in aggregate. As an example, if your app has 100 users, this means that your app can make 20,000 calls. This isn't a per-user limit, so one user could make 19,000 of those calls and another could make 1,000. This limit is calculated based on the number of calls made in the previous hour.
The number of users for your app is calculated as the average number of daily active users plus today's new logins
Not all API calls are subject to rate limits so the number of calls you make may not match what you see in the rate limit tool. Facebook also throttles calls based on CPU time used and total time. It is difficult to hit these limits, so it is an extremely rare occurrence. This information is exposed in the detail pane for each sample. Click on the graph in the rate limit tool on your dashboard for details.
Recommendations:
Rate limiting defines limits on how many API calls can be made within a specified time period. When a rate limit is exceeded, all API calls from an app are throttled and fail for a brief period of time. Once an app is throttled, the caller will get an error for subsequent calls with error code = 4, CodedException. It can take up to an hour for your requests to be accepted again.
To avoid rate limiting:
Spread out queries evenly between two time intervals to avoid sending traffic in spikes. Use filters to limit the data response size and avoiding calls that request overlapping data. Use the rate limiting header to dynamically balance your call volume.
You called API too many times (working too hard, huh?). This is how Facebook calculates the Limit. ref: link

Facebook API - User rate limit reached for a small number of requests per user token

I have an app for Android which checks for new notifications from Facebook every N minutes, where N is more than 5 minutes (default is 30 minutes). That app also makes some user-generated requests to Facebook's Graph API.
Recently (since the moment we added scheduled polling for new notifications), Facebook started to limit our app (with error #17 "User request limit reached" mostly, but sometimes it gives error #4 "Application request limit reached").
The Insights Dashboard gives us following statistics: 255,000 requests per day, 432 users. That gives roughly 590 requests per user per day, which is far from any mentioned limit for API I was able to find.
Facebook's information on rate limiting is really vague, here are some numbers you can usually find in different sources:
600 calls per 600 seconds per token per IP.
100M calls per day per app.
10,000 calls per user token per day.
The scheduled requests which our app does on a regular basis is a simple FQL:
SELECT sender_id,created_time,title_text FROM notification WHERE recipient_id=me() AND is_hidden = 0 AND is_unread = 1
Even with the minimal update interval of 5 minutes, it will be fired 288 times per day.
We tried to replace this request with Graph API call, but it didn't change a thing.
I know that there are other apps that have similar functionality and they seem to not have these limitations.
Does anybody know if there are any way to avoid being limited by Facebook with such reasonably low amount of calls?
Thanks!
It turned out that there was a nasty bug in the code which was really hard to reproduce, that sometimes forced the app to make API requests in a loop for 10-30 minutes in a row. Only a small percent of clients had that problem, but it was enough to bump into API limits.
It seems that FB API calculates limits based on the number of users of the app, so even with a rather limited amount of calls we had a rate limiting problem.
Another observation is that despite the fact that only a limited number of users were doing a lot of API calls, FB did limiting for all users.
Hope that information will be helpful somehow to resolve similar issues.

How to get Maximum App requests per day

Most of Zynga games use the Maximum App requests per day to show to the user how many requests he can send that day. I couldn't figure out how to get that daily number (dynamically) . Any hints on that? Since, I'm doing this in a flash app. I can't let the user send requests more than he is allowed. Ideas?
You can find out your Requests limit via the Developer Settings page:
https://developers.facebook.com/apps
Note that limits only apply to the older method of sending requests. If you use the newer Requests functionality, there is no limit to the amount of requests you can send:
https://developers.facebook.com/docs/reference/dialogs/requests/
Naturally, if you're being spammy, you'll still get reported a lot and automated systems could block you, so remember to keep to a reasonable volume of requests.

Does Facebook have a maximum number of API connections?

If the answer is yes, then what is it?
By maximum number of connectioned allowed per application I mean how many instances of the same api/key can be used to get the friends list at any one time, will Facebook block too many requests?
EDIT I have been looking at http://developers.facebook.com/ but have not been able to find the answer to my question there.
From their Policy
If you exceed, or plan to exceed, any of the following thresholds please contact us as you may be subject to additional terms: (>5M MAU) or (>100M API calls per day) or (>50M impressions per day).
The only information I was able to find is something in a forum.
http://www.quora.com/Whats-the-Facebook-Open-Graph-API-rate-limit
After some testing and discussion with the Facebook platform team,
there is no official limit I'm aware of or can find in the
documentation. However, I've found 600 calls per 600 seconds, per
token & per IP to be about where they stop you. I've also seen some
application based rate limiting but don't have any numbers.
As a general rule, one call per second should not get rate limited. On
the surface this seems very restrictive but remember you can batch
certain calls and use the subscription API to get changes.
You can see how many API requests your users can have a day if you go to your Insights page and click on "Diagnostics". You can also see some other request statistics if you click on "Performance".
http://www.facebook.com/insights