2

I really don't understand why it's not working. I have the right access token and userId. I even looked at a youtube tutorial [https://www.youtube.com/watch?v=9ptaVOk4DDo][1] and did everything accordingly ;(

All that it shows is a blank page, and the inspect thing says "Uncaught Error: No images were returned from Instagram". Is there something wrong with Instafeed.js? Is there any easier to use instagram api?

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>

<script type="text/javascript" src="js/instafeed.min.js"></script>

<script type="text/javascript">
  var feed = new Instafeed({
    get: 'tagged',
    tagName: 'summer',
    userId: ' ***',
    accessToken: '***',
    template: '<a href="\{\{link\}\}"><img src="\{\{image\}\}" /></a>',
    resolution: 'standard_resolution'
  });

  feed.run();
</script>
<div id="instafeed">
</div>
Ann
  • 41
  • 1
  • 2
  • this code snippet retrieves the tags of that user or all the public tags? I'm facing the same problem – Nelssen Aug 16 '16 at 12:52

1 Answers1

1

On June 1st 2016, Instagram rolled out new API restrictions, which limit users to accessing only their own content through the Instagram API by forcing each app into a sandbox. To get access to public content, your app must be manually approved by Instagram.

With the new rules, having Instagram tag feeds of public content isn't an acceptable use case, so even if you try to get your app approved, it most likely won't. So, with Instafeed you can only get your own posts, severely limiting its functionality.

See the discussion on Instafeed's Github.

p4sh4
  • 3,292
  • 1
  • 20
  • 33
  • 1
    Ok thanks for the clarification! I got it to work. Thankfully I need my own feed. For people that are code challenged like me, all I did was use this link. https://www.instagram.com/oauth/authorize/?client_id=...&redirect_uri=...&response_type=token&scope=public_content replace the dots with your client_id and redirect_uri and it generates a new userID and accessToken to use in your html – Ann Jun 06 '16 at 03:50
  • @Ann, that worked! But make sure that you include "http://" at the begining, and a trailing "/" at the end or your `redirect_uri`, both in your developer settings, and at the link. Also, the access token is returned in the url of your page. The first part is the `user_id`, and the whole string (including the first part) is the `access_token`. See the [Instagram API Docs](https://www.instagram.com/developer/authentication/) and look at "Client Side (Implicit) Authentication". (You will need to enable this in your settings.) – daviewales Aug 01 '16 at 05:05
  • @p4sh4 I have done this for one project, works fine, copied my code to another project and I get this error in console: `Uncaught Error: No images were returned from Instagram`. I have just changed the `userId` and `accesToken` from a working example... Any insights? – nclsvh Aug 29 '16 at 10:15