How do I receive API Throttling Warnings?

1.3k views Asked by At

We need to fetch mutual friend data for each one of our new users. (We're currently doing that through the REST API.) In load testing for an upcoming traffic surge, we ran into API throttling, which breaks our production site. Oops!

In the Insights -> Diagnostics pane, it looks like they issue throttling warnings before they actually throttle. Is there some way we can monitor those limits in code so that we back off gracefully?

1

There are 1 answers

3
DMCS On

You will want to watch for the two errors coming back, then put your next call on a wait timer.

  • API_EC_TOO_MANY_CALLS Application request limit reached
  • API_EC_USER_TOO_MANY_CALLS User request limit reached

See: http://www.fb-developers.info/tech/fb_dev/faq/general/gen_10.html for more information.