REST API

Integrate search & discovery of free, hi resolution photos & videos — from travelcoffeebook, startupstockphotos, littlevisuals, gratisography, getrefe, jaymantri, superfamous, mazwai, unsplash, snapographic, moveast, snapwiresnaps, newoldstock, splitshire, camarama, mmt, lifeofpix, crowthestone, skitterphoto — into your apps.

Contents

Images/videos Sources Are you using our API? Let us know, we want to feature you here!

Images/videos


Get an image/video by ID

GET /api/v1/images/:id
Params: id - image ID
Examples (Ruby):
res = RestClient.get("http://www.splashbase.co/api/v1/images/1")

res.code
=> 200

resp.body
=> {"id":1,"url":"https://splashbase.s3.amazonaws.com/unsplash/regular/tumblr_mnh0n9pHJW1st5lhmo1_1280.jpg","large_url":"https://splashbase.s3.amazonaws.com/unsplash/large/17c4qcC","source_id":1,"copyright":"CC0","site":"unsplash"}

res = RestClient.get("http://www.splashbase.co/api/v1/images/100000", "token" => "dcbb7b36acd4438d07abafb8e28605a4")
   => RestClient::ResourceNotFound: 404 Resource Not Found: {"message":"Resource not found"}

Get a random image/video

GET /api/v1/images/random
Params: images_only=true will return images only; videos_only=true will return videos only; no params will return a random image or video
Examples (Ruby):
res = RestClient.get("http://www.splashbase.co/api/v1/images/random")

res.code
=> 200

resp.body
=> {"id":679,"url":"https://splashbase.s3.amazonaws.com/gratisography/regular/10H.jpg","large_url":"https://splashbase.s3.amazonaws.com/gratisography/large/10H.jpg","source_id":266,"copyright":"CC0","site":"gratisography"}

Get latest 10 images/videos

GET /api/v1/images/latest
Params: images_only=true will return images only; videos_only=true will return videos only; no params will return both images and videos
Examples (Ruby):
res = RestClient.get("http://www.splashbase.co/api/v1/images/latest")

res.code
=> 200

resp.body
=> {"images":[{"id":414,"url":"https://splashbase.s3.amazonaws.com/unsplash/regular/tumblr_mtax0twHix1st5lhmo1_1280.jpg","large_url":"https://splashbase.s3.amazonaws.com/unsplash/large/1bqbiVH","source_id":64}, 
{"id":415,"url":"https://splashbase.s3.amazonaws.com/unsplash/regular/tumblr_mtawb6Bzzy1st5lhmo1_1280.jpg","large_url":"https://splashbase.s3.amazonaws.com/unsplash/large/186zZmU","source_id":66}, ... ]}

Get images/videos by a search query

GET /api/v1/images/search
Params: query - your search query
Examples (Ruby):
res = RestClient.get("http://www.splashbase.co/api/v1/images/search", "query" => "laptop")

res.code
=> 200

resp.body
=> {"images":[{"id":1,"url":"https://splashbase.s3.amazonaws.com/unsplash/regular/tumblr_mnh0n9pHJW1st5lhmo1_1280.jpg","large_url":"https://splashbase.s3.amazonaws.com/unsplash/large/17c4qcC","source_id":1,"copyright":"CC0","site":"unsplash"}]}

Sources

Get a source by ID

GET /api/v1/sources/:id
Examples (Ruby):
res = RestClient.get("http://www.splashbase.co/api/v1/sources")

res.code
=> 200

resp.body
=> {"id":1,"name":"Alejandro Escamilla","url":"http://alejandroescamilla.com/","image_count":22,
"images":[{"id":3,"url":"https://splashbase.s3.amazonaws.com/unsplash/regular/tumblr_mnh121HEWa1st5lhmo1_1280.jpg","large_url":"https://splashbase.s3.amazonaws.com/unsplash/large/10OiOQX","source_id":1}, ... ]}

res = RestClient.get("http://www.splashbase.co/api/v1/sources/100000", "token" => "dcbb7b36acd4438d07abafb8e28605a4")
=> RestClient::ResourceNotFound: 404 Resource Not Found: {"message":"Resource not found"}