Steff K
Steff K

Reputation: 11

The result of the search query differs in the API and Shutterstock website

please help me. The result of the search query differs in the API and Shutterstock website. What am I doing wrong?

API returns only 4 results, but at shutterstock - thousands My code:

$queryFields = [
  "query" => "осень лес векторы"
];

$options = [
  CURLOPT_URL => "https://api.shutterstock.com/v2/images/search?" . http_build_query($queryFields),
  CURLOPT_USERAGENT => "php/curl",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer xxxxx"
  ],
  CURLOPT_RETURNTRANSFER => 1
];

$handle = curl_init();
curl_setopt_array($handle, $options);
$response = curl_exec($handle);
curl_close($handle);

$decodedResponse = json_decode($response);

echo "<pre>"; 
    print_r( $decodedResponse ); 
echo "</pre>";

Thank you.

Upvotes: 1

Views: 147

Answers (1)

Jacob Emerick
Jacob Emerick

Reputation: 56

The default API access (Self Serve, or Free product) is limited to a subset of Shutterstock's library - only about 1 million images. That's why you only see 4 results for your search compared to the website. If you need access to more content, just reach out to the team - https://developers.shutterstock.com/contact-us

Upvotes: 1

Related Questions