Unsplash Source

A simple API for embedding Unsplash photos.

Simply add photo dimensions after the URL (ex: /800x600)

Random from a category

Get a random photos from a specific category.

Parameters
https://source.unsplash.com/category/{CATEGORY NAME}

* Optionally, to specify a size, append it at the end of the base URL.

Categories
  • buildings
  • food
  • nature
  • people
  • technology
  • objects
Example
https://source.unsplash.com/category/nature/1600x900
HTML Example
<img src="https://source.unsplash.com/category/nature/1600x900">

Random from a specific user

To choose a random photo from a specific user, the format follows that of selecting from a category.

Parameters
https://source.unsplash.com/user/{USERNAME}

* Optionally, to specify a size, append it at the end of the base URL.

Example
https://source.unsplash.com/user/erondu/1600x900
HTML Example
<img src="https://source.unsplash.com/user/erondu/1600x900">

Random from a user's likes

Similar to finding a photo taken by a user, you can fetch a random photo that has been liked by a specific user.

Parameters
https://source.unsplash.com/user/{USERNAME}/likes

* Optionally, to specify a size, append it at the end of the base URL.

Example
https://source.unsplash.com/user/jackie/likes/1600x900
HTML Example
<img src="https://source.unsplash.com/user/jackie/likes/1600x900">

Random from a collection

You can also select a random photo from a given collection.

Parameters
https://source.unsplash.com/collection/{COLLECTION ID}

* Optionally, to specify a size, append it at the end of the base URL.

Example
https://source.unsplash.com/collection/190727/1600x900
HTML Example
<img src="https://source.unsplash.com/collection/190727/1600x900">

Fixed daily/weekly photo

All of the above URL's will give you a new photo each time they are requested (provided there are enough photos to choose from given the filtering). However each can also be limited to only updating once per day or week. To do so, simply append /daily or /weekly to the URL.

Random
https://source.unsplash.com/daily
Random from a category
https://source.unsplash.com/category/nature/weekly
Random from a user
https://source.unsplash.com/user/erondu/daily
Random from a search term
https://source.unsplash.com/weekly?water

Random search term

Using any of the above formats, you can narrow the selection of a random photo even further by supplying a list of comma-separated search terms at the end of the URL.

If you'd like to limit the results to only those photos included in our curated collections, simply add featured at the end of the URL.

Parameters
https://source.unsplash.com/featured/?{KEYWORD},{KEYWORD}

* Optionally, to specify a size, place it after the base URL.

Search with size
https://source.unsplash.com/1600x900/?nature,water
Search the full database by category
https://source.unsplash.com/category/buildings/?montreal

Specific photo

To get a specific photo, simply append its photo ID to the embed URL. You can also embed a specific size.

* The photo ID can be found in the address bar in the standalone photo page (show me how).

Parameters
https://source.unsplash.com/{PHOTO ID}/{WIDTHxHEIGHT}
Example
https://source.unsplash.com/WLUHO9A_xik/1600x900
HTML Example
<img src="https://source.unsplash.com/WLUHO9A_xik/1600x900">

Need more?

For a more advanced integration, check out our full API at unsplash.com/developers

If you have any questions, concerns or suggestions don't hesitate to talk to us.