NextScripts Instagram API library for WordPress and PHP

NextScripts Autoposting API for Instagram allows you to share your images along with text message and hashtags to your Instagram profile.
Mobile Social image-sharing network Instagram is growing fast. Your site or blog is already posting your updates to Facebook and Twitter, so what about Instagram? Official Instagram API is not accepting images from anything other then mobile devices.

New Automated Posting API library from NextScripts can automatically share images from your site directly to your Instagram account.
API can make images square by cropping or expanding them. You can also add text with hashtags to every image.

Instagram Automated Posting Demo

Please enter some text, select an image and click “Post” button.

 

Select Image to be Posted:

igigigigig
igigigigig
  Post   it to our NextScripts Instagram Demo Account

How to use it – Let’s see some code:

Upload an image to your Instagram account:
[php] <?php
require_once “nxs-api/nxs-api.php”;
require_once “nxs-api/nxs-http.php”;
require_once “inc/nxs-functions.php”;

$login = ‘YourInstagramUserName’;
$pass = ‘YourInstagramPassword’;
$msg = ‘Post this to Instagram! #testpost, #snap’;
$imgURL = ‘http://www.YourWebsiteURL.com/link/to/your/image.jpg’;
$imgFormat = ‘E’; // ‘E’ (Extended) or ‘C’ (Cropped) or ‘U’ (Untouched)

$nt = new nxsAPI_IG();
$loginError = $nt->connect($email, $pass);
if (!$loginError)
{
$result = $nt -> post($msg, $imgURL, $imgFormat);
}
else echo $loginError;

if (!empty($result) && is_array($result) && !empty($result[‘post_url’]))
echo ‘<a target=”_blank” href=”‘.$result[‘post_url’].'”>New Post</a>’;
else
echo “<pre>”.print_r($result, true).”</pre>”;
?>
[/php]

Get SNAP API

Instagram API is a part of NextScripts Premium and Universal API packages.
NextScripts Premium API for WordPress and PHP provides an ability to autopost to social networks without native built-in APIs.
NextScripts Universal API for PHP provides a unified API interface for autoposting to more then 25 different social networks including Google+, Pinterest, Flipboard, Reddit, YouTube, Blogger, and LinkedIn Company Pages as well as Facebook, Twitter, Tumblr, Flickr, ScoopIt and many others.
More infoGet it

Posts made by SNAP

Please see more code samples and documentation

Requirements

PHP Ver > 5.2 (PHP 7 or 7.1 is recommended)
PHP should have at least 32M of memory (64M and more is highly recommended).
curlSSL
gzip and mbstring are not required but will make things work faster.

Image Format

1. Extended.

Image is extended by the longer side to make it square. The whole image will be seen in the stream and in the full view. In the stream image will appear smaller.

IG-ImageStyle-Extended

2. Cropped.

Image is cropped to make it square. Some parts of the image will be permanently removed.

IG-ImageStyle-Cropped

3. Untouched.

Image is untouched. Instagram will crop image for the stream. Could cause “Uploaded image isn’t in an allowed aspect ratio” Error

IG-ImageStyle-Untouched

Get SNAP Now

SNAP Plugin for WordPress is free to install and use.