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
Select Image to be Posted:
How to use it – Let’s see some code:
[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
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.
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.
2. Cropped.
Image is cropped to make it square. Some parts of the image will be permanently removed.
3. Untouched.
Image is untouched. Instagram will crop image for the stream. Could cause “Uploaded image isn’t in an allowed aspect ratio” Error