PHPackages                             jacob-ian/instagram-feed - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jacob-ian/instagram-feed

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jacob-ian/instagram-feed
========================

A simple Instagram feed using the old Instagram API

v1.1.1(8y ago)17Apache-2.0PHPPHP &gt;=7.2.0

Since Jun 27Pushed 8y agoCompare

[ Source](https://github.com/jacob-ian/instagram-feed)[ Packagist](https://packagist.org/packages/jacob-ian/instagram-feed)[ Docs](https://github.com/jacob-ian/instagram-feed)[ RSS](/packages/jacob-ian-instagram-feed/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (4)Used By (0)

Description:
============

[](#description)

An Instagram Feed using the old API. It will cache the post data in your webserver and use a MYSQL database to store the metadata to maximise loading speeds.

Requirements:
=============

[](#requirements)

- An Instagram Access Token connected to the desired account to display. Note: The account must be public.
- PHP 7.2+

Usage:
======

[](#usage)

1. Include this repository in your project via Composer (jacob-ian/instagram-feed).
2. Create a MYSQL Database to hold the data:

    ```
    CREATE DATABASE instagram
    ```

    The `\JacobIan\InstagramFeed\instagramFetch` class will automatically create the table and populate it.
3. Setup a cron-job that will point to a PHP file containing:

    ```
    require_once('instagram-feed/src/instagramFetch.class.php');
    $instagramData = new \JacobIan\InstagramFeed\instagramFetch($database, $accesstoken, $cachepath);
    $instagramData->fetch();
    ```

    The `require_once()` can be replaced with an autoloader.

    Where:

    - `$database` should be an array with the structure:

        ```
         $database = array(
         	"username"=>"[username]",
         	"password"=>"[password]",
         	"host"=>"[host]",
         	"database"=>"instagram"
         );
        ```
    - `$accesstoken` is a string containing the Instagram Access Token relating to the account you wish to display.
    - `$cachepath` should be a string with the path to a location in the public\_html/webroot directory where you wish the Instagram Cache and Assets to be stored.

    This cron job should run every 15 minutes, but frequency can be increased depending on how often you wish the feed to refresh.
4. To create the feed itself, use the following code on your PHP webpage:

    ```
    require_once('instagram-feed/src/instagramFeed.class.php');
    $instagram_feed = new \JacobIan\InstagramFeed\instagramFeed($database, $count, $style);
    echo $instagram_feed->feed();
    ```

    Again, the `require_once()` can be replaced by an autoloader.

    Where:

    - `$count` is an integer describing the number of latest posts to display in the feed. Instagram API is limited to a maximum of 20 posts.
    - `$style` is a string containing the desired CSS Style tags on each Instagram Post. See CSS Styles below.
5. Include the following two lines of code to the `` of the webpage containing the Instagram Feed:

    ```

    ```
6. Enjoy!

CSS Styles:
-----------

[](#css-styles)

The available CSS tags are:

Size:

- `'small'` : Grid size of 150x150px with a frame around the media
- `'medium'` : Grid size of 300x300px with a frame around the media
- `'large'` : Grid size of 640x640px with a frame around the media
- `'small_noframe'` : Grid size of 150x150px without a frame
- `'medium_noframe'` : Grid size of 300x300px without a frame
- `'large_noframe'` : Grid size of 640x640px without a frame

Color:

- `'dark'` : Sets post background-color to `#333` (dark-grey)
- `'transparent'` : Sets post background-color to transparent
- `'noborder'` : Removes the border on the posts
- Note: the default background-color is `#fff` (white).

Spacing:

- `'nomargin'` : Removes the gap between the posts in the Instagram Feed grid.

Example Styles:

- `'small dark'` : A small grid size with a frame of colour #333 around the media
- `'large_noframe nomargin noborder'` : A large grid size without a frame and no gaps between the posts. This setup makes it easy to use the Masonry JS Script.

Usage:

- Only one Size tag can be used, and it is also the minimum requirement for the feed to work.
- After the size tag, the other tags can be added on with a space in between.

Custom Styles:

- Custom Styles can be used by adding them to the `$style` string with a space.
- To use a custom size style, the size tag can be replaced by a custom string. This will then be converted to the CSS tag `post_[custom]` and `media_[custom]`.

Notes:
------

[](#notes)

- The `\JacobIan\InstagramFeed\instagramFetch` class automatically transfers the contents of `'..\assets'` to the cache folder that is publicly accessable.
- `\JacobIan\InstagramFeed\instagramFetch` creates a database table named 'details' which contains the following information:
    - UserID: Instagram User ID
    - ProfilePictureURL: The URL to your profile picture
    - ProfilePicturePath: The path to the locally stored copy of your profile picture
    - Followers: Your follower count
    - Posts: Your post count
    - LastUpdate: The time of the last successful instagramFetch cron job.
    - CachePath: The path where your Instagram Cache and Assets are stored.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~0 days

Total

2

Last Release

2923d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/26347902?v=4)[Jacob Ian Matthews](/maintainers/jacob-ian)[@jacob-ian](https://github.com/jacob-ian)

---

Top Contributors

[![jacob-ian](https://avatars.githubusercontent.com/u/26347902?v=4)](https://github.com/jacob-ian "jacob-ian (37 commits)")

---

Tags

instagraminstagram-apiinstagram-feedmysql-databasephpphpinstagramfeedjacob-ian

### Embed Badge

![Health badge](/badges/jacob-ian-instagram-feed/health.svg)

```
[![Health](https://phpackages.com/badges/jacob-ian-instagram-feed/health.svg)](https://phpackages.com/packages/jacob-ian-instagram-feed)
```

###  Alternatives

[suin/php-rss-writer

Yet another simple RSS writer library for PHP 5.4 or later.

2651.4M21](/packages/suin-php-rss-writer)[pgrimaud/instagram-user-feed

This is a scraper to easily fetch any feed and interact with Instagram (like, follow, etc.) without OAuth for PHP.

943664.4k5](/packages/pgrimaud-instagram-user-feed)[rumenx/php-feed

Framework-agnostic PHP Feed generator for Laravel, Symfony, and more.

3644.1k](/packages/rumenx-php-feed)[pdir/social-feed-bundle

Social feed extension for Contao CMS

1415.5k](/packages/pdir-social-feed-bundle)[codefog/contao-instagram

Instagram bundle for Contao Open Source CMS

128.1k](/packages/codefog-contao-instagram)

PHPackages © 2026

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