PHPackages                             blackmagic/instagrammedia - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. blackmagic/instagrammedia

ActiveCraft-plugin[API Development](/categories/api)

blackmagic/instagrammedia
=========================

Plugin to retrieve instagram media using Facebook's Instagram Basic API

1.0.0(6y ago)3967[1 issues](https://github.com/wearealloy/craft3-instagramFeed/issues)MITPHPCI failing

Since Mar 9Pushed 6y ago2 watchersCompare

[ Source](https://github.com/wearealloy/craft3-instagramFeed)[ Packagist](https://packagist.org/packages/blackmagic/instagrammedia)[ RSS](/packages/blackmagic-instagrammedia/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

InstagramMedia
==============

[](#instagrammedia)

Craft 3 CMS Plugin to retrieve Instagram media (from an account you have access to) using Facebook’s “Instagram Basic API”

I created this plugin to streamline and facilitate a way to retrieve data from an Instagram account that I have access to. As of now this plugin, will not auto-renew long live token. In order to renew it you have to re-save the plugin before the token expires.

#### Requirements:

[](#requirements)

- Craft 3
- espresso-dev/instagram-basic-display-php

#### Installation

[](#installation)

```
cd /path/to/project
composer require heyblackmagic/instagrammedia
./craft install/plugin instagrammedia

```

#### Configuration

[](#configuration)

In order to work with Facebook's Instagram Basic API you need to have previously created an application with a Facebook Developer account. Please follow intructions [here](https://developers.facebook.com/docs/instagram-basic-display-api/) if you are not sure how to achieve this.

After the application is set up, you should have a Instagram App Id, Instagram App Secret and Instagram App Redirect URI.

1. In Craft CMS, switch to the Settings page in the control panel and enter the values mentioned above and **click Save**. If all the fields are entered correcltly, after saving, you should now see a Get Auth Link red button and an empty field for Instagram's API Token.
2. Click "Get Auth Link", this will redirect you to a 404 page (this is intended) inside your site. The URL should look something like this: `https://mywebsite.com/auth/?code=AQBx-hBsH3...#_`
3. Copy the code between (exclusive) the `=` and `#_`Note that `#_` will be appended to the end of the redirect URI, but it is not part of the code itself, so strip it out. Paste this code in the Instgram API Token field in the plugin's settings and **click Save**.

If everything was set up correctly you should now see a **Conection succesfull to Instgram's API** message and an expiration day equal to 60 days. In order to renew the token before it expires you just have to save the plugin and it will renew the long-live token.

#### Usage

[](#usage)

To fetch the media from your account call `getMedia()`you can check all available fields on [Instagram Basic API Docs](https://developers.facebook.com/docs/instagram-basic-display-api/reference/media#fields)

Eg:

```
{% set media = craft.instagram.getMedia() %}
{% for item in media %}

		...

{% endfor %}

```

Here is an example if you need to check if the item has a caption or if the item is a video or an image. You need to make this check because images and videos have different sources for image url and video thumbnail respectively:

```
{% set media = craft.instagram.getMedia() %}
{% for item in media %}
	{% set permalink = item.permalink %}
	{% set caption = item.caption is defined ? item.caption : 'Instgram Picture' %}

		{% if item.media_type == 'VIDEO'%}

		{% else %}

		{% endif %}

{% endfor %}

```

#### To Do:

[](#to-do)

- Add auto renew of long live token.
- Better error handling.
- Add limit on how many posts to retrieve.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2261d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/53dc664bec0e524c489a9e8e809b89ca015c43c253d4cdff383405304f9331b8?d=identicon)[jsosaheyblackmagic](/maintainers/jsosaheyblackmagic)

---

Top Contributors

[![jorgeduardos](https://avatars.githubusercontent.com/u/22121792?v=4)](https://github.com/jorgeduardos "jorgeduardos (8 commits)")[![wearealloy](https://avatars.githubusercontent.com/u/10222989?v=4)](https://github.com/wearealloy "wearealloy (1 commits)")

---

Tags

cmsCraftcraftcmscraft-plugininstagrammediainstgraminstgramfeed

### Embed Badge

![Health badge](/badges/blackmagic-instagrammedia/health.svg)

```
[![Health](https://phpackages.com/badges/blackmagic-instagrammedia/health.svg)](https://phpackages.com/packages/blackmagic-instagrammedia)
```

###  Alternatives

[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36205.0k3](/packages/wrav-oembed)[craftpulse/craft-typesense

Craft Plugin that synchronises with Typesense

122.7k](/packages/craftpulse-craft-typesense)[jsmrtn/craftagram

Grab Instagram content through the Instagram API

141.3k](/packages/jsmrtn-craftagram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
