unsplash v1.1.0 Unsplash.Users View Source

API endpoints for current-user and users

Link to this section Summary

Functions

GET /users/:username/collections

GET /users/:username

GET /users/:username/likes

GET /me

GET /users/:username/photos

GET /users/:username/portfolio

GET /users/:username/statistics

Link to this section Functions

Link to this function

collections(username, opts \\ []) View Source

GET /users/:username/collections

Args:

  • username - The user’s username. Required

GET /users/:username

The image URLs returned for the user’s profile image are instances of dynamically resizable image URLs.

Args:

  • username - the username string
Link to this function

likes(username, opts \\ []) View Source

GET /users/:username/likes

Args:

  • username the username string
  • opts keyword list of optional params

Options:

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

GET /me

Requires read_user scope

Link to this function

photos(username, opts \\ []) View Source

GET /users/:username/photos

Args:

  • username The user’s username. Required.
  • opts keyword list of optional params

Options:

  • page Page number to retrieve. (Optional; default: 1)
  • per_page Number of items per page. (Optional; default: 10)
  • order_by How to sort the photos. Optional. (Valid values: latest, oldest, popular; default: latest)
  • stats how the stats for each user’s photo. (Optional; default: false)
  • resolution The frequency of the stats. (Optional; default: “days”)
  • quantity The amount of for each stat. (Optional; default: 30)

GET /users/:username/portfolio

Retrieve a single user’s portfolio link.

Args:

  • username - The user’s username. Required.
Link to this function

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

GET /users/:username/statistics

Args:

  • username -The user’s username. Required.
  • opts keyword list of optional params

Options:

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

PUT /me

Args:

  • opts keyword list of optional params

Options:

  • username - Username.
  • first_name - First name.
  • last_name - Last name.
  • email - Email.
  • url - Portfolio/personal URL.
  • location - Location.
  • bio - About/bio.
  • instagram_username - Instagram username.

Requires write_user scope