How to hit the Unsplash API

Unsplash's API lives at https://api.unsplash.com. Its guidelines require hotlinking the returned image URLs and crediting the photographer.

Authentication

Register an app at unsplash.com/oauth/applications and send its access key as Authorization: Client-ID <key>. In the examples it's written {{UNSPLASH_ACCESS_KEY}}.

Full reference: https://unsplash.com/documentation

Random photo

curl "https://api.unsplash.com/photos/random?query=mountains" \
  -H "Authorization: Client-ID {{UNSPLASH_ACCESS_KEY}}"
Run in PostTaco