# Display a Random Image Using the Unsplash API
by [kirupa](https://www.kirupa.com/about/whatiskirupa.htm) | filed under [Coding Exercises](https://www.kirupa.com/codingexercises/index.htm)
The internet has no shortage of useful and free resources that make our lives as designers and developers better. Top of that list is [Unsplash](https://www.unsplash.com) and its large collection of free to use photos. What we are going to do in this coding exercise is use their [awesome API](https://unsplash.com/developers) to create a simple page that displays a random image from their collection.
The page you'll be creating will look as follows:

The page will contain a heading that says ***Random Unsplash Image***, a (slightly rotated) image element that will display the random image from the Unsplash API, and a small text region that credits the photographer whose image is being displayed above.
Onwards!
## Starting Point
The easiest way is to fork the following Codepen pen and start adding your modifications:
See the Pen [ Coding Exercises Start](https://codepen.io/kirupa/pen/qBYxQpr) by Kirupa Chinnathambi ([@kirupa](https://codepen.io/kirupa)) on [CodePen](https://codepen.io).
You may want to open the pen [in a new window](https://codepen.io/kirupa/pen/qBYxQpr) if you want more space to code your solution or bring up the Console to see the output.
If you prefer developing locally in your favorite code editor (like Visual Studio Code), create a new HTML document and copy/paste the following boilerplate/starting content into it:
```js
Coding Exercises Start
```
The HTML you see here is just the bare minimum content needed to help us get our web page up and running. The rest of the content is what you will add entirely on your own!
#### Hint: Some Learning Resources
The following tutorial may provide some helpful tips and techniques to help you with this exercise: [Making HTTP/Web Requests in JavaScript](https://www.kirupa.com/html5/making_http_requests_js.htm)
## Getting Your Badge
Once you have completed this challenge, you have earned the awesome bragworthy privilege of adding the following badge to [your collection](https://forum.kirupa.com/badges/):

To claim it, head over to the forums and respond in the [Display a Random Image Using the Unsplash API topic](https://forum.kirupa.com/t/display-a-random-image-using-the-unsplash-api/653866). **Be sure to include a link to your solution or insert a copy of your HTML/CSS/JS in the body of the message:**

Once you have created your topic, Kirupa will give you a virtual high-five and ensure this badge is added to your list of assigned badges.
## Stuck? Need Help?
We want to make this a fun learning activity. If you are stuck and need help, please [ask on the forums](https://forum.kirupa.com). Please explain your problem in detail and one of the many helpful forum members will help you out.
## One Possible Solution
If you want to see ***one*** way of solving this, check out Kirupa's video below:
There are many solutions possible, so don't worry if your working solution looks different. If it is different, do share it on the forums and the community as a whole will benefit from your creative solution!