Steps : How to display Instagram uploaded images on website :
Firstly, 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,
Or, You have to log in to your Facebook account using your Facebook account id and password,
Otherwise, You have to create an account on Instagram and log in with that account on an Instagram website.
Link to Instagram Website for Login or Create New Account -
If you are the new user, then you have to Upload Images to your Instagram account.
Generate Access Token Key with the following link for your Instagram account.
You have to click on the button that is displaying on the website for generating Access Token Key. – Generate Access Token.
You are not logged in currently, then log in with your Instagram email id and password.
After login to your account successfully, you will get Access Token.
After generating Access Token Key, integrate this Access Token key with API for fetching images from your Instagram Account.
Format of the Generated Token:
API for fetching Images via Access Token Key. We are using Curl Session for integrating API.
$accessToken = "544758xxxx.xxxxed0.fb27d9db186f47168eed3b9534de5f78";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
$result = curl_exec($ch);
$result = fetchData("https://api.instagram.com/v1/users/self/media/recent/? access_token=".$accessToken);
$result = json_decode($result);
Access $result array value on the view page where you want to display all the Instagram images on the website.
Harshita Maheshwari - Jr. Software Engineer