Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use Instagram's API to display a gallery of my own photos?

Tags:

api

instagram

I'd like to use Instagram's API to display a gallery of just my own photos on a webpage. Is this possible?

like image 623
chimerical Avatar asked Sep 18 '12 14:09

chimerical


People also ask

Can Instagram access my gallery?

Instagram is collecting your location data, the device you're using, the network you're on, and it can access your entire photo library — among many other datapoints. And all of this was explicitly allowed by every one of its billion-plus users.

What can I do with the 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.


2 Answers

Take a look here: http://instagram.com/developer/endpoints/users/

Most of the endpoints require users to be authenticated. You can retrieve tagged pictures and popular pictures without authentication. In order to display your own, you would need a user to be logged in with Instagram.

EDIT: Check this out: http://www.blueprintinteractive.com/blog/how-instagram-api-fancybox-simplified

like image 198
tcd Avatar answered Oct 10 '22 02:10

tcd


Method 1 - Use Instagram API

No you don't always need the Access Token. You can also use the Client ID like in this API request - https://api.instagram.com/v1/tags/nofilter/media/recent?client_id=CLIENT-ID

User Photos Endpoint -
https://api.instagram.com/v1/users/{user-id}/media/recent/?client_id=CLIENT-ID

You will need to replace your User ID in the above URL. The output will be a JSON response so you will have to display the photos yourself.

Method 2 - Use a Plugin

You can directly use a plugin that will embed your Photos from your Instagram Account onto your website. A good Example would be - InstaMax plugin which will display all your photos, videos with likes and comments.

A small Demo of the plugin is present here - http://demos.codehandling.com/instamax_demo/instamax_live_edit.html

Update 2016

Method 1 will not work after June 2016 due to changes in Instagram API. You need to have you app approved from Instagram and then generate an Access Token.

  1. Generating the Token is the easy part. You can simple use the below API from your browser -

    https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token

  2. Frankly, the hardest part is getting your APP approved from Instagram. It took me a month and several rejections to understand what their platform policies are and how to send the request for approval.

I would recommend you to use a plugin that already has an approved App so that you can use their App to generate Tokens for their plugin.

like image 24
Patrick Avatar answered Oct 10 '22 04:10

Patrick