Facebook Graph API /{page-id}/posts - only 600 posts per year? - facebook

Currently I am writing a wrapper around the Facebook Graph API to collect all the posts made on specific pages.
For some reason, I am only able to query 600 posts per year. When there is more than that on a page, the API does not complain but randomly leaves out posts. To me there is no rhyme or reason which posts are left out: Certain weeks are completely unaffected, while for others I only get a partial amount of posts or none at all.
Carefully reading the API yields this statement:
The API will return a maximum of 600 ranked, published posts per year.
So, it seems like this is intended behavior.
However, this question from 2015 suggests that this limit is a bug.
Furthermore, I am able to retrieve the full list of posts via the data export of the insights tab in Facebook itself. It seems bizarre to me that I am not able to do the same with the API.
Essentially I have three questions:
Is the year limit intended behavior?
If the limit is intended, what determines which 600 posts are returned per year?
If the limit is intended, is there a way to get around it to retrieve a full list of post(-ids)?

Yep, I've seen this myself, particularly with pages that publish in high frequency such as newspapers. When retrieving posts historically there can be single days missing, the odd week and sometimes a whole month. The only way to not miss any posts is to call the API daily but this only helps moving forward. Or you can contact me and I'll see if we have the posts you're looking for ;-)

Related

Facebook Graph API | Marketing Insights - Count Shares and Likes, Haha, Love...Etc for an AD

Is it possible to get Share Count as well the actions count for likes, ahah, dislike etc via the Facebook API / Marketing insights?
So far I'm able to get this data for posts(which are related to ads if promoted), but this is a lifetime metric I can't have the numbers in a daily basis, unless I calculate it by doing the difference once I have the data.
Also, I would never now, if the likes are being made by someone who saw my post somewhere because its promoted, or if that person went directly to my page.
Is there any way to achieve this results?
If you look at the actions field in insights, you should see a field called post_reaction which is the total number of reactions for your ad in the requested timeframe.
To get a daily breakdown, use time_increment=1 and time_range to specify the date range.
I don't believe we provide breakdowns on the different reaction types however.
Docs for parameters:
https://developers.facebook.com/docs/marketing-api/insights/parameters/v2.9

Facebook post IDs changed en masse today

I collect data across several hundred Facebook accounts daily. To keep track of which posts I already have versus which ones are new, I use the post ID and only collect those with IDs I've not already stored (or update likes/shares/comment counts if I do already have them). I use the Graph API "posts" node
https://graph.facebook.com/(FB account name)/posts
I've already been doing this for over a year. However, in today's update, I noticed I had collected about 1000 times the number of "new" posts that I usually collect (and checked my daily counts across the past few weeks to make sure), and that these new posts were distributed across the few hundred accounts I collect data from. On closer inspection, I discovered that it appears they're duplicates of posts I already had and that they were collected because their post IDs had changed (sometimes only by a digit, sometimes quite a lot). I can see both the original and duplicate post data in my database. Some of the posts are over a year old, and this happened across many accounts, so I think post updates being the culprit are out of the question.
An example is this set of post IDs from HyVee:
84150862796_10152725672357797 (new)
84150862796_10152725672477797 (original)
Oddly, both of these IDs work when using the graph explorer tool and seem to return the same post content.
I've never noticed such an event before and I don't think the code that collects the data has been changed in a long while. At the same time, I find no mention of this the phenomenon when searching for it, and I expect many people would be talking about it if post IDs suddenly changed, as a lot of things would break, I imagine. The account whose API key is being used to collect the posts has also not changed in any way.
Is this kind of thing unheard of? Are post IDs not intended for long-term tracking of posts? What could have caused this?

Facebook app blocked for posting too fast. What are the limits?

We (a local hackerspace) have a Tumblr blog and wanted to make ourselves a Facebook page. Before going live we wanted to import all our Tumblr content to Facebook so our fans on Facebook can browse it here as well. For this I have made an app that reads all the posts from our Tumblr blog and publishes them to our new Facebook page (backdating those posts as well). Here's my problem: after the app does about ~130 re-posts (~260 operations: publish + backdate) I start getting an error:
Received Facebook error response of type OAuthException: It looks like you were misusing this feature by going too fast. You’ve been blocked from using it.
Learn more about blocks in the Help Center. (code 368, subcode 1390008)
The block is gone the next day, but after a similar amount of operations it's back. After a couple of hours later, when the block is gone again, I introduced 6 second delays between operations, but that didn't help and after 19 re-posts I'm blocked again. Some facts:
I am publishing posts to a feed of (yet) unpublished page I am the (only) owner of.
The app is a standalone JAVA application and uses restfb to work with Facebook.
The line that is causing the error: facebookClient.publish("me/feed", FacebookType.class, params.toArray(new Parameter[0]));
All publish operations contain a link, mostly to respective posts on out Tumblr. Some contain message, caption or a name (depending on post type).
I need to re-post ~900 posts from Tumblr, I have done ~250 so far. When over, I will likely put in on server, scheduled, to keep syncing single new posts.
This app is not meant to be used publicly, it is rather a personal utility (but the code will be posted to GitHub, should anybody need it).
This is my first experience with Facebook API and I wasn't able to find a place where I could officially address them with this question. I could proceed by doing 100 posts/day, but I'm afraid I will eventually get banned for good, even though I don't feel like doing anything wrong.
I haven't put any more code here, as the code itself does not seem to be a problem, but rather the rate at which it is executed.
So, should I proceed with 100 posts/day and hope I won't be banned, or is there another "correct" way of dealing with this?
Thanks in advance!
I'm answering a bit late but I just had this problem too so I did some research : it seems that besides the rate limits shown in Facebook docs, there's also a much more limited and opaque rate for POST requests to limit spam.
It's not clearly set but it could depend on your relationship to the page you're writing to (admin or not), if you post to multiple pages and finally if you post too quickly.
To answer the question, it seems that it would have been okay if you had done like 1 post per minute or less.
I think you exceed the rate limiting for your user Id.
- Your app can make 200 calls per hour per user in aggregate. As an
example, if your app has 100 users, this means that your app can make
20,000 calls. One user could make 19,000 of those calls and another
could make 1,000, so this isn't a per-user limit. It's a per-app
limit
- That hour is a sliding window, updated every few minutes
- If your app is rate limited, all calls for that app will be limited, not
just for a specific user
- The number of users your app has is the
average daily active users of your app, plus today's new logins
Check this: https://developers.facebook.com/docs/graph-api/advanced/rate-limiting
It looks like you were misusing this feature by going too fast. You’ve been blocked from using it.
Learn more about blocks in the Help Center.
If you think you're seeing this by mistake, please let us know.

Retrieving friend count delta

I've been looking through the Facebook-graph API for a way to get a kind of 'delta' of friend changes since a given date. it looks like the /<id>/friends end point will give me a total count at the current time. What I'd like is that same value but for a historic date (i.e. where the date is this time last year, so that I can see how many friends someone has made/lost since then).
(I was originally hoping Facebook would just let me see when people became friends, but it looks like a user's friends list, and all the related details, are off limits).
Unfortunately I can't just rely on the use of future dates, though that may be the solution I end up with (as in, I request the count at the current date, and then at some point in the future request it again and compare the difference).
I can see from my own Facebook account that they do track when a friend/connection was made, and I'm not looking to dig up details on the friend/connection. Ideally I'm looking for something like /<id>/friends?asat=<date>
As a follow up question assuming this feature isn't available through the facebook-graph API, how would I go about requesting this feature for a future version?
There is no way to get the history, you can only call the API endpoint on a regular basis and store the difference with date on your own.
Feature requests can be sent here: https://www.facebook.com/help/contact/268228883256323
...although, i doubt that they will implement this, to be honest. Those kind of "insights" are usually only available for Pages, but not for User Profiles.

Collecting Data from Facebook Group

I'm not one of the Facebook Developer, but I need some data for my thesis, regarding one group in Facebook which I'm currently observing.
The problem is, I must collect the data within the last 6 months of:
how many members have joined in the last 6 months, if possible, can be split by monthly.
how many postings in the group in the last 6 months, also.. if possible split by monthly
how many active users within the last 6 months.
Can somebody give me some hints of how to collect those information?
You're going to have a hard time doing this. Groups aren't very API friendly, and they don't have their own insights information.
You can try browsing the group's feed using the Graph API Explorer using the /GROUP_NAME_OR_ID/feed edge, and adding since and until filters to look at monthly data.
However, you won't see all the posts because of Facebook privacy filtering. To get the most reliable data, you'll need to manually count the entries of interest from within the Facebook webapp.