Posts from Instagram not showing up on Facebook Open Graph API

7.5k views Asked by At

I have an issue with Facebook OpenGraph API. Whenever I request data using either '/home' or '/feed', none of the posts from Instagram showed up.

I've been googling around and apparently some people raised the same issue with no solution yet. And I read some that the issue not only affecting posts from Instagram, but also other third-party app/device/platform.

Even the ticket posted on Facebook's dev page seems somewhat dead (no continuation). Link: https://developers.facebook.com/bugs/110563582419837/

If any of you guys also stumbled on this issue and has some ideas/pointers/links, please do share and let's discuss it.

Much appreciated. Cheers!

2

There are 2 answers

1
Igy On

There are two bug reports in Facebook's bug tracker about this: https://developers.facebook.com/bugs/110563582419837 and https://developers.facebook.com/bugs/202119973248747

The core reason is that the photos are attached to Open Graph actions as User Generated Photos and not via the regular Photo upload API.

As such, the regular photos permissions don't grant access to them and you need the user to specifically allow you the access their Open Graph activity for the app that posted the actions. The bug reports above are accepted on the basis that this appears to be an oversight in the case of actions with user generated photos, but it could also be by design in which case what i've outlined below as a workaround would be the only supported way to do this:

If you specifically need to request Instagram (or another Open Graph photos app) photos for a user, you can ask for Permission to access the actions posted by that app.

For Instagram photos you can do this by requesting the user_actions:instapp permission and once you've done that the Instagram Photos album will no longer appear to be empty, and the Instagram activity will appear in the feed connection.

To find out the namespace for an arbitrary app, access https://graph.facebook.com/<APP ID> and look for the namespace field,

e.g. for instagram, a call to https://graph.facebook.com/124024574287414/?fields=id,namespace returns:

{
  "id": "124024574287414", 
  "namespace": "instapp"
}

A sample photo from my own /feed connection, retrieved with the read_stream, user_photos, user_actions:instapp permissions, is:

{
  "data": [
    {
      "id": "[SNIPPED]", 
      "from": {
        "name": "[SNIPPED]", 
        "id": "[SNIPPED]"
      }, 
      "picture": "[SNIPPED]", 
      "link": "https://www.facebook.com/photo.php?fbid=[SNIPPED]", 
      "icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yb/x/StEh3RhPvjk.gif", 
      "privacy": {
        "value": ""
      }, 
      "type": "photo", 
      "object_id": "[SNIPPED]", 
      "application": {
        "name": "Instagram", 
        "namespace": "instapp", 
        "id": "124024574287414"
      }, 
      "created_time": "2013-01-07T17:33:04+0000", 
      "updated_time": "2013-01-07T17:33:04+0000", 
      "comments": {
        "count": 0
      }
    }, 

I can also access the /photos connection of my 'Instagram Photos' album with the same permissions, and can access all Instagram 'take' actions (i.e the photos) at /me/instapp:take

1
Jesse Chen On

Facebook employee here. Looking at the internal task that is tracking this issue, all I can say at this time is that this is an issue that we are currently aware and investigating into. If you would like to be notified of any updates, be sure to click "subscribe" on the bug report.

For the time being, I recommend finding the album ID of the user named "Instagram Photos", then calling a GET request to /INSTAGRAM_ALBUM_ID/photos to get their Instagram photos. On the Graph API Explorer tool, I confirm that I am able to fetch all of my instagram pictures. Since my album is public, you should be able to view them as well.