JS-151-API
  • JavaScript Library
  • 02-DOM-Manipulation
    • Overview
    • DOM Explained
    • Example Setup
    • Selecting Elements
    • Events
    • Complete Example
  • 03-API Fundamentals
    • 0-Getting Started
      • Welcome
    • 1-Intro-To-APIs
      • Intro
      • Client
      • Requests
      • JSON
      • API Endpoints
      • Server
      • Response
      • Statelessness
      • REST
    • 2-Asynchronous-Programming
      • Intro
      • Callbacks
      • Promises
      • Promises Continued
      • Chaining Promises
    • 3-Fetch
      • Fetch Intro
      • Star Wars
        • Star Wars API
        • Star Wars Setup
        • Star Wars JS
      • Random Photo
        • Unsplash
        • Unsplash Setup
        • Unsplash JS
    • 4-Apps
      • 01-New York Times
        • 00-App Intro
        • 01-HTML/CSS/API Key
        • 02-Variables
        • 03-Event Listeners
        • 04-fetchResults
          • 01-fetchResults()
          • 02-preventDefault()
          • 03-fetch() method
          • 04-Dates
        • 05-displayResults
          • 01-Logging JSON
          • 02-Working with JSON
          • 03-Link Display
          • 04-Results Navigation
          • 05-Results Update
          • 06-Keywords
          • 07-Images
        • 06-Pagination
          • 01-Pagination Intro
          • 02-Pagination Functions
        • 07-Next Steps
      • 02-YouTube
        • html
        • youtube.css
        • youtube.js
      • 03-GoogleMaps
        • Setup
        • HTML and CSS files
        • API Key
        • JS Setup
        • Adding Your Location
        • Listeners
        • Custom Options
Powered by GitBook
On this page
  • Unsplash API Docs
  • Get a Random Photo
  • Parameters
  • What We're Going to Build
  1. 03-API Fundamentals
  2. 3-Fetch
  3. Random Photo

Unsplash

PreviousRandom PhotoNextUnsplash Setup

Last updated 7 years ago

The Unsplash API allows you to get high-resolution images that you can use in your applications! This API is awesome because you can get random images without needing to register for an API key. Let's check out the docs for Unsplash, specifically the .

Unsplash API Docs

Check out the request, parameters, and response information contained in the docs. Note the following important information.

Get a Random Photo

Retrieve a single random photo, given optional filters. GET /photos/random

Parameters

All parameters are optional and can be combined to narrow the pool of photos from which a random one will be chosen.

What We're Going to Build

We're going to build an app that grabs a random beautiful photo from Unsplash on every refresh.

get random photo