/unsplash-api

This is an Express REST API service using Unsplash API

Primary LanguageJavaScript

UNSPLASH API

This is an Express REST API service using UNSPLASH API

Table of content

Technologies

Install and Run

  1. Clone this repository
$ git clone https://github.com/hseoy/unsplash-api
  1. Get the API key from here. Then modify the .env.dev
API_ACCESS_KEY=YOUR_API_ACCESS_KEY
  1. Install dependencies
$ yarn install
  1. Start the server
$ yarn start:dev

Usage

GET / API for testing

Return:

"unsplash api"

GET /photos/search API to search photos

Search photos using the Unsplash API

Queries :

query description is required
query Search terms. yes
page Page number to retrieve. (Optional; default: 1) no
perPage Number of items per page. (Optional; default: 10) no

Return:

[
  // You can check the response here: https://unsplash.com/documentation#search-photos
]

GET /photos/random API to get random photos

Get random photos using the Unsplash API

Queries :

query description is required
query Limit selection to photos matching a search term. yes
count The number of photos to return. (Default: 1; max: 30) no

Return:

[
  // You can check the response here: https://unsplash.com/documentation#get-a-random-photo
]