PHPackages                             sectsect/wp-instagram-json - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. sectsect/wp-instagram-json

ActiveWordpress-plugin[Parsing &amp; Serialization](/categories/parsing)

sectsect/wp-instagram-json
==========================

Generate JSON file with object data returned from Instagram API for Sandbox Mode.

v1.1.5(8y ago)1301GPL-3.0-or-laterPHPPHP &gt;=5.5

Since Oct 19Pushed 7y ago1 watchersCompare

[ Source](https://github.com/sectsect/wp-instagram-json)[ Packagist](https://packagist.org/packages/sectsect/wp-instagram-json)[ RSS](/packages/sectsect-wp-instagram-json/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (8)Used By (0)

[![](https://camo.githubusercontent.com/b8a22d292780c631360a84efd912e57855d5395021965174bffa6f3b255dd62f/68747470733a2f2f6769746875622d736563742e73332d61702d6e6f727468656173742d312e616d617a6f6e6177732e636f6d2f6c6f676f2e737667)](https://camo.githubusercontent.com/b8a22d292780c631360a84efd912e57855d5395021965174bffa6f3b255dd62f/68747470733a2f2f6769746875622d736563742e73332d61702d6e6f727468656173742d312e616d617a6f6e6177732e636f6d2f6c6f676f2e737667) WP Instagram JSON
===================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#-wp-instagram-json)

[![Build Status](https://camo.githubusercontent.com/d5491c9c4d39f99d65e2ed5ec5579467350597b5c9cecf4d51ade10a9263855a/68747470733a2f2f7472617669732d63692e6f72672f73656374736563742f77702d696e7374616772616d2d6a736f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sectsect/wp-instagram-json) [![PHP-Eye](https://camo.githubusercontent.com/eb74f7993efd10e25466bfdf714434f1f5768d2834c6ead34d7ad243ceb620e6/68747470733a2f2f7068702d6579652e636f6d2f62616467652f73656374736563742f77702d696e7374616772616d2d6a736f6e2f7465737465642e7376673f7374796c653d666c6174)](https://php-eye.com/package/sectsect/wp-instagram-json) [![Latest Stable Version](https://camo.githubusercontent.com/db683aa0070cf34a1c0c993d17f21ece1359d90e904f6f1454000f6dd99fb7d3/68747470733a2f2f706f7365722e707567782e6f72672f73656374736563742f77702d696e7374616772616d2d6a736f6e2f762f737461626c65)](https://packagist.org/packages/sectsect/wp-instagram-json) [![License](https://camo.githubusercontent.com/dc80fe05ecc370113819beeb6ea82b8a61aa1b438e7e2d6ff4fd45955ecd7b76/68747470733a2f2f706f7365722e707567782e6f72672f73656374736563742f77702d696e7374616772616d2d6a736f6e2f6c6963656e7365)](https://packagist.org/packages/sectsect/wp-instagram-json)

### Generate JSON file with object data returned from Instagram API (for Sandbox Mode). Also upload the JSON file to AWS S3 (optional).

[](#generate-json-file-with-object-data-returned-from-instagram-api-for-sandbox-mode-also-upload-the-json-file-to-aws-s3-optional)

Why Sandbox Mode?
-----------------

[](#why-sandbox-mode)

### Understanding the Instagram API in three minutes

[](#understanding-the-instagram-api-in-three-minutes)

In order to work with the Instagram API, sooner or later, you must find your way through the nebulous API client registration and authorization process. Understanding the API access limitations can prevent a lot of wasted time, because they often result in unexpected data rather than straight-forward authentication errors that are easier to diagnose.

### The infamous June 2016 API restrictions

[](#the-infamous-june-2016-api-restrictions)

On June 1 2016, console errors lit up all over the world when Instagram significantly restricted access to its API. The first thing to understand is that it was a deliberate business decision by Instagram, designed to prevent their API from being used for a variety of purposes. Understanding this fact will not fix the errors in the console, but it makes the restrictions more intuitive to work around if you understand their intent.

### Sandbox mode vs "live" mode

[](#sandbox-mode-vs-live-mode)

The gatekeeper between developers and full API access is called sandbox mode. The documentation presents it as a temporary step in the development process, but the overwhelming majority of projects will never leave sandbox mode because Instagram only grants full access to their API for a handful of very specific use cases:

- “My app allows people to login with Instagram and share their own content”
- “My product helps brands and advertisers understand, manage their audience and media rights.”
- “My product helps broadcasters and publishers discover content, get digital rights to media, and share media with proper attribution.”

If you cannot convince the Instagram lords that your app serves one of these specific purposes, it will be rejected if you submit it to “Go live”.
For this reason, it may be more intuitive to think of it as “sideline mode”.

### What can you do while in sandbox mode?

[](#what-can-you-do-while-in-sandbox-mode)

- Apps in sandbox are restricted to 10 users
- Data is restricted to the 10 users and the 20 most recent media from each of those users
- Reduced API [rate limits](https://www.instagram.com/developer/limits/) `500/hour`

via @

#### So I have developed this Plugin to generate JSON files at scheduled times for the data returned from Instagram API under those conditions. And also I added a feature to upload that JSON file to AWS S3. This is also for performance optimization 🎉

[](#so-i-have-developed-this-plugin-to-generate-json-files-at-scheduled-times-for-the-data-returned-from-instagram-api-under-those-conditions-and-also-i-added-a-feature-to-upload-that-json-file-to-aws-s3-this-is-also-for-performance-optimization-tada)

Requirements
------------

[](#requirements)

- PHP 5.5+
- [Composer](https://getcomposer.org/)

Installation
------------

[](#installation)

1. Clone this Repo into your `wp-content/plugins` directory.

```
$ cd /path-to-your/wp-content/plugins/
$ git clone git@github.com:sectsect/wp-instagram-json.git
```

2. Install composer packages

```
$ cd wp-instagram-json/functions/composer/
$ composer install
```

3. Activate the plugin through the 'Plugins' menu in WordPress.
4. Go to `Instagram` on your wordpress admin panel.
5. Set the following values and save it once.

- Cache Expire `(min)`
- Count `(Range: 1-20)`
- Account Name
- Access Token ⚠️ You need get Instagram API Access Token in advance.

6. If you wanna upload JSON files to AWS S3, also fill in the following items (optional).

- S3 Upload `(ON/OFF Toggle)`
- AWS credentials key
- AWS credentials secret
- Region
- Bucket name
- The Path on S3
- Custom URL (CDN)

7. Furthermore, If you use AWS CloudFront Invalidation, fill in the following items (optional).

- CloudFront Invalidation `(ON/OFF Toggle)`
- Distribution ID

That's it:ok\_hand:
A file will be generated at the time of the first web access into the following location.

```
/wp-content/plugins/wp-instagram-json/json/instagram.json

```

Now, you can get the URL with javascript variable `wp_ig_json.json_url`.
📌 If S3 Upload is enabled, this URL is automatically replaced to URL for S3.

Saved Object Structure
----------------------

[](#saved-object-structure)

```
{
  "pagination":[

  ],
  "data":[
    {
      "id":"",
      "user":{
        "id":"",
        "full_name":"",
        "profile_picture":"",
        "username":""
      },
      "images":{
        "thumbnail":{
          "width":150,
          "height":150,
          "url":""
        },
        "low_resolution":{
          "width":320,
          "height":320,
          "url":""
        },
        "standard_resolution":{
          "width":640,
          "height":640,
          "url":""
        }
      },
      "created_time":"",
      "caption":{
        "id":"",
        "text":"",
        "created_time":"",
        "from":{
          "id":"",
          "full_name":"",
          "profile_picture":"",
          "username":""
        }
      },
      "user_has_liked":,
      "likes":{
        "count":
      },
      "tags":[

      ],
      "filter":"",
      "comments":{
        "count":
      },
      "type":"",
      "link":"",
      "location":,
      "attribution":,
      "users_in_photo":[

      ],
      "carousel_media":[
        {
          "images":{
            "thumbnail":{
              "width":150,
              "height":150,
              "url":""
            },
            "low_resolution":{
              "width":320,
              "height":320,
              "url":""
            },
            "standard_resolution":{
              "width":640,
              "height":640,
              "url":""
            }
          },
          "users_in_photo":[

          ],
          "type":""
        },
        {
          "images":{
            "thumbnail":{
              "width":150,
              "height":150,
              "url":""
            },
            "low_resolution":{
              "width":320,
              "height":320,
              "url":""
            },
            "standard_resolution":{
              "width":640,
              "height":640,
              "url":""
            }
          },
          "users_in_photo":[

          ],
          "type":"image"
        }
      ]
    },
	{
	  "id":"",
	  ...
    }
  ],
  "meta":{
    "code":200
  },
  "file_generate_datetime":"2019\/12\/31 00:00:00"
}
```

NOTES for Developer
-------------------

[](#notes-for-developer)

- This plugin does not do anything on the Front-end. Just generate a JSON file.
    You can access the generated json file in any way you like and output it to the Front-end.
    See [Usage Example](#usage-example).
- WordPress built-in cron has some problems with the specific environment.
    In order to avoid those risks, this Plugin uses periodic processing for WordPress [Transient](https://codex.wordpress.org/Transients_API) instead of `WP-Cron`.
- This plugin internally uses [AWS SDK for PHP](https://github.com/aws/aws-sdk-php) v3.
- AWS CloudFront Invalidation works only when `Delete cache` in manual.
    It does not work when the cache expires.

Usage Example
-------------

[](#usage-example)

📝 If you host that file on AWS S3, you also need to configure `CORS`(Cross-Origin Resource Sharing) on S3.

### Ajax with jQuery (ES6)

[](#ajax-with-jquery-es6)

```

```

```
jQuery(() => {
  jQuery.ajax({
    url: wp_ig_json.json_url,
    type: "GET",
    dataType: 'json',
    beforeSend() {}
  }).done(res => {
    if (res && res.data) {
      let list = '';
      jQuery.each(res.data, (i, {id, link, images}) => {
        list += `

                `;
      });
      jQuery('#instagram').html(list);
    }
  }).fail(() => {
    alert("Load Error. Please Reload...");
  }).always(res => {
    jQuery('#instagram').addClass('ready');
  });
});
```

### Ajax with Vue.js

[](#ajax-with-vuejs)

```

```

```
import Vue from 'vue';
import axios from 'axios';

const app = new Vue({
  el: '#app',
  props: {
    'readyclass': null,
  },
  data: {
    photos: [],
    errors: [],
  },
  created() {
    axios.get(wp_ig_json.json_url)
      .then((response) => {
        if (response.status === 200 && response.data.data.length > 0) {
          this.photos = response.data.data;
        }
      })
      .catch((e) => {
        this.errors.push(e);
      });
  },
  updated() {},
});
```

#### async / await version

[](#async--await-version)

```
import Vue from 'vue';
import axios from 'axios';

const app = new Vue({
  el: '#app',
  props: {
    'readyclass': null,
  },
  data: {
    photos: [],
    errors: [],
  },
  async created() {
    try {
      const response = await axios.get(wp_ig_json.json_url);
      if (response.status === 200 && response.data.data.length > 0) {
        this.photos = response.data.data;
      } else {
        console.log('Error!!');
      }
    } catch (e) {
      this.errors.push(e);
    }
  },
  updated() {},
});
```

AWS S3
------

[](#aws-s3)

### IAM Role Policy

[](#iam-role-policy)

Make a user on AWS, and attach the policy to the user.
The following are the required minimum policies.

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:PutObject"
            ],
            "Resource": "*"
        }
    ]
}
```

If you use AWS CloudFront Invalidation

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "cloudfront:CreateInvalidation",
                "cloudfront:GetDistribution",
                "cloudfront:GetInvalidation",
                "cloudfront:GetStreamingDistribution",
                "cloudfront:GetDistributionConfig",
                "cloudfront:ListDistributions",
                "cloudfront:ListInvalidations",
                "cloudfront:ListStreamingDistributions"
            ],
            "Resource": "*"
        }
    ]
}
```

Change log
----------

[](#change-log)

See [CHANGELOG](https://github.com/sectsect/wp-instagram-json/blob/master/CHANGELOG.md) file.

Contributing
------------

[](#contributing)

1. Create an issue and describe your idea
2. [Fork it](https://github.com/sectsect/wp-instagram-json/fork)
3. Create your feature branch (`git checkout -b my-new-feature`)
4. Commit your changes (`git commit -am 'Add some feature'`)
5. Publish the branch (`git push origin my-new-feature`)
6. Create a new Pull Request
7. Profit! ✅

License
-------

[](#license)

See [LICENSE](https://github.com/sectsect/wp-instagram-json/blob/master/LICENSE) file.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

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

Total

7

Last Release

3034d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.3

v1.1.0PHP &gt;=5.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/c0ad6cda4575e93cf7751cf8d2a13d1d6c9f908e6a61448dfa5f481ca985ec0d?d=identicon)[sectsect](/maintainers/sectsect)

---

Top Contributors

[![sectsect](https://avatars.githubusercontent.com/u/5554826?v=4)](https://github.com/sectsect "sectsect (46 commits)")

---

Tags

awsaws-s3instagraminstagram-apijsons3wordpresswordpress-pluginjsonpluginwordpressinstagramgithub

### Embed Badge

![Health badge](/badges/sectsect-wp-instagram-json/health.svg)

```
[![Health](https://phpackages.com/badges/sectsect-wp-instagram-json/health.svg)](https://phpackages.com/packages/sectsect-wp-instagram-json)
```

###  Alternatives

[hwi/oauth-bundle

Support for authenticating users using both OAuth1.0a and OAuth2 in Symfony.

2.4k21.5M69](/packages/hwi-oauth-bundle)[mwdelaney/sage-advanced-custom-fields

Advanced Custom Fields local JSON setup for Sage 9 based themes

104194.7k](/packages/mwdelaney-sage-advanced-custom-fields)[tinywan/rpc

simple rpc service for webman plugin

193.5k](/packages/tinywan-rpc)

PHPackages © 2026

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