24

We are showing feeds from Facebook on our website. Until yesterday, we were able to retrieve the feeds in JSON format using the URL below:

https://www.facebook.com/feeds/page.php?format=json&id=[id_of_the_page]

But today I found that the link was broken. Is there a reason for it breaking?

And is there a way that I can access the JSON feed for my page using the new Graph API?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
TejSoft
  • 3,213
  • 6
  • 34
  • 58
  • 1
    File a bug at https://developers.facebook.com/bugs – WizKid Jan 29 '15 at 00:47
  • 1
    This is not a bug... @user2789978 You should follow the FB API changelog regularly, this was announced on October 30th 2014: https://developers.facebook.com/docs/apps/changelog#v2_2_90_day_deprecations – Tobi Jan 29 '15 at 10:20
  • @Tobi In practice this is not the case, people don't read FB API changelog. This deprecation also included RSS feed, which for me is pain. – Ciantic Jan 29 '15 at 12:49
  • 1
    @Ciantic Well, they should if they heavily rely on FB functionality. Everything else is just negligent – Tobi Jan 29 '15 at 12:59

2 Answers2

23

Finally I was able to get the Facebook page feeds back on my website. Here goes the steps I followed to restore the feeds:

Step 1: I logged into Facebook developer portal and created new Facebook Application (Website). You can find the details on how create a Facebook App from the following link: How to Create Facebook App

On the newly created app you will find the "App ID" and "App Secret" values.

Step 2: On my website, I used the "App ID" and "App Secret" to retrieve an "access_token" from Facebook. I used C#, so the line of code I used was:

string access_token = "";
try {
    access_token = webClient.DownloadString("https://graph.facebook.com/oauth/access_token?client_id=616255239999&client_secret=989898989898acec7c3aabbccddf84b66&grant_type=client_credentials");  
}
catch {}

Replace client id with app id and client secret with app secret values copied from the previous step. If the values are correct you will get a response like:

access_token=616255878567492343|UYgAYWXYztpFGRawnZ2VlTE

Step 3: Now use the access token retrieved from the previous stage to call Facebook Graph API to get the feeds:

string facebookjson = webClient.DownloadString("https://graph.facebook.com/v2.2/1730999949494/feed?access_token=616255878567492343|UYgAYWXYztpFGRawnZ2VlTE");

The construct of the URL would like below:

https://graph.facebook.com/v2.2/[your_facebook_page_id]/feed?access_token=[your_access_token_value]

And voila!! You get the feeds from your Facebook page in a JSON response.

TejSoft
  • 3,213
  • 6
  • 34
  • 58
  • 1
    Thanx! Hope you changed your client_secret since this post ;) – Tommy Bravo Jun 24 '15 at 10:53
  • use this link for latest API and for posts that is only posted by the page https://graph.facebook.com/v2.3/[Page_ID]/posts?access_token=[Access_Token] – Atef Jul 08 '15 at 15:32
  • 1
    @TejSoft how to get rss format feed? (.xml) with the example I am able to get json format – Chandra Sekhar Jul 21 '15 at 20:08
  • @ChandraSekhar, you can parse the JSON and output it as RSS (xml). But RSS feeds are being phased out by most of the social networks. I would recommend using JSON to read and then display the post as per your need (on website or app). – TejSoft Jul 22 '15 at 01:38
15

See the ChangeLog. https://developers.facebook.com/docs/apps/changelog

90-day deprecations (effective Wednesday, January 28, 2015).

The Pages JSON feed (e.g. https://www.facebook.com/feeds/page.php?id=%2019292868552&format=json) is now deprecated and will stop returning data from Jan 28, 2015 onwards. Developers should instead call the feed edge on the Graph API's Page object: /v2.2/{page_id}/feed.

And the announcement from Facebook Team. https://developers.facebook.com/bugs/1539780319626180/

Firstly, I want to apologise. Due to a bug the Page RSS feed was removed yesterday in addition to the Page JSON feed.

We are restoring the Page RSS feed immediately. The fix should be deployed in the next 24 hours and I'll let you know as soon as the RSS feed is functional again.

Please note that we will be deprecating the Page RSS feed in the first half of this year. We'll announce a 90 day breaking change as we did for the Page JSON feed.

The reason we're deprecating the feeds is due to a lack of usage (versus the Graph API Page feed). We have decided to focus our efforts on adding features to and improving the quality of the Graph API Page feed endpoint.

cafedeichi
  • 745
  • 1
  • 10
  • 25
  • 2
    It looks like maybe they've made this change permanent now. All my IFTTT triggers that relied on this feeds/page.php URL all broke this morning. What a pain in the butt. – Nathan Beach Jun 28 '15 at 12:55