This is a Node.js Shutterstock API client.
Usage
Install
$ npm install shutterstock --save
Example
var shutterstock = ;var api = shutterstock;apiimage;
Documentation
- shutterstock.v2
- shutterstock.v1
- v1.echo
- v1.image.search
- v1.image.get
- v1.image.similar
- v1.image.categories
- v1.image.download
- v1.customer.auth
- v1.customer.register
- v1.customer.get
- v1.customer.images
- v1.customer.subscriptions
- v1.lightbox.list
- v1.lightbox.get
- v1.lightbox.publicUrl
- v1.lightbox.create
- v1.lightbox.update
- v1.lightbox.destroy
- v1.lightbox.add
- v1.lightbox.remove
- v1.video.search
- v1.video.get
- v1.video.download
All callbacks have the following signature function(err, data, res)
.
- err (Error, optional): set if there was an error, otherwise falsy
- data (Object, optional): response data if any, otherwise
undefined
- res (http.IncomingMessage, optional): HTTP response object with additional
body
property. This might not exist whenerr
is set. Thebody
property can be a decoded object, string, or Buffer.
This is a client for interacting with API v2.
Options
- clientId (String): OAuth2 client ID
- clientSecret (String): OAuth2 client secret
- accessToken (String, optional): OAuth2 access token
- timeout (Number, default: 30000): number of milliseconds before request is aborted
Usage
#### v2.audio.list(options, callback)var shutterstock = ;var v2 = shutterstock;
Get details for multiple audio tracks.
Options - Documentation
- id (String[]): track IDs
- view (String, optional): render view
Usage
#### v2.audio.get(options, callback)v2audio;
Get details for a specified track.
Options - Documentation
- id (String): track ID
- view (String, optional): render view
Usage
#### v2.audio.search(options, callback)v2audio;
Search tracks.
Options - Documentation
- query (String, optional): query string
- page (Number, default: 1): page to return
- per_page (Number, default: 20): number of results to return per page
- sort (String, default: popular): sort results
And many more, see official documentation for more details.
Usage
#### v2.contributor.get(options, callback)v2audio;
Search tracks.
Options - Documentation
- id (String): contributor ID
Usage
#### v2.image.categories(callback)v2contributor;
Get all image categories.
Usage
#### v2.image.list(options, callback)v2image;
Get details for multiple images.
Options - Documentation
- id (String[]): image IDs
- view (String, optional): render view
Usage
#### v2.image.get(options, callback)v2image;
Get details for a specified image.
Options - Documentation
- id (String): image ID
- view (String, optional): render view
Usage
#### v2.image.recommendations(options, callback)v2image;
Return recommendations for specified images.
Options - Documentation
- id (String[]): image IDs
- max_items (Number, default: 20): number of results to return
And more, see official documentation for more details.
Usage
#### v2.image.search(options, callback)v2image;
Search images.
Options - Documentation
- query (String, optional): query string
- page (Number, default: 1): page to return
- per_page (Number, default: 20): number of results to return per page
- sort (String, default: popular): sort results
And many more, see official documentation for more details.
Usage
#### v2.image.similar(options, callback)v2image;
Get similar images.
Options - Documentation
- id (String, optional): image ID
- page (Number, default: 1): page to return
- per_page (Number, default: 20): number of results to return per page
- sort (String, default: popular): sort results
Usage
#### v2.image.download(options, callback)v2image;
Download an image.
Options - Documentation
- id (String, optional): image ID
- size (String, optional): image size to download
Usage
#### v2.video.list(options, callback)v2image;
Get details for multiple videos.
Options - Documentation
- id (String[]): video IDs
- view (String, optional): render view
Usage
#### v2.video.get(options, callback)v2video;
Get details for a specified video.
Options - Documentation
- id (String): video ID
- view (String, optional): render view
Usage
#### v2.video.search(options, callback)v2video;
Search videos.
Options - Documentation
- query (String, optional): query string
- page (Number, default: 1): page to return
- per_page (Number, default: 20): number of results to return per page
- sort (String, default: popular): sort results
And many more, see official documentation for more details.
Usage
#### v2.video.similar(options, callback)v2video;
Get similar videos.
Options - Documentation
- id (String, optional): video ID
- page (Number, default: 1): page to return
- per_page (Number, default: 20): number of results to return per page
- sort (String, default: popular): sort results
Usage
### Class: shutterstock.v1(options)v2video;
This is a client for interacting with API v1.
Options
- username (String): API username (not to be confused with customer username)
- password (String): API password (key)
- timeout (Number, default: 30000): number of milliseconds before request is aborted
Usage
#### v1.echo(options, callback)var shutterstock = ;var v1 = shutterstock;
Echo back specified options, used to check API connection and credentials.
Options - Documentation
- key (String): value
Usage
#### v1.image.search(options, callback)v1image;
Search images.
Options - Documentation
- searchterm (String): search query
- sort_method (String, default: popular): sort results
- page_number (Number, default: 0): page to return
- results_per_page (Number, default: 150): number of results to return per page
- submitter_id (Number, optional): filter results by contributor ID
And many more, see official documentation for more details.
Usage
#### v1.image.get(options, callback)v1image;
Get details for a specified image.
Options - Documentation
- image_id (Number): image ID
Usage
#### v1.image.similar(options, callback)v1image;
Get images similar to a specified image.
Options - Documentation
- image_id (Number): image ID
Usage
#### v1.image.categories(callback)v1image;
Get all image categories.
Usage
#### v1.image.download(options, callback)v1image;
License image.
Options - Documentation
- auth_token (String): authentication token, get from customer.auth
- subscription_id (Number): photo subscription ID
- image_id (Number): image ID
- size (String): image size
- format (String): image format
And more, see official documentation for more details.
Usage
#### v1.customer.auth(options, callback)var opts =image_id: 108559295subscription_id: 123size: 'huge'format: 'jpg';v1image;
Authenticate as a user.
Options - Documentation
- email (String): user's email, required if username not specified
- username (String): user's username, required if email not specified
- password (String): user's password
Usage
#### v1.customer.get([options], callback)v1customer;
Get user information.
Options - Documentation
- auth_token (String): authentication token, get from customer.auth
- username (String): user's username
Usage
#### v1.customer.register(options, callback)v1customer;
Create new customer account.
Options - Documentation
- email (String): new user's email address
- username (String): new user's username
- password (String): new user's password
Usage
#### v1.customer.images([options], callback)v1customer;
Get user's image downloads and the subscriptions under which they were downloaded.
Options - Documentation
- auth_token (String): authentication token, get from customer.auth
- username (String): user's username
- image_id (Number, optional): get downloads for specific image
- license (String, optional): filter results by license
- page_number (Number, default: 0): page to return
- page_size (Number, default: 40): number of results to return per page
- sort_by (String, optional): sort results
- sort_order (String, default: desc): sort order
Usage
#### v1.customer.subscriptions([options], callback)v1customerimages username: 'john' {if err throw err;console;};
Get customer subscriptions.
Options - Documentation
- auth_token (String): authentication token, get from customer.auth
- username (String): user's username
Usage
#### v1.lightbox.list([options], callback)v1customer;
Get customer lightboxes.
Options - Documentation
- auth_token (String): authentication token, get from customer.auth
- username (String): user's username
- exclude_empty (Boolean, default: false): filter empty lightboxes
- exclude_images (Boolean, default: false): only return lightbox metadata
Usage
#### v1.lightbox.get(options, callback)v1lightbox;
Get contents of lightbox.
Options - Documentation
- auth_token (String): authentication token, get from customer.auth
- lightbox_id (Number): lightbox ID
- verification_code (String, optional): access lightbox without auth_token, get from lightbox.publicUrl
Usage
#### v1.lightbox.publicUrl(options, callback)v1lightbox;
Return public URL for lightbox.
Options - Documentation
- auth_token (String): authentication token, get from customer.auth
- lightbox_id (Number): lightbox ID
Usage
#### v1.lightbox.create(options, callback)v1lightbox;
Create new lightbox.
Options - Documentation
- auth_token (String): authentication token, get from customer.auth
- username (String): user's username
- lightbox_name (String): new lightbox name
Usage
#### v1.lightbox.update(options, callback)v1lightbox;
Update lightbox.
Options - Documentation
- auth_token (String): authentication token, get from customer.auth
- lightbox_id (Number): lightbox ID
- lightbox_name (String): updated lightbox name
Usage
#### v1.lightbox.destroy(options, callback)v1lightbox;
Delete lightbox.
Options - Documentation
- auth_token (String): authentication token, get from customer.auth
- lightbox_id (Number): lightbox ID
Usage
#### v1.lightbox.add(options, callback)v1lightbox;
Add image to lightbox.
Options - Documentation
- auth_token (String): authentication token, get from customer.auth
- lightbox_id (Number): lightbox ID
- image_id (Number): image ID to add to lightbox
Usage
#### v1.lightbox.remove(options, callback)v1lightbox;
Remove image from lightbox.
Options - Documentation
- auth_token (String): authentication token, get from customer.auth
- lightbox_id (Number): lightbox ID
- image_id (Number): image ID to remove from lightbox
Usage
#### v1.video.search(options, callback)v1lightbox;
Search videos.
Options - Documentation
- searchterm (String): search query
- sort_method (String, default: popular): sort results
- page_number (Number, default: 0): page to return
- results_per_page (Number, default: 150): number of results to return per page
- submitter_id (Number, optional): filter results by contributor ID
Usage
#### v1.video.get(options, callback)v1video;
Get details for a specified video.
Options - Documentation
- video_id (Number): video ID
Usage
#### v1.video.download(options, callback)v1video;
License video.
Options - Documentation
- auth_token (String): authentication token, get from customer.auth
- subscription_id (Number): footage subscription ID
- video_id (Number): video ID
- size (String): video size
And more, see official documentation for more details.
Usage
var opts =video_id: 5869544subscription_id: 123size: 'hd';v1video;
License
This work is licensed under the MIT License (see the LICENSE file).