frmontini/instafeed

Get basic information and latest posts from a public Instagram profile.

v1.0.3 2021-11-25 20:17 UTC

This package is auto-updated.

Last update: 2024-04-15 18:07:03 UTC


README

Now you can get data from public profile pages on Instagram without logging in.

Get started

This repository requires Composer 2.x to install. You can update it using a simple command in your console: composer self-update --preview. Also, you need to run on PHP 7.2.x.

Composer command to install:

composer require frmontini/instafeed

How to use

Just follow the example below:

include('vendor/autoload.php');

$utils = new InstaFeed\Utils();

/* TO GET INSTAGRAM CONTENT */

$username = 'cocacola';
$data = $utils->getData($username);
print_r(json_decode($data));

/* TO CLEAR CACHE */

$username = 'cocacola';
$utils->noCache($username);

About cache

To prevent blocking access to the profile and redirecting to the login page, further calls to fetched profiles will return cached data. You can clear persisted data from a specific profile using the noCache function (see example above).

License

OSL-3.0