Limited friend list in Open Graph - facebook

I received a question from one of the users of my application, and I am doubting if this is a programming bug on our end. When requesting the friend list of the user, the API only returned 480 out of 580 friends. Is the friend list limited to this number? Or is it likely that the other 100 users have very strict privacy settings regarding external applications? If none of these two questions is true there must be a bug in my coding, but before I dive in I thought I'd ask.

Use ?limit=5000 or a higher amount because the default limit is 500. Otherwise, make multiple calls using the next and prev navigation links included in the json response. The reason you are getting 480 instead of 500 is probably because users have changed their privacy settings or opted out of Facebook application platform entirely. Their query first gets 500 friends, and then removes the people that have opted out.

Related

Increase Rate Limit on Facebook Instagram Graph API

While figuring out how to use the Instagram Graph API for Hashtag searches I found out that the rate limit kind of makes it impossible for my use case to search hashtags. Maybe I just don't know the best practices for the Hashtag search so here is my use case:
A client wants an application to manage coupon/discounts initiatives for his clients. Each of those clients have a store and want to offer discounts for everyone posting on instagram with a store-specific hashtag. My client wants to create/update/delete stores in an application and define the hashtag for a store. Thats all done. Now I need to trigger hashtag searches for each store. And heres the problem:
There are 70 stores (at first, may be more in the future). Each store has a unique hashtag and wants to know who posts something with their hashtag. When someone posts with a hashtag the application should know after max. 20 seconds. This means triggering a hashtag search 70 times (because there are as many hashtags as there are stores) every 20 seconds (I know once I get the hashtag ID I can save it and don't need to search for the acutal term anymore, but I still need the newest media for the hashtag ID).
Thats one thing. The other thing is I can only query 30 different unique hashtags in a week (facebook api limitation). But I will need to query at least 70 different hashtags. And the stores don't want to create a facebook account and instagram business page, so they can oauth into my application just for that.
So at the moment the way of doing it is kind of create 70 fake-pseudo-accounts (one for each store) and use those acocunts to prevent hitting the rate limit. But I don't think this is the way facebook wants me to use the graph api.
In this post Facebook API rate limit increase an answer from 2017 shows that there is a possibility to request a rate limit increase and in the linked picture is even the sentence "This is a page management app with few users but many calls". But more recent comments show that this is not possible anymore and I couldn't find any rate limit increase option in the developer portal.
https://stackoverflow.com/a/39408611/6315447 This answer even says there is no possibility anymore and If you hit the rate limit you're doing something you are not supposed to. But how should I use the API then?
Am I missing something? What is the best practice for such a use case?
Thanks in advance.

Does Facebook SDK have a limit for posting to a wall

Does Facebook have limits on the number of pages or wall posts an application can post per day?
The choice of SDK has nothing to do with application limits on posts per day. You could use the PHP SDK, the JavaScript SDK, or the C# SDK you are asking about (or any of many others...Android, IOS, etc.)
Facebook does enforce limits on how many posts per day your app can complete. It is not a hard and fast number, and varies by app and over time depending on the app's behavior. If your app produces posts of low quality (spammy), as measured by how many times people comment on, like, or hide your app posts, then Facebook will decrease your daily limit. These limits are expressed as "buckets" and can be seen on the Insights page for your app.
You will get an error message back from the Facebook API if you have exceeded the limit. The error number is 341 and the description is "Feed action request limit reached". This is enforced on a per-user, per-day basis.
http://developers.facebook.com/blog/post/247/
It seems there is, though the limit is not static. Check item number 4 on the blog post for more detailed information, but in a nutshell it depends on your application's "ranking" according to an internal algorithm Facebook uses to rank your application.
Had a similar experience and came across this post while searching for a reason as to why FB was limiting the number of posts. We were actually doing some testing of sharing news articles from an app authorized with FB and since we were sharing the same link over and over again, it marked them as spammy and decreased our limit to 7!
Here are some guidelines. http://edoceo.com/notabene/facebook-api-oauthexception-341
If you ever happen to be testing, make sure you are not doing the spammy tests because that would decrease the limit on the app.

Getting all facebook page wall posts and comments?

I am developing a social media monitoring application. Currently, we are entering Facebook page ids into the application to collect data from possible customers' Facebook walls (so we have a realistic sample for the customer for direct promotion).
These page ids are used to collect wall postings and comments and to compute statistics (e.g. to show most used words), and are presented to the user in a special view. Requirements are to collect all postings and comments without exception in near-live time. We currently have about 130 page ids in the system, with more to come.
Right now, I am using the Graph API for this, with several disadvantages:
FB API access is restricted to 600 request/10 minutes. To get a near-live view, I need to access the API at least each two hours. As we are using API requests in other parts of the program, too, it is obvious that the limit is hit sooner or later (actually, this already happens)
The responses are mostly redundant: to receive current comments, I have to request the wall postings (comments are enclosed in postings) with the URL http://graph.facebook.com/NAME/feed...
The probability for hitting the limits is dependent on the number of postings on the several walls
I cannot get all comments with this method (e.g. comments on postings some time ago)
I am currently trying out how to switch to (or to complement Graph API usage) using FQL by querying the stream and the comment tables but this also has limitations:
I cannot restrict my query to a specific timespan, leading to redundancy again
The max number of posts I am getting for each one of my 130 page ids is 61 - (why 61?)
I need an unpredictable number of additional requests because I need to get special objects like videos and links in separate requests.
My question now is - if anyone is doing similar things: How did you solve these problems? How do you get a pseudo-live-stream of a larger number (up to, say 1,000) of walls?
Letting the customer grant extra permissions to us is currently not an option.
you will probably have to meet with FaceBook and work out a contractual deal for greater access to their data. I would bet that the answer will be no, no and no, seeing as it appears you are trying to monetize their data, and furthermore, do so without the explicit permission of the users, but hey give it a shot.
I have a similar task - By default FB return only last ~50 posts or all in last 30 days(whichever is smaller) in FQL you should use created_time filter to receive more results. my current problem is that via FQL I receive no more than ~500 posts from any FB page wall even when LIMIT increased:
'select post_id from stream where source_id = 40796308305 and created_time <'.time().' LIMIT 1000000 ;'
this FQL request to CocaCola FB Page returns now ~300 posts only (less than 2 day posts).
If you find a better solution pls advise :)

Facebook Graph API Returns Inconsistent Number of Friends With Facebook Profile

I've noticed that using the new Facebook Graph API to fetch friends of users returns a number of friends that is close to, but not always exactly, the number of friends displayed on the user's profile.
Documentation here: http://developers.facebook.com/docs/api
For example, on that page, I click on https://graph.facebook.com/me/friends, and see the JSON for 477 friends, whereas my profile page on facebook shows a count of 478.
Does anyone know why there is an inconsistency?
If you have friends that have opted out of the Facebook Platform, they will not show up in the API response.
After being frustrated by inconsistent friend count, I asked a former Facebook engineer about it. It's a known bug related to their usage of memcached, and is considered too expensive, difficult, or otherwise not worthwhile to fix for now.
My two penneth: I've noticed that the number of friends which is displayed in my profile fluctuates (by 1)! I don't know what the reason for this inconsistency is but I suggest you keep checking that number in your profile regularly and see whether it's the case for you as well.
In terms of the Graph API the discrepancy between the friend count in my profile and in the data returned by the API is 2.

Publish limit on Facebook's Graph API

I've been using the Graph API for a while.
One feature of my application is that it allows a user to post a message on their friends walls (dont worry it is not spam).
Anyway...there is a limit on the API and it will only allow a certain number of posts before failing. I've read on the facebook bucket allocation limits but my app's limit has not moved. It was 26 when i created the app. It is still 26 even though there are about 20 users.
What can I do to increase my pulish limit?
And I promise this app is not used for anything spam related.
For those wanting an answer to this question: The posting limit is dynamic.
Facebook has implemented a bucket allocation system whereby each token/profile is given a set amount of posts per day (currently at 20-24). This allocation can go up or down based on the "affinity" your users show towards your application.
From Facebook:
Based on the affinity users show for your apps use of Facebook Platform through their interactions, your app is allocated certain abilities and limits. This is the functionality currently allocated to your app. These values will change over time depending on how users interact with your app. All integration points have a set of limit values and the threshold bucket column tells you which of these limits buckets your app is in for that integration point. Bucket 1 is the smallest allocation bucket.
If more people like/use your application, your posting limit will be increased. On the other hand, if you do not have traction or many people are marking posts from your app as spam, then the limit will be decreased.
You can find the current limit of your application by going to the App Page > View Insights > Diagnostics.
You can find the current limit under the Allocations header.
For some reason, FB doesn't clearly tell about this limit. The message quoted above is also nowhere to be found. The closest resources I came across on FB's website are these:
This one briefly talks about the allocation system but doesn't get into details
Also, I found a related FB REST API : But be aware, that this is REST API and should get deprecated soon.