Licensing and Downloading

Prerequisites

  • Client ID and secret
  • An access_token with the following scopes: licenses.create, licenses.view, and purchases.view.
  • Username and password for an account with an active subscription.

License

  1. To license content you need the subscription ID associated with your Shutterstock purchasing account, get this by calling the subscriptions endpoint:

    curl "https://api.shutterstock.com/v2/user/subscriptions" \
     --header "Authorization: Bearer $ACCESS_TOKEN"
    

    This should return a list of subscriptions.

    {
     "data": [
       {
         "id": "s14529016",
         "license": "standard",
         "description": "Images On Demand",
         "formats": [
           {
             "size": "huge",
             "format": "jpg",
             "media_type": "image",
             "min_resolution": 4000000,
             "description": "Huge"
           },
           {
             "size": "medium",
             "format": "jpg",
             "media_type": "image",
             "min_resolution": 1000,
             "description": "Med"
           },
           {
             "size": "supersize",
             "format": "jpg",
             "media_type": "image",
             "min_resolution": 16000000,
             "description": "Super"
           },
           {
             "size": "small",
             "format": "jpg",
             "media_type": "image",
             "min_resolution": 500,
             "description": "Small"
           },
           {
             "size": "vector",
             "format": "eps",
             "media_type": "image",
             "description": "Vector"
           }
         ]
       }
     ]
    }
    

    Pick an active subscription (25/day subscriptions not supported) and store the subscription ID for the license step:

    SUBSCRIPTION_ID=s14529016
    
  2. Find an image to download:

    curl "https://api.shutterstock.com/v2/images/search" \
     --header "Authorization: Bearer $ACCESS_TOKEN" \
     --get \
     --data-urlencode "query=puppies playing" \
     --data-urlencode "view=full" \
     --data-urlencode "per_page=1" \
     --data-urlencode "fields=data/(id,description,model_release_info)"
    

    Note the image ID.

    {
     "data": [
       {
         "id": "137111171",
         "description": "english bulldog puppies playing outdoors"
       }
     ]
    }
    
  3. License the image:

    curl "https://api.shutterstock.com/v2/images/licenses?subscription_id=$SUBSCRIPTION_ID" \
     --header "Authorization: Bearer $ACCESS_TOKEN" \
     --header "Content-Type: application/json" \
     -X POST \
     --data '{
       "images": [
         { "image_id": "137111171" }
       ]
     }'
    

    Notice we're using a query parameter to set the default subscription_id for our request. We're also using the implicit defaults format=jpg and size=huge. You can change these defaults by setting the query parameters or defining them in the license image object (ex: { "image_id": "137111171", "size": "medium" }).

    The licensing results will be listed in the order requested. You can use the download URL to access the licensed media.

     {
     "data": [
       {
         "image_id": "137111171",
         "download": {
           "url": "http://download.shutterstock.com/gatekeeper/W3siZSI6MTQxODcwNzI3OCwicCI6InYxfDE0NzY1MzA5fDEzNzExMTE3MSIsImIiOiJwaG90by8xMzcxMTExNzEvaHVnZS5qcGciLCJtIjoiMSIsImQiOiJzvHV0dGVyc3RvY2stbWVkaWEifswiQnViZnBOQkplbW84Z2MwYks1K2FKU2UzejRvIl0/shutterstock_137111171.jpg"
         },
         "allotment_charge": 1
       }
     ]
    }
    

Editorial

Image search will return commercial use images by default, if you enable editorial use images you must acknowledge the editorial agreement as part of the licensing request. To do this add "editorial_acknowledgement": true to the license image object.

  curl "https://api.shutterstock.com/v2/images/licenses?subscription_id=$SUBSCRIPTION_ID" \
    --header "Authorization: Bearer $ACCESS_TOKEN" \
    --header "Content-Type: application/json" \
    -X POST \
    --data '{
      "images": [{
        "image_id": "137111171",
        "editorial_acknowledgement": true
      }]
    }'

Metadata

Enterprise partners using integrated_media or footage_integ_media subscriptions must provide a metadata object on each media item you want to license. You can customize your integration to have up to 4 metadata fields. By default only the purchase_order is required, if the field is optional you should provide an empty string. In this example below for a default integration, you would provide the purchase_order number (i.e. 123) corresponding to the purchase_order number internal to your system.

These metadata fields can be used to group and/or correlate licensing transactions on your invoices. Contact us if you would like to customize the fields on your integration.

  curl "https://api.shutterstock.com/v2/images/licenses?subscription_id=$SUBSCRIPTION_ID" \
    --header "Authorization: Bearer $ACCESS_TOKEN" \
    --header "Content-Type: application/json" \
    -X POST \
    --data '{
      "images": [{
        "image_id": "137111171",
        "metadata": {
          "purchase_order": "123", 
          "job": "",
          "client": "",
          "other": ""
        }
      }]
    }'

Redownloading Licensed Content

  1. Once you've licensed some media you will see it in your licenses:

    curl "https://api.shutterstock.com/v2/images/licenses" \
     --header "Authorization: Bearer $ACCESS_TOKEN"
    

    This includes information about the license type, subscription, and time. Some subscriptions allow you to request another download URL.

    {
     "data": [
       {
         "id": "i1177186435",
         "user": {
           "username": "vowbot"
         },
         "license": "standard",
         "subscription_id": "s8564293",
         "download_time": "2014-11-21T01:07:54-08:00",
         "image": {
           "id": "137611373",
           "format": {
             "size": "huge"
           }
         }
       }
     ],
     "page": 1,
     "per_page": 20
    }
    

    Save the license ID so we can request a new download URL:

    LICENSE_ID=i1177186435
    
  2. Use the license ID to request a new download URL:

    curl "https://api.shutterstock.com/v2/images/licenses/$LICENSE_ID/downloads" \
     --header "Authorization: Bearer $ACCESS_TOKEN" \
     --header "Content-Type: application/json" \
     -X POST \
     --data '{}'
    

    This returns a new download URL:

    {
     "url": "http://download.shutterstock.com/gatekeeper/W3siZSI6MTQxODcxMTEyMSwicCI6InYxfDE0NzY1MzA5fDEzNzExMTE3MSIsImsiOiJwaG90by8xMzcxMTExNzEvaHVnZS5qcGcixLCJtIjoiMSIsImQiOiJzaHV0dGVyc3RvY2stbWVkaWEifSwcZnNyTWhiUThyVTErNy9qMmxNaUc1MFNmWi8wIl0/shutterstock_137111171.jpg"
    }