How to get instagram feeds in json format to display on you website?
we can easily get feeds but if we need to display in desired format then we need this in JSON format. Follow the steps below.
- Login to Instagram account (which account’s feed you want to retrieve) and go to “https://instagram.com/developer/clients/manage/“.
- Now click on “Register a client” and add ‘Website URL’ & ‘Valid redirect URIs’ as your website where you want to show Instagram feeds.
- You will get a client ID and client secret code. Now you need to get the access token to continue.
- To get access token you have to hit the url “https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code“. (CLIENT-ID -> you have this id, REDIRECT-URI -> you have this url)
- After this you will get the access token.
- Now you can get all Json feeds $feeds = file_get_contents(‘https://api.instagram.com/v1/users/USER-ID/media/recent?client_id=CLINT-ID&access_token=ACCESS-TOKEN‘);
- Best of Luck. You can use these Json fields as you want.