Shutter Stock
Data AccessExploring Public API Docs of Shutterstock
If you're working on a project that involves photos, videos, or music, you might find Shutterstock's public API docs very useful. They allow developers to access Shutterstock's extensive library of media assets programmatically.
Accessing Shutterstock's API
To access Shutterstock's public API, you will need an API key. You can sign up for a free account and apply for an API key on the developer portal. Once you have your key, you can start exploring the API endpoints and start making requests.
Shutterstock API Endpoints
Shutterstock provides several API endpoints for accessing their media assets. The most commonly used endpoints are those for searching and downloading images, videos, and music.
Here are a few examples of how to use these endpoints:
Search Images
fetch('https://api.shutterstock.com/v2/images/search?query=cat', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_ACCESS_TOKEN'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.log(error));
Search Videos
fetch('https://api.shutterstock.com/v2/videos/search?query=cat', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_ACCESS_TOKEN'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.log(error));
Download an Image
fetch('https://api.shutterstock.com/v2/image-downloads/IMAGE_ID', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_ACCESS_TOKEN'
}
})
.then(response => response.blob())
.then(blob => URL.createObjectURL(blob))
.then(url => console.log(url))
.catch(error => console.log(error));
Download a Video
fetch('https://api.shutterstock.com/v2/video-downloads/VIDEO_ID', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_ACCESS_TOKEN'
}
})
.then(response => response.blob())
.then(blob => URL.createObjectURL(blob))
.then(url => console.log(url))
.catch(error => console.log(error));
Conclusion
Shutterstock's public API is a powerful tool for developers who are working on projects that involve media assets. With the examples provided above, you can start using the API to search and download images, videos, and music. To learn more about the different endpoints and their parameters, check out the Shutterstock developer portal.