How far back in time can you go with the Facebook API? - facebook

With the Facebook API are only recent things (wall posts, friends status updates etc) obtainable or is everything ever associated with the user's account obtainable?

That's a tricky question.
First nowhere in the official documentation says how many items you can get from Graph API nor FQL.
Not only this. Also when trying to do normal recently querys you may find out that not every result is returnes. Nor from the Graph API, FQL, not even from the FQL Test Console.
All this is because serious bugs in the Facebook Platform.
On october 15 Facebook said in its blog
We have received a great deal of feedback recently about things we should do to improve Facebook Platform. The themes are clear: “fix the bugs,” “update the documentation,” “talk to us more,” and “make things more reliable.” We are listening, and this post outlines some of the things we are doing to address your concerns.
This means that they are now fixing the bugs that has been accumulated on many months in Facebook Bug Tracker.
One of the open Bugs in there says:
When using a FQL Query or utilizing the new Graph API to grab posts on a users
stream, not all posts are returned.
From what I can see, the system will grab the latest posts from within the last
month, and then becomes extremely spotty after that. I am able to grab posts
from myself up to 4/24/2010, at which point every single wall post I have
posted seems to disappear.
Many other developers have states the same thing under the comments of this Bug.
On 2010-09-27 Jeff Bowen (Developer from facebook) said the following
Hi all, we still need to add this to the documentation but the stream table is
limited the last 30 days or 50 posts, whichever is greater. Sorry this wasn't
previously published.
This have made many people upset since they assumed you could get everything from the Graph API.
Anyway this is for multiple results. If you want a single result apperently (from the commnets in thts bug) You could go as far as June 15 2009
Personally, I haven't tested yet again so I don't know if this actully works the way they say. Facebook Graph API is in constant change. It has been incomplete and buggy since the begining. But now Facebook says they are working on that.
I recommend every facebook developer to sign up for the Facebook Platform bug tracking system since there is a lot of not official things about facebook, that will impact your applications.
I'll keep an eye on there to see if more is said on this topic and update this answer if needed

Related

Sending requests to facebook as a user from a third-party app

I need to initiate searches on facebook marketplace from my application on the user's device. This needs to happen on the user's device, and as the facebook user associated with the user using the application, to avoid getting blocked by facebook. As far as I can understand, this cannot be achieved using facebook's OAuth login and accessing the facebook information that is accessible through it.
Another hypothetical way that comes to mind, is to use the token that the user uses to login into facebook itself, though this one sounds frankly illegal.
tl;dr is there a way to run a search and retrieve the results on facebook marketplace as a user on a user's device?
I found your question on SO, and spent a good bit of time researching this, as I wanted to know the answer myself. Unfortunately, as best as I can tell, this is not possible through any official APIs. It seems like they may have once had something like this, as I found several links to FB API documentation that looked promising. But, the links all rerouted back to the Graph API homepage. I found a couple of references to the big data breaches FB has suffered in the last couple of years as possible reasons why their APIs were retooled and locked down.
I found several Facebook developer posts with questions about a Marketplace API where there were either no answers after months or years, or an official Facebook moderator posting a response like "This is a great idea, we always want to improve, use this form to submit your idea" and so on with no follow up.
I also found at least one SO post within the last 18 months where someone in the comments claimed to be able to post products to FB, but I think this was related to the Business Page Product Catalog, and is not what you're looking for. This is more like if a car dealership or something wants to post a new car for sale that's tied to their FB business page.
The Graph API allows for some decent searching and edge traversal but it is all related to posts, pictures, feeds, etc., and nothing related to the marketplace. Facebook pushes their Marketing APIs so heavily that it was tough to filter through that noise. And, of course, all of marketing apis are geared toward creating ads.
I found some Facebook information around API URLs looking like https://graph.facebook.com/search=terms&type=some_type that was very promising. But the type options seem to be limited to adcountry, adeducationschool, adeducationmajor, adlocale, adworkemployer, adkeyword, adzipcode, adgeolocation, and audienceinterest. And, as I dug deeper, it appears this is related to finding targeting groups for creating targeted posts. Nothing for marketplace.
I think that the answer, unfortunately, is that there are no offical FB APIs at this time that will allow querying search results from the Facebook Marketplace, much less provide enough information to reproduce a listing to display on a 3rd party app.

FB Comments. Missed old comments. Wrong comment counter number

I have a blog on Wordpress with installed "Simple Facebook comments" plugin. It working couple of years but some time ago i found out that for some posts Facebook API showing me "N" comments but display none.
I tried to add comment to this kind of post and comments counter showing "N+1" but i was able to see only one most recent comment. I was trying to receive all of existing comment via Open Graph API (example: http://graph.facebook.com/comments?id=http://blog.spafinder.ca/breaking-free-toxic-relationship/) but it returning only one comment after that i was requested comments number for the same post (REST API: http://api.facebook.com/restserver.php?method=links.getStats&format=json&urls=http://blog.spafinder.ca/breaking-free-toxic-relationship/ , GRAPH API: http://graph.facebook.com/?ids=http://blog.spafinder.ca/breaking-free-toxic-relationship/) and it told me that i have 2 comments.
I tried to clear OpenGraph cache, request comment number with another resources and it wasn't help.
Do you have any idea why it happening? I would be a very grateful if somebody will told me the possible way to solve that problem.
Thanks.
Based on the url you posted, that plugin seems to be using the Facebook Rest Server API which has been deprecated as noted below...
We announced the Graph API at f8 2010. Since that event, we have been working hard to ensure that the most important functionality that developers were using with the REST API is available via the Graph API. For the past several months we have been slowly launching new features in the Graph API to bring it up to parity with the REST API
This article is 3 years old so I wouldn't be surprised to find out that there are bugs in the existing deprecated API since they have dropped support for it. That said, be sure to read the documentation of the plugin you're using, they might have updated the plugin.
Also, if you wish to do this job manually, rather than depending on a third-party, be sure to read the documentation regarding this endpoint because permissions and default filters can affect the output...
https://developers.facebook.com/docs/graph-api/reference/v2.0/object/comments/

Receiving Facebook app error alerts - invalid parameters for "plugin:post"

Starting on July 30th, and every 3 days since, we've been getting this alert for our Facebook app, which is used on our site for Facebook Login and social posting:
In the last three hours 100% of the calls to the method plugin:post
resulted in errors.
Error Code 100
Error Description Invalid parameter
Error Count 5,971
Thing is, I have no idea what "plugin:post" is. Google and stackoverflow don't seem to know either, for that matter :) And 5,971 instances of it in 3 hours is more traffic than I would expect on our site.
Our codebase does not contain any references to "plugin:post", so I'm assuming "plugin:post" is an alias for some other functionality within the Graph API. I just don't know what. Anyone have an idea?
I did see there there is social plugin which uses an "fb:post" FBML style tag (https://developers.facebook.com/docs/plugins/embedded-posts/) that sounds like it could be related, but we don't use that plugin.
Any insight would be appreciated, thanks!
[Edit 9/13 for Azhar's question:]
I checked the July 2013 Breaking Changes, and nothing seemed like it would impact us.
[Edit 9/13 for Tobi's question:]
We're using:
- Open Graph API for social posting via the Feed dialog to either the user's news feed or a friend's news feed
- Facebook Login API to allow users to log into our site,
- Facebook Javascript api for geting user info (e.g. FB.api('/me'...), F.api('/me/friends'...), etc. ), and other data via FQL FB.api("/fql"...). I've verified that none of the FQL statements are impacted by the July 2013 changes.
I would post some code, but we have a fair amount of FB-related Javascript on the site, and I'm not sure which is the one causing the problem.
My Facebook app is receiving the exact same error message alerts from Facebook. I have exhausted all possible solutions and investigated every aspect of my logic, and I have concluded this is a bug on Facebook's side until someone can prove otherwise.
I have ignored these alerts so far and there has been no impact to my website or my users. Every integration point with Facebook works flawlessly using my personal Facebook account, test Facebook users and other non-admin users across all major browsers. Nothing appears wrong or broken.
When I investigate my Facebook app's insights and look at the developer view for activity and errors, I see plugin:post failures for the current month but when I go back one month there are absolutely zero API errors and it says "No API Errors". This is obviously wrong because I was getting alerts last month and this helps support my theory that the issue is on Facebook's side.
Turns out this was all due to a naming conflict in the HTML of our page. We had a page element with a class name of "fb-post". Facebook apparently treats this a "fb:post". Since our "fb-post" was not an actual FBML tag, it does not have the other parameters Facebook looks for in a post. So Facebook started giving alerts.
I suspect this is due to a change on Facebook's part, as we've had these "fb-post" elements in place for years now, without issue.
Incidentally, this is also the case for any elements with a class name of "fb-name", as Facebook treats that as "fb:name".

Facebook Insight data not appearing for website

I have recently been looking into adding Facebook Insights into one of our client's websites (www.mcvuk.com). I've created an app to associate with this and added the necessary Facebook meta tags to my site which reference the app id.
I was, until today, having issues adding the app domain information to https://developers.facebook.com/apps but have added this information in today.
My question is how long does it take before you will start to see results filter through for the site and is there any way of checking that everything has been set up correctly?
It might not be a matter of time, it might be a matter of how many 'likes' the app or page has. At least for pages, it tells you "Once 30 people like your Page, you'll get access to insights about your activity."
That's an interesting point.
It all depends on which metrics (results) you're after and how much traffic your app gets.
Additionally, you might want to look at facebook documentation for the metrics (results) you're looking for -- some of them are available monthly or weekly, others are a lifetime aggregate, and some are daily.
The easiest way to test would be to ask some of your friends to do whatever it is you want to test (comment on a post, link to a page, etc.).
I hope that answers some of your questions.

Why Facebook Graph Api or FQL does not work for high traffic pages?

I am having this problem. When I try to get the links posted by the user or page it works fine for all, except for high traffic users or pages like 'thebeatles' or 'ladygaya' or'machaeljackson' etc.
One thing we found out was that when you fetch links through graph api, it gives all the comments and evrythign back. In case of celebrity pages, there are thousands of comments, whcih are returned back, and cause to throw a curl exception.
So we switched using FQL and its better as it just provides the links, but in this case also FQL does not work for celebrity accounts. We just can't seem to understand why?
Did anyone come across this problem or know of any way to solve this?
Is it possible that you're trying to retrieve so many comments that it's timing out on Facebook's side?
Have you tried asking for a subset of the comments using offsets or timestamps? Check the 'searching' section of https://developers.facebook.com/docs/reference/api/ for more information
(disclosure: I work for Facebook in the Developer Relations team)