PHPackages                             marcorieser/statamic-instagram - 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. marcorieser/statamic-instagram

ActiveLibrary[API Development](/categories/api)

marcorieser/statamic-instagram
==============================

Statamic Instagram Business API lets you fetch data via the Instagram Business API into your Statamic site.

v2.5.0(1mo ago)41.0k—0%1proprietaryPHPPHP ^8.2

Since Nov 27Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/marcorieser/statamic-instagram)[ Packagist](https://packagist.org/packages/marcorieser/statamic-instagram)[ RSS](/packages/marcorieser-statamic-instagram/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (12)Used By (0)

Statamic Instagram Business API
===============================

[](#statamic-instagram-business-api)

> Statamic Instagram Business API lets you fetch data via the Instagram Business API into your Statamic site.

Features
--------

[](#features)

- Fetch Instagram posts via Meta's [Instagram Business API](https://developers.facebook.com/docs/instagram-platform)
- Fetch Instagram profile data via Meta's [Instagram Business API](https://developers.facebook.com/docs/instagram-platform)
- Auto refreshing of Access Tokens

How to Install
--------------

[](#how-to-install)

You can install this addon via Composer:

```
composer require marcorieser/statamic-instagram
```

How to Use
----------

[](#how-to-use)

### Installation

[](#installation)

- Install the addon
- Publish the addon config by running `php artisan vendor:publish --tag=statamic-instagram-config`
- Add your Access Token to the `account` section in the published config file. If you do not have a token, follow the instructions below.

### Creating a Meta App / an Access Token

[](#creating-a-meta-app--an-access-token)

Create an Access Token for the API with these steps:

- Login with your Instagram credentials at
- Create a new app (choose `Other` as use case and `Business` as the app type)
- Add `Instagram` as a product to your app
- Link your instagram account at `1. Generate access tokens` in the `API setup with Instagram login` section of your app
- Generate a token and add it to the config in Statamic

Further information on that topic in Meta's [docs](https://developers.facebook.com/docs/instagram-platform/instagram-api-with-instagram-login/create-a-meta-app-with-instagram).

### Display the feed

[](#display-the-feed)

There is a `{{ instagram:feed }}` tag, that fetches the media from the API and returns them as an array.

- The `limit` parameter defaults to `12`.
- The `handle` parameter defaults to the first account in the config.

```
{{ instagram:feed limit="12" handle="rickastley" }}
    {{ id }}
    {{ caption }}
    {{ comments_count }}
    {{ is_shared_to_feed }}
    {{ like_count }}
    {{ media_product_type }}
    {{ media_type }}
    {{ media_url }}
    {{ permalink }}
    {{ thumbnail_url }}
    {{ timestamp }}
    {{ username }}

    {{ children }}
        {{ id }}
        {{ comments_count }}
        {{ like_count }}
        {{ media_product_type }}
        {{ media_type }}
        {{ media_url }}
        {{ permalink }}
        {{ thumbnail_url }}
        {{ timestamp }}
        {{ username }}
    {{ /children }}
{{ /instagram:feed }}
```

### Display a specific media

[](#display-a-specific-media)

There is a `{{ instagram:media }}` tag, that fetches just one specific media.

- The `id` parameter is required.
- The `handle` parameter defaults to the first account in the config.

```
{{ instagram:media id="18051623968824939" handle="rickastley" }}
    {{ id }}
    {{ caption }}
    {{ comments_count }}
    {{ is_shared_to_feed }}
    {{ like_count }}
    {{ media_product_type }}
    {{ media_type }}
    {{ media_url }}
    {{ permalink }}
    {{ thumbnail_url }}
    {{ timestamp }}
    {{ username }}

    {{ children }}
        {{ id }}
        {{ comments_count }}
        {{ like_count }}
        {{ media_product_type }}
        {{ media_type }}
        {{ media_url }}
        {{ permalink }}
        {{ thumbnail_url }}
        {{ timestamp }}
        {{ username }}
    {{ /children }}
{{ /instagram:feed }}
```

### Display profile data

[](#display-profile-data)

There is a `{{ instagram:profile }}` tag, that fetches the profile information from the API and returns them as an array.

- The `handle` parameter defaults to the first account in the config.

```
{{ instagram:profile handle="rickastley" }}
    {{ id }}
    {{ followers_count }}
    {{ follows_count }}
    {{ media_count }}
    {{ biography }}
    {{ name }}
    {{ profile_picture_url }}
    {{ username }}
    {{ website }}
{{ /instagram:feed }}
```

### Manipulate an image

[](#manipulate-an-image)

You can manipulate external Instagram image URLs with Glide as usual:

```
{{ instagram:feed }}
    {{ glide src="{thumbnail_url ?? media_url}" format="webp" width="500" }}

    {{ /glide }}
{{ /instagram:feed }}
```

*Since Statamic `v5.43.0`, Glide supports external URLs with query params. Therefore, `v2` of this addon removes the ability to proxy images and drops the `ig_proxy` modifier.*

### Refreshing Tokens

[](#refreshing-tokens)

A long-lived access token is valid for two months. This would mean that it has to be refreshed manually before it expires. When using the `{{ instagram:feed }}` `{{ instagram:media }}` tags, this is handled automatically for you.

If you use the API exclusively in PHP, please make sure that you update the token yourself via the scheduler:

```
Schedule::call(fn() => app(InstagramAPI::class)->refreshAccessToken())->weekly();
```

Please note that the frequency has to be between one day and the mentioned two months until the token expires.

### Child Media (Album)

[](#child-media-album)

By default, the addon does not fetch child media for e.g. Albums since that requires additional requests to the API. Therefore `children` is `null`. In case you need child media, you can enable `include_child_posts` in the addon config.

### Using the API in PHP

[](#using-the-api-in-php)

There is a dedicated `InstagramAPI` class to interact with the API. Its public methods are:

- `cacheKey(...$parts): string`
- `profile(): Profile`
- `feed(): Collection`
- `getAccount(): Account`
- `getLimit(): int`
- `setLimit(int $limit): static`
- `getUserId(): string`
- `getHandle(): string`
- `setHandle(string $handle): static`
- `media(int $id): ?Media`
- `refreshAccessToken(): bool`

For example, this is how you fetch the feed. This will return you a Collection of `Media` objects.

```
 return app(\MarcoRieser\StatamicInstagram\InstagramAPI::class)
    ->setLimit(12)
    ->setHandle('rickastley')
    ->feed();
```

License
-------

[](#license)

Statamic Instagram Business API is paid software with an open-source codebase. If you want to use it, you’ll need to buy a license from the Statamic Marketplace. The license is valid for only one project. Statamic itself is commercial software and has its own license.

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance90

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Every ~52 days

Recently: every ~87 days

Total

10

Last Release

52d ago

Major Versions

v1.1.0 → v2.0.02024-12-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/182dfd043559a726306414781777e7c5960164230ca44e2703607194c296d54b?d=identicon)[marcorieser](/maintainers/marcorieser)

---

Top Contributors

[![marcorieser](https://avatars.githubusercontent.com/u/2395800?v=4)](https://github.com/marcorieser "marcorieser (45 commits)")

---

Tags

apiinstagramstatamicbusiness api

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/marcorieser-statamic-instagram/health.svg)

```
[![Health](https://phpackages.com/badges/marcorieser-statamic-instagram/health.svg)](https://phpackages.com/packages/marcorieser-statamic-instagram)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

13998.4k2](/packages/jstolpe-instagram-graph-api-php-sdk)

PHPackages © 2026

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