Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Credentials to Fetch Account's Latest Images Using New Instagram Graph API?

I'm trying to display a gallery of images on a website for a client. Those images should be fetched from their Instagram account automatically. Simple, right? Well, it used to be...

I can't use the Instagram API, because it's being deprecated: https://www.instagram.com/developer/

So instead, I'm trying to use the Instagram Graph API to get the latest images for the account: https://developers.facebook.com/docs/instagram-api/reference/user/media#get-media

Skip to the bottom for the short version, or keep reading for the long version.

Long Story

Trouble is, I'm having a very hard time understanding how to even get the credentials to interact with this API. As best I can tell, I need to create four separate things first:

  • An Instagram Business Account (done)
  • A Facebook User (done)
  • A Facebook Page (done)
  • A Facebook App (done...ish)

I'm not even sure if I need to create all of those things (especially the app), but that's where I'm at now. And I'm trying to figure out what permissions I need based on this page: https://developers.facebook.com/docs/facebook-login/access-tokens#apptokens

I'd think I need an "app access token", and from what I understand I can instead use the app ID and app secret combined in place of the app access token, and that actually seemed to sort of work.

I then tried to get the Instagram ID I need based on the linked Facebook page, which I did with this call (with the real Facebook account ID and the proper token): https://graph.facebook.com/some-facebook-account-id-here?fields=instagram_business_account&access_token=something-here|and-here

The response to that call was:

{
   "error": {
      "message": "(#10) To use 'Page Public Content Access', your use of this endpoint must be reviewed and approved by Facebook. To submit this 'Page Public Content Access' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.",
      "type": "OAuthException",
      "code": 10,
      "fbtrace_id": "[redacted]"
   }
}

And then I went down a rabbit hole of trying to submit the "feature" for review, but that ended with me running into a catch 22 where it was asking me to have a live working demo of the thing I'm asking for access to. I don't understand how I can have a live working demo when I don't even have access to it yet.

Long Story Short

Long story short, this seems obscenely complicated for something that should be very simple. Maybe I'm just doing this wrong?

What would you do if you were in my shoes in order to gain access to the Instagram Graph API so that you can fetch a few images from a specific Instagram account to display on a website?

like image 793
Nicholas Westby Avatar asked Jun 28 '18 17:06

Nicholas Westby


People also ask

What information can you get from Instagram API?

The API can be used to get and publish their media, manage and reply to comments on their media, identify media where they have been @mentioned by other Instagram users, find hashtagged media, and get basic metadata and metrics about other Instagram Businesses and Creators.

Does Instagram API still work?

On the 29th of June, 2020, Instagram will stop using the old API (“Basic Permission”) to display photos from personal Instagram accounts to widgets. 3rd party apps using this, current API will no longer be able to display photos from your account if they don't switch to the new API after this date.


1 Answers

Now if you want to access Instagram post you have two options

  1. To use Instagram Graph API For Business Account
  2. To use Instagram Platform API For non-business account

Assuming you have business account

Here is link to get started

Note:-

None business account Instagram supports only basic permission

Starting 10/1/2017, all permissions other than the basic permission will be unavailable to submit for or obtain.

This is what they have to say about Instagram api for non-business accounts

Even on Facebook developers plateform they say

The Instagram Graph API allows you to programmatically access Instagram Business Accounts

Here is SO thread that discusses about it,

So, in short, it's very hard to use APIs for Non-Business accounts

like image 198
Mihir Dave Avatar answered Oct 06 '22 06:10

Mihir Dave