Searching For and Displaying Content

Searching For Content

For detailed information on searching, including an example request and response, check out the various media search endpoints:


Displaying Content

Perform a search and capture the results.

$ curl "https://${client_id}:${client_secret}@api.shutterstock.com/v2/images/search?query=iceland"

Loop over the results' data property and create image tags using the preview and thumbnail attributes.

{% for image in results.data %}
    <img src="{{ image.assets.small_thumb.url }}"></img>
    <img src="{{ image.assets.large_thumb.url }}"></img>
    <img src="{{ image.assets.preview.url }}"></img>
{% endfor %}

Shutterstock thumbnails come with IDs embedded into the image themselves. The API gives you the information you need to hide these IDs.

For thumbnails, either the actual jpg width or actual jpg height will be different from the width or height returned by the API. The width and height returned by the API is the appropriate cropped display size, not the size of the jpg itself.

To hide these IDs, enclose the jpgs inside a div of the returned width and height, with overflow set to hidden. The ID at the bottom or right of the jpg will overflow beyond the dimensions of the containing div and disappear. For example:

<div style="height:110px;width:150px;overflow:hidden">
  <img src="http://thumb7.shutterstock.com/thumb_large/371512/108559295/stock-photo-donkey-isolated-on-white-108559295.jpg">
</div>

Operators

Shutterstock supports standard search operators: AND, OR and NOT. These operators can be used to combine, or exclude, keywords in order to create complex search queries. These are boolean operators, they need to match exactly in UPPERCASE and in English, even if the search terms themselves are submitted in another language.

AND

Searches for results with multiple keywords. Note that this operator is implicitly added between all search terms, for example the following two queries are identical.

  • dog cat
  • dog AND cat
  • chien AND chat

Invalid examples:

  • chien ET chat
  • dog and cat
$ curl "https://${client_id}:${client_secret}@api.shutterstock.com/v2/images/search?query=dog%20AND%20cat"
OR

Searches for results containing any of the specified keywords.

  • dog OR cat
$ curl "https://${client_id}:${client_secret}@api.shutterstock.com/v2/images/search?query=dog%20OR%20cat"
NOT

Exclude keywords from search results.

  • dog NOT hot dog
$ curl "https://${client_id}:${client_secret}@api.shutterstock.com/v2/images/search?query=dog%20NOT%20hot%20dog"

Other parameters which support negation:

  • contributor

To pass multiple parameters see the API Conventions.

Grouping

To group conditional queries together use parentheses '()'.

  • (dog NOT cat) OR (cat NOT dog) AND (monkey OR donkey)
$ curl "https://${client_id}:${client_secret}@api.shutterstock.com/v2/images/search?query=(dog%20NOT%20cat)%20OR%20(cat%20NOT%20dog)%20AND%20(monkey%20OR%20donkey)"
Partial matches

Search does not support the wildcard (*) operator explicitly, however, all search terms are stemmed. For example, a search for door will match door, doors, and doorbell.


Supported Languages

  • Czech (cs)
  • Danish (da)
  • German (de)
  • English (en)
  • Spanish (es)
  • Finnish (fi)
  • French (fr)
  • Hungarian (hu)
  • Italian (it)
  • Japanese (ja)
  • Korean (ko)
  • Norwegian (nb)
  • Dutch (nl)
  • Polish (pl)
  • Portuguese (pt)
  • Russian (ru)
  • Swedish (sv)
  • Thai (th)
  • Turkish (tr)
  • Chinese (zh)

The default is English.

$ curl "https://${client_id}:${client_secret}@api.shutterstock.com/v2/images/search?query=chien&language=fr"