Plugin: InstagramAPI – Endpoints access (BETA)

Kirby CMS User-Field, Tag and Page Method to access Instagram API Endpoints. This is a boilerplate to create your own Instagram embeds.

Use this plugin to simplify the secured api authorisation to a few clicks and show your Instagram images and metadata without any fixed styling embed codes.

This is not an Embed Code Plugin but grants you access to all API Endpoints. It works without implicit OAuth and can use Signed Requests.

NOTE: This is not a free plugin. In order to use it on a production server, you need to buy a license.

Key Features

  • access Instagram API Endpoints
  • use snippets to customize the output
  • simply extend existing Kirby CMS User-Accounts with Kirby User Roles
  • includes helper to cache images


Please note that the plugin is in beta right now, but everybody submitting a valid issue will be awared with a coupon.

Add Field to Role Blueprint

Add the instagramapi field by extending a role blueprint to existing user accounts.

# site/blueprints/users/admin.yml
  instagramapi: instagramapi

Quick Tour

Once installed, configured and authorized you can output your images like this:

use the Kirby-Tag

(instagramapi: mykirbyusername endpoint: users/self/media/recent snippet: ia-example-media)

or plain php

// snippet
snippet('ia-example-media', ['user'=>'mykirbyusername', 'endpoint'=>'users/self/media/recent']);

// page or site methods
$result = $page->instagramapi('mykirbyusername', 'users/self/media/recent');
foreach($result['data'] as $data) { /*...*/ }

new release v0.7.3-beta

you can now use this plugin without extending a user. simply provide the account, clientid and token yourself. read more about it in the github readme topic.

thanks to @ola for bringing this issue/idea forward.

Kirby Tag

(instagramapi: TOKEN endpoint: users/self/media/recent snippet: ia-example-media)

Page Method

$result = $page->instagramapi('TOKEN', 'users/self/media/recent');
foreach($result['data'] as $data) { /*...*/ }


or set a default value

c::set('plugin.instagram-api.default-token', 'TOKEN');

i have needed some similar feed on one of my sites. I did it in dumb way (found out that instagram spits /media json feed with everything i need without auth). The thing is the /media is probably heavily rate limited so it stopped working after people started using it :D. I should have known better.

Now what i am asking - is your plugin making any cashing? I have noticed the instagram api being quite slow anyway and especially their images are superslow so i am thinking about cashing it on my side. It wouldn’t make any difference to me if i use authorized api or just the /media because i would be making the request only from time and cash. Is this something your plugin does or its focused on auth to instagram api?


hi @krisa. thanks for asking about a cache. thats a nice addition to the plugin, so I just did that right away.

new release v0.8.0
added response caching
you can activate the plugins caching in your site/config.php. example cache for a day

c::set('plugin.instagram-api.cache', 24*60*60); // time in seconds. default is 0

there is also a caching helper available for images. its pretty basic and generates cryptic filenames, but you could write your own based on that one if needed.