12

There are multiple similar questions, but I could not find any helpful answer. I have created Facebook application and going to fetch Page/Post data from Facebook on behalf of that application. - I have special read_insights permissions on Page. - I created access token with that permission for my Facebook App. (which will be automatically extended). Today I faced to problem with getting transient errors:

Error, Code: 4, Message: Application request limit reached  
Error, Code: 17, Message: User request limit reached

There are answers related these problems (Facebook api: (#4) Application request limit reached , Facebook OAuth Error: Application request limit reached).

According to the Facebook Platform Policy you should contact them, If you exceed, or plan to exceed, any of the following thresholds please contact us as you may be subject to additional terms: (>5M MAU) or (>100M API calls per day) or (>50M impressions per day). My App performed 300K calls during week , so it shouldn't exceed these limitations. I have contacted to Facebook but they haven't reply yet.

I would like to know what are the best practices for fetching data from Facebook. I need to fetch

1. /page_id?fields...
2. /page_id/posts?fields...
3. /post_id/likes?fields...
4. /post_id/comments?fields...
5. /page_id/insights/
6. /post_id/insights/

For 2-4 I can't use batch requests because of paginated results, I am taking with limit=100, for 5-6 I have created batch requests with specific insight URLs that I need, and already can't decrease number of calls anymore.

When I faced to

Error, Code: 4, Message: Application request limit reached 

I created new App and for fetching Insights I granted read_insights permission by same Facebook user. Then I faced to

Error, Code: 17, Message: User request limit reached

So I assume that if token would be generated by other user who has read_insights permission to new application it could work.

Can someone suggest what will be best approach to solve my problem? Should I configure multiple Page access tokens for my App (generated by different users) and switch between them when for one of tokens Error #4 or Error #17 is occurred?

Community
  • 1
  • 1
Sergey Gazaryan
  • 1,013
  • 1
  • 9
  • 25
  • What kind of access token are you using? I guess a page access token? – Tobi Jul 21 '15 at 15:39
  • I am using page access token generated for my app via graph explorer with read-insights permessions for Insights, fot the rest basic app token is used(app_id|app_secret). – Sergey Gazaryan Jul 21 '15 at 16:13

1 Answers1

0

Have you tried the following?

  • Using the realtime updates API to be notified about new posts and new comments on posts, rather than polling
  • (looks like you are doing this) Ensuring you're using the page access token for a page to fetch data for that page, and not the token of a user or another page
  • Caching data that's unlikely to change to avoid re-fetching
  • Requesting multiple posts in a single call rather than one post per call (using the ?ids=x,y,z syntax documented here: https://developers.facebook.com/docs/graph-api/making-multiple-requests )

Using those methods you may be able to avoid hitting this entirely

lamdadj22
  • 126
  • 4
  • I need historical data before fetching real time, so I have to use since parameter ... – Sergey Gazaryan Jul 31 '15 at 04:34
  • For multiple requests Facebook actually calculates them as multiple calls , not one, and they take into account multiple factors (including cpu and memory they used) for calls – Sergey Gazaryan Jul 31 '15 at 04:37
  • In worst case I am planning to schedule calls for some bulk requests, with some optimal interval of time, but looking forward to other solution – Sergey Gazaryan Jul 31 '15 at 04:39