Facebook Graph API - page_impressions inconsistent on set dateRange? - facebook-insights

I'm using Facebook Graph API v2.2 (had this problem on v2.1 as well) and I'm requesting page_impressions through the insights endpoint for a set date range:
01-02-2014 - 28-02-2014.
After requesting I print out the impressions from the results, and most of the time Facebook returns a total of 6763 impressions. Sometimes though, a slightly different amount is returned but there doesn't seem to be a pattern.
I've requested the impressions 40 times. The first 11 times: 6763, then once: 6709, 5 times: 6763, 1 time: 6720 and 12 times: 6763.
Is anyone familiar with this or having the same problem?
Thanks!
EDIT: I just had a result of 248 impressions... nowhere near 6763...

Seems this is a Facebook Bug. Found a bugreport about it on the Facebook Developers forum. Different endpoint, same problem:
https://developers.facebook.com/bugs/877357682326329/

Related

Instagram/Facebook deprecating many APIs [duplicate]

I use some self developed script to get info about my posts and followers. Recently I discovered that Instagram changed rate limits for my app. I see following info in headers:
x-ratelimit-limit: 200
I learned Instagram blog and page with changes but found no mentions about any changes since Oct 1, 2017.
Is this new limit related only to my token or to entire platform? Could you check your token?
Yes It is, Although no official communication.
I also experienced that.
I found this in their documentation.
The Instagram API uses the same rate limiting as the Graph API (200 calls per user per hour) with one exception: the /media/comments edge limits writes to 60 writes per user per hour. Please refer to the Graph API's rate limiting documentation for more information.
https://developers.facebook.com/docs/instagram-api/overview/#rate-limiting
https://techcrunch.com/2018/04/02/instagram-api-limit/
Hope this will be helpful.
Update:-
Further on 4th April few more APIs deprecated by Instagram.
https://www.instagram.com/developer/changelog/
Some perspective:
This 200 per hour call has been in the Graph API documentation for at least a month (according to wayback machine).
Facebook must have panicked over the weekend and pressed the "require Graph API permissions" button, thus our current situation. :\
Yes,
The limit has been reduced.
Here are some reference links for detailed documentation:
Instagram API limit reduced to 200 from 5000
https://techcrunch.com/2018/04/02/instagram-api-limit/
https://developers.facebook.com/docs/instagram-api/overview/#rate-limiting
Hope it helps
Thanks
Here's our answer: https://www.instagram.com/developer/changelog/
The API deprecated immediately. So really the limits probably don't matter that much anymore. I really don't see myself building another app based on their API...
Here is The New Instagram's Public Api Update , unfortunately Limit rates are worthless for some Features in Instagram .
April 4, 2018
The following endpoints are deprecated immediately:
Follows and Relationships
GET /users/self/follows
GET /users/self/followed-by
GET /users/self/requested-by
GET /users/{user-id}/relationship
POST /users/{user-id}/relationship
Commenting on Public Content
GET /media/{media-id}/comments (Deprecation not relevant when fetching comments for self media)
POST /media/{media-id}/comments
DEL /media/{media-id}/comments/comment-id
Media
GET /media/{media-id}
GET /media/shortcode/{shortcode}
Likes
GET /media/{media-id}/likes
POST /media/{media-id}/likes
DEL /media/{media-id}/likes
User Search
GET /users/{user-id}
GET /users/{user-id}/media/recent
GET /users/self/media/liked
GET /users/search
Subscriptions - to receive notifications when media is posted
Some information on Public Content returned through hashtag and location search will be removed - Name, Bio, Comments, Commenters, Follower Count, Following Count, Post Count, and Profile Picture

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
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.
I originally misready the error message Please reduce the amount of data you're asking for, then retry your request and assumed I was getting rate-limited -- i.e. making too many API calls in a short time period. Thanks Dieghito for your answer, which helped me realize the error is about the response size.
In my case it was fetching /comments that was exceeding the response size limit. I had the limit set to 1000, which was fine for most posts. But for posts with a lot of lengthy comments, the response size grew too large. I had paging already setup, so simply requesting fewer comments per page (limit: 50 or 100) solved the problem for me. Just posting that here for people whose problem could be related to comments.

Facebook FQL posts limit issue

Currently i am using following FQL query :-
https://api.facebook.com/method/fql.query?query=select post_id,likes FROM stream WHERE source_id=XXXXXXXX LIMIT 0,10000&access_token=XXXXXXXXXXXXX&format=json
I have two Facebook Accounts / pages & able to download data using above API. Able to retrieve posts & post likes count.
But, from last three days, for one Facebook account above FQL query is not working. it is returning message :- "error": "Request failed" . For other account it is working fine.
For each facebook Account / pages i have generated separate Access Tokens.
But, if i update limit from : -
Limit 0,50
Limit 50,100
then it is working & returning posts from page but not returning all post which i have previously getting from Limit 0,10000
Please help me, if any one have idea about this issue ?
Thanks
Facebook will cancel queries which take too long or too many resources to execute. In general, I would never use LIMITs which are that high. There's a high probability that they will fail, and you can't really incfuence the query execution "load" other than setting the LIMIT to a reasonable number (which means implementing a paging mechanism).

Can I fetch more than 100 fans from facebook page?

using the fan.php API I can extract info about max 100 likers (e.g. https://www.facebook.com/plugins/fan.php?connections=100&id=150495894979290) , if I use connection with higher value I get "Param connections must be a number less than or equal to 100" error
how can I get this information for connection > 100 ?
Refer the following link.
Get Facebook Page Likes all at once in c#
Since facebook prevents this list to be accessed to discourage selling fans data to 3rd party companies. As far as I know you can get a maximum of only 100 persons using this..Sorry

Twitter users/search issue

I am trying to search users through new iOS Twitter framework by using following url ..
https://api.twitter.com/1/users/search.json?q=%#&page=2&per_page=20
The api says that maximum 20 persons will be searched per_page..
https://dev.twitter.com/docs/api/1/get/users/search
So i set the page=2 to fetch 40 persons but it is still fetching 20 persons.
Is this the bug in twitter framework or there is something else that i have to do..
Help would be appreciated.
No matter what query you run, you'll get 20 people back. The reason to set page is so that you can page through the results.
page=1&per_page=20 returns the first 20 people.page=2&per_page=20 returns the next 20 people. And so on.