Filter and Hooks

Fetch Instagram feed without using access token

Hello visitor, if you are trying to display Instagram Feed without access token this article might be handy for you.

I have used Guzzle to send send HTTP requests using a GuzzleHttp\ClientInterface object. You can install Guzzle using composer.  To get the detail information about the Guzzle, you can follow the documentation. In the below code, please replace {USERNAME}  by your Instagram username.

I have indicate Instagram URL to the client, building an HTTP GET request via the $client->get() method.
Finally, to see the response from the server, I have execute the $request->getBody() method.

You can use var_dump() function to dump information about your Instagram i.e var_dump($instaContents) and use the necessary information to display in your feeds. I just need the url and image from my feeds therefore, I have used short-code to generate the url of feed.

If the https://www.instagram.com/{USERNAME}/?__a=1, doesn’t work, please follow the documentation to create Instagram App and generate access token for displaying the Instagram feed .

Hits: 52

Standard