unsplash v1.1.0 Unsplash.Photos View Source

All /photos/* api endpoints

Link to this section Summary

Functions

GET /photos

GET /photos/curated

GET /photos/:id/download

GET /photos/:id

POST /photos/:id/like

GET /photos/random

POST /photos/:id/statistics

DELETE /photos/:id/like

PUT /photos/:id

Link to this section Functions

GET /photos

Args:

  • opts - Keyword list of options

Options:

  • order_by - How to sort the photos. Optional. (Valid values: latest, oldest, popular; default: latest)

GET /photos/curated

Args:

  • opts - Keyword list of options

Options:

  • order_by - How to sort the photos. Optional. (Valid values: latest, oldest, popular; default: latest)

GET /photos/:id/download

Args:

  • id - the photo id

GET /photos/:id

Returns instances of dynamically resizable image URLs.

Args:

  • id - the photo id

POST /photos/:id/like

Args:

  • id - the photo id

Requires the write_likes scope

GET /photos/random

Returns instances of dynamically resizable image URLs.

Args:

  • opts - Keyword list of options

Options:

  • collections - Public collection ID(‘s) to filter selection. If multiple, comma-separated
  • featured - Limit selection to featured photos.
  • username - Limit selection to a single user.
  • query - Limit selection to photos matching a search term.
  • orientation - Filter search results by photo orientation. Valid values are landscape, portrait, and squarish.
  • count - The number of photos to return. (Default: 1; max: 30)
Link to this function

statistics(id, opts \\ []) View Source

POST /photos/:id/statistics

Args

  • id - The public id of the photo. Required.
  • opts - Keyword list of options

Options:

  • resolution - The frequency of the stats. (Optional; default: “days”)
  • quantity - The amount of for each stat. (Optional; default: 30)

DELETE /photos/:id/like

Args:

  • id - the photo id

PUT /photos/:id

Args:

  • id - The photo’s ID. Required.
  • opts - Keyword list of options

Options:

  • location[latitude] - The photo location’s latitude (Optional)
  • location[longitude] - The photo location’s longitude (Optional)
  • location[name] - The photo location’s name (Optional)
  • location[city] - The photo location’s city (Optional)
  • location[country] - The photo location’s country (Optional)
  • location[confidential] - The photo location’s confidentiality (Optional)
  • exif[make] - Camera’s brand (Optional)
  • exif[model] - Camera’s model (Optional)
  • exif[exposure_time] - Camera’s exposure time (Optional)
  • exif[aperture_value] - Camera’s aperture value (Optional)
  • exif[focal_length] - Camera’s focal length (Optional)
  • exif[iso_speed_ratings] - Camera’s iso (Optional)

Requires the write_photos scope