Search code examples
facebookhttpfacebook-graph-apirate-limitinghttp-status-code-500

Facebook graph API response size limiting (error code 1)


Just sharing some information I came across while testing my application.

Facebook Graph API implements rate limiting as described on their documentation page. Today I was trying to retrieve the feed from CNN facebook page and I got the following 500 error:

{"error":{"code":1,"message":"Please reduce the amount of data you're asking for, then retry your request"}}

This is the query I was trying to test:

https://graph.facebook.com/v2.3/5550296508/feed?fields=id,actions,application,caption,created_time,description,from,icon,is_hidden,link,message,message_tags,name,object_id,picture,place,privacy,properties,source,status_type,story,story_tags,to,type,updated_time,with_tags,shares,likes.limit(50),comments.filter(stream).limit(50){attachment,created_time,from,id,like_count,message,message_tags,comments{attachment,created_time,from,id,like_count,message,message_tags}}&access_token=xxxxxxx


Solution

  • I tried to set different limit values to reduce the size, and eventually it worked. By inspecting the response size and playing around with it a bit, I found that the error is thrown when the response reaches (roughly) the 200k threshold.

    I tested with Graph API versions 2.3 - 2.4 - 2.5 - 2.6

    I found no documentation about this response size limit on the facebook APIs documentation, so it's possible that it will be changed in the future.

    Just thought it might be useful to share if you are modelling something using their API.