Skip to content
This repository has been archived by the owner on Mar 4, 2018. It is now read-only.
/ php-instagram Public archive

A Simple PHP library for the Instagram API

License

Notifications You must be signed in to change notification settings

julionc/php-instagram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-instagram

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

A PHP library for the Instagram API

Table of Contents

Installation

Using composer:

{
    "require": {
        "julionc/instagram": "dev-master"
    }
}

How to Use

require_once('vendor/autoload.php');

$config = array(
    'client_id' => 'YOUR_CLIENT_ID',
    'client_secret' => 'YOUR_CLIENT_SECRET',
    'redirect_uri' => 'CALLBACK_URL',
    'scope' => array('basic')
);

$client = new Instagram\Auth($config);

// In view, get the Authorize URL
$client->authorize_url();
// profile.php
// Preload the settings and capture the access code (Callback step).

if (!$access_token) {
    $client = new Instagram\Auth($config);
    $client->requestAccessToken($access_code);
    $_SESSION['access_token'] = $client->getAccessToken();
}

$instagram = new \Instagram\Instagram($access_token, 'secret_key_here');

If you do not wish to put your client credentials in your code (understandable), simply set it to the environment variable instagram.client_id and instagram.client_secrect. So php-instagram will automatically pick it up. See example folder.

EndPoints

User

$instagram = new \Instagram\Instagram($access_token);

// Get basic information about a user.
$user = $instagram->user->info();

// See the authenticated user's feed.
$feed = $instagram->user->feed();

// Get the most recent media published by a user.
$media = $instagram->user->media();

About

A Simple PHP library for the Instagram API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages