How many Facebook Graph API calls can i do per user token? - facebook

I'd like to call 8000 times the Facebook search API like this one below:
https://graph.facebook.com/v2.10/search?access_token=<myaccesstoken>&q=<call_n>&type=<my_type>
How many calls can I do? And if it is not possible what would be the solution?

See the documentation
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.
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.

Related

Setting subscriptions on multiple microsoft graph objects

With Microsoft Graph, I can set a subscription on a resource. In my case an event. I am going to be using an admin authenticated account to access multiple calendars.
Is there a way to set a subscription to get notifications on all the calendars the admin can see?
If not, is there a way to send in a block of subscriptions with a single request? Because we are limited to how many requests we can specify in a specific timeframe. (I'm not sure what the limit is) but if I have 500 calendars I need to set subscriptions on so I get notifications of changes, how are you supposed to do this and not get hit by the request per timeframe limit?
Currently, there isn't a way to send multiple subscription creation requests in the same HTTP REST call. Every different resource for which a subscription is being created would have its own HTTP call into the Graph REST API.
You can recommend a "batching" feature (so multiple REST requests can be processed in the same HTTP call to the Graph API) on UserVoice: https://officespdev.uservoice.com/
There is also a consideration that, in my experience, the number of simultaneous subscriptions allowed is around 20, so 500 subscriptions might be out of the question. The best advice I've been given on the subject is to loop through all the objects one at a time to refresh them in sequence. The throttling that follows is a different issue altogether.
When a 429/"Unknown Error" comes back (ie throttling), it comes with a retry-after header which should be observed. I might point out that throttling, for me, is still a huge issue.

Is Facebook Really Rate Limiting Share Count Requests?

Facebook's API doc says you can only make 200 share count requests per app-user every hour (https://developers.facebook.com/docs/graph-api/advanced/rate-limiting) but I just made 200K share count requests in less than 60 minutes and I didn't get any rate limiting header. I want to see the X-App-Usage HTTP header to code something in order to handle it. Do you know if Facebook is really rate limiting share count requests?
In addition, the Application Rate Limiting Chart is always showing nothing:
Thanks for reading!
On Facebook's documentation for Rate Limiting on the Graph API (shortcut to App-Level limits), I found this little note:
Caveats:
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.

Api rate limit for business or app within the business

Dose Facebook limits total api calls (600 call per 600 seconds) for each app separately within one business or the limit apply for all the apps within a business?
for example:
i have a business with 6 apps, each app can make 600 calls per 600 seconds?
or
each app can make 100 calls?
Limits are per App/Token/IP afaik, so it´s always good to use a User or Page Access Token instead of an App Access Token or even no Token at all. But the limit is dynamic, there are no static numbers. And you are not allowed to use several App just to circumvent the API Limit.
More information: What's the Facebook's Graph API call limit?

There have been too many calls from this ad-account. Wait a bit and try again

I am trying to fetch the reportstats from our account. I need to make async calls because otherwise I would get and error that the data is to old.
When I create multiple requests I will get the error: "There have been too many calls from this ad-account. Wait a bit and try again."
I have only made about 30 request in a small time because of the way the async reports work. Is there a better way to fetch te reporting data? And if there is not is there a way to see the request score that is mentioned in the documentation?
And an other question will be, is there a difference in the amount of request when your app is on development access?
Thanks in advance,
Jorik
First point, according to access level docs here there is heavy rate limiting on the apps that are in development stage.
Second, To fetch reports there are multiple endpoints that, such as ad account wise reports, campaign wise reports, ad wise reports, here is a link to the docs for Insights API
available params are :
act_AD_ACCOUNT_ID/insights
CAMPAIGN_ID/insights
ADSET_ID/insights
AD_ID/insights
Lastly, about rate limiting in marketing api. It is done as a sliding window method which means there is no actual track of number of requests per day or something, its just that a lot of requests in short amount of time is not allowed.
two things you can do are,
first see the response of api and if the response is ratelimit error, stop the request.
second, use batch requests
Here is a gist from troubleshooting guide on limits
Troubleshooting
Timeouts
The most common issues causing failure at this endpoint are too many requests and time outs:
On /GET or synchronous requests, you can get out-of-memory or timeout errors.
On /POST or asynchronous requests, you can possibly get timeout errors. For asynchronous requests, it can take up to an hour to complete a request including retry attempts. For example if you make a query that tries to fetch large volume of data for many ad level objects.
Recommendations
There is no explicit limit for when a query will fail. When it times out, try to break down the query into smaller queries by putting in filters like date range.
Unique metrics are time consuming to compute. Try to query unique metrics in a separate call to improve performance of non-unique metrics.
Rate Limiting
The Facebook Insights API utilizes rate limiting to ensure an optimal reporting experience for all of our partners. For more information and suggestions, see our Insights API Limits & Best Practices.

Rate limit increase for API token?

I've seen lots of mention here and on the web of the rate limit of 600 requests in 600 seconds, though it doesn't seem to be specified on Facebook's Developer site itself. Is there a way to request a higher limit? If not (and assuming we can't reduce the number of requests) what's the recommended way around the limit? Alternating between multiple tokens?