Introduction
Many websites may require displaying images uploaded on Instagram directly on their website. Instagram provides an API that can be utilized so that a person doesn't have to upload the images to the website separately; they can be listed automatically.
Step 1: Account Requirement
An Instagram account is required for login. If you have an account, then login to your Instagram account with your Email ID or Mobile Number and Password. Alternatively, you can log in using a Facebook account too.
Otherwise, you have to create an account on Instagram and log in with that account. If you are a new user, you must upload images to your Instagram account first to see any results.
Step 2: Generate Access Token Key
You need to generate an Access Token Key to communicate with the API. You can use the following link:
http://instagram.pixelunion.net/
Click on the button displayed on the website: Generate Access Token.
If you are not logged in currently, you will be prompted to log in with your Instagram credentials.
Format of the Generated Token:
Step 3: Fetching Images via API
After generating the Access Token Key, integrate it with the API to fetch images from your Instagram Account. We are using a PHP Curl Session for integrating the API.
Step 4: Displaying the Images
The $result variable now contains the JSON decoded data array. You can access the values in this array on your view page to display all the Instagram images on your website.