0

To get FB to scrape data from a URL, I'm calling https://graph.facebook.com and posting id=url_encoded_url_to_scrape&scrape=true as post data via the PHP curl extension. I have a 1 second sleep between calls and have never made more than at most about 35 calls in a 600 second period (and usually it's more like just a few calls). However, I'm getting rate limited with the following message:

{  
  "error":{  
    "message":"(#4) Application request limit reached",
    "type":"OAuthException",
    "is_transient":true,
    "code":4
  }
}

From reading the following SO posts, I think I'm well within the rate limit (600 calls in 600 seconds per IP), and there's nothing else running on this VM so it's not like another site is causing the limit to be hit. Facebook api: (#4) Application request limit reached and What's the Facebook's Graph API call limit?

Does anyone have any tips on how to solve this or what I'm doing wrong? I had it work for about 20 calls yesterday, but other than that, I think I've always gotten the rate limiting message when working on developing this, even when starting out.

Community
  • 1
  • 1
g491
  • 341
  • 1
  • 3
  • 12

2 Answers2

2

You should at least add an App Access Token to that call, and see if this help concerning the request limits.

As far as I know the rate limiting is dynamic, and Facebook does not communicate the rules for that.

Tobi
  • 31,405
  • 8
  • 58
  • 90
  • Okay, I didn't go that route originally because it said "This kind of access token [app token] is needed to modify and read the app settings. It can also be used to publish Open Graph actions", and I didn't think what I was doing fit that description (https://developers.facebook.com/docs/facebook-login/access-tokens), but I'll give that a try and see if it helps. – g491 Apr 21 '15 at 15:57
  • 1
    I got an App Access Token via https://developers.facebook.com/docs/facebook-login/access-tokens#apptokens and tacked it onto my POST and that made the problem go away. Maybe FB is trying to discourage anonymous graph access API utilization. – g491 Apr 26 '15 at 23:39
0

There is official documentation on the rate limits, and it's at least 200 calls per user per hour: https://developers.facebook.com/docs/graph-api/advanced/rate-limiting

vaer-k
  • 10,923
  • 11
  • 42
  • 59
  • Welcome to SO. Link-only answers are not as helpful as answers that have working code plus helpful explanations. In this case, it would be worthwhile explaining this answer to a 5 year old. – Somnath Muluk Nov 09 '15 at 10:53