This example code points to an older version of the Shutterstock API that is no longer publicly supported. For a newer example, please see https://github.com/shutterstock/php-shutterstock-api.
Sample PHP client implementation of Shutterstock API
NOTE: This is currently a work in progress and is designed as just one example on how to interact with the Shutterstock API using PHP.
PHP Client is a single file library which provides an easy way to interact with the Shutterstock Inc. API https://developers.shutterstock.com. You will need an API username and key from Shutterstock with the appropriate permissions in order to use this client.
Include "ShutterstockApiClient.php" in your PHP script and initialize class.
require_once('ShutterstockApiClient.php');
$sapi = new ShutterstockApiClient();
**Note:** Make sure to replace below values in the class with your credentials.
//customer credentials
private static $customer_username = 'XXXXXX';
private static $customer_password = 'XXXXX';
//basic auth info
private static $auth_username = 'XXXXX';
private static $auth_key = 'XXXXX';
Below are some examples of how to use this client to interact with Shutterstock Inc. API:
$categories = $sapi->getCategories();
$search_result = $sapi->search('dog', $filters);
There are many filters supported while searching for Shutterstock images catalog. You need to pass these filters in $filters array as key-value pair.
$customer_info = $sapi->getCustomerUserInfo();
$lightboxes = $sapi->getLightboxes();
$add_lightbox = $sapi->addLightbox(lightbox_name);
$add_lightbox_image = $sapi->addImageToLightbox(lightbox_id, image_id);
$remove_lightbox_image = $sapi->deleteImageFromLightbox(lightbox_id, image_id);
$lightbox_details = $sapi->getLightbox(lightbox_id);
$delete_lightbox = $sapi->deleteLightbox(lightbox_id);
$subscription = $sapi->getSubscriptions();
$downloads = $sapi->getDownloads();
$download = $sapi->downloadImage(image_id, subscription_id, size, format, meta_data);
Please do! Check out our Contributing guide.
MIT © 2017 Shutterstock Images, Inc.