Facebook: Application Request Limit Reached

Bug #522735 reported by nsasherr
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Facebook Friends Graph
Kamran Riaz Khan

Bug Description

Arbitrarily, it seems, I am getting this message:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
  File "./fbfriendsgraph.py", line 149, in run
    iconnections = self.fb.friends.areFriends(ilist, myfriends)
  File "<string>", line 6, in areFriends
  File "/home/nathaniel/Desktop/fbfriendsgraph/facebook/__init__.py", line 517, in __call__
    return self._client('%s.%s' % (self._name, method), args)
  File "/home/nathaniel/Desktop/fbfriendsgraph/facebook/__init__.py", line 1002, in __call__
    return self._parse_response(response, method)
  File "/home/nathaniel/Desktop/fbfriendsgraph/facebook/__init__.py", line 939, in _parse_response
  File "/home/nathaniel/Desktop/fbfriendsgraph/facebook/__init__.py", line 890, in _check_error
    raise FacebookError(response['error_code'], response['error_msg'], response['request_args'])
FacebookError: Error 4: Application request limit reached

This has happened for me at 29%, 31% and 61%. My friends list has not changed, and assuming that the programme walks a graph in a deterministic way, it seems like facebook is being somewhat arbitrary.

Related branches

nsasherr (nsasherr)
description: updated
description: updated
Revision history for this message
Kamran Riaz Khan (inspirated) wrote :

I also got the same message during development of the application. I assumed that the message was somehow related to a *lot* of requests being generated for the Facebook API during a single day. I waited for a while and tried executing the application the next day and everything worked fine.

Revision history for this message
Matthias Blaicher (blaicher) wrote :

I tried waiting for several hours but never get pass 60%, also not on the first try. On the other hand it works fine for my girlfriend.
Maybe it helps to catch the exception and wait a minute till you issue the next queries?

Revision history for this message
Kamran Riaz Khan (inspirated) wrote :

It seems that Facebook restricts the number of API calls made per minute. Quoting another similar post from:


"It appears Facebook assigns a bandwidth limit to each application. The limit is said to be based on the "affinity users have shown to the application".

I know it sounds stupid to suggest that an application needs a certain % of fans from total users to work properly, that's what the page suggests.

A workaround would be to check the number of requests being made per minute and halt whenever required, will do that in a short while and link here so you can try out.

Revision history for this message
Kamran Riaz Khan (inspirated) wrote :

Please try the modified script in testing branch (https://code.launchpad.net/~inspirated/fbfriendsgraph/testing) and report back (with standard output) if it fixes the problem. The script enforces 10 requests per minute for API calls to Facebook.

Changed in fbfriendsgraph:
status: New → In Progress
Changed in fbfriendsgraph:
assignee: nobody → Kamran Riaz Khan (inspirated)
importance: Undecided → Medium
Revision history for this message
Jack Hargett (njhargett) wrote :

Thank you! I was getting the Application Request Limit error, but the newly modified script solved the problem for me.

I'm not able to produce a graph, however. I will submit a (possible) bug report for this.


Changed in fbfriendsgraph:
status: In Progress → Fix Committed
Changed in fbfriendsgraph:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers