PHPackages                             sandeepv/wrapsplash-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sandeepv/wrapsplash-php

ActiveLibrary[API Development](/categories/api)

sandeepv/wrapsplash-php
=======================

A PHP API wrapper for the Unsplash platform

v1.0.0(today)10MITPHPPHP &gt;=8.1CI passing

Since Jul 23Pushed todayCompare

[ Source](https://github.com/Sandeepv68/wrapsplash-php)[ Packagist](https://packagist.org/packages/sandeepv/wrapsplash-php)[ RSS](/packages/sandeepv-wrapsplash-php/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

 [![WrapSplashPHP](assets/logo.png)](assets/logo.png)

WrapSplashPHP v1.0.0
====================

[](#wrapsplashphp-v100)

A simple, synchronous API wrapper for the popular [Unsplash](https://unsplash.com/) platform, written in **PHP**. This is a direct port of [WrapSplashTS](https://github.com/SandeepVattapparambil/wrapsplash) for the PHP ecosystem.

Unsplash provides beautiful high quality free images and photos that you can download and use for any project without any attribution.

Before using the Unsplash API, you need to **register as a developer** and **read the API Guidelines.**

> **Note:** Every application must abide by the [API Guidelines](https://unsplash.com/documentation). Specifically, remember to hotlink images and trigger a download when appropriate.

Table of Contents
-----------------

[](#table-of-contents)

- [About](#wrapsplashphp-v100)
- [Requirements](#requirements)
- [Installation](#installation)
- [Sample Usage](#sample-usage)
- [Development](#development)
- [Dependency](#dependency)
- [API Documentation](#api-documentation)
    - [Schema](#schema)
        - [Location](#location)
        - [Summary Objects](#summary-objects)
        - [Error Messages](#error-messages)
    - [Authorization](#authorization)
        - [Public Actions](#public-actions)
        - [User Authentication](#user-authentication)
        - [Wrapsplash init()](#wrapsplash-init)
        - [Generate Bearer Token](#generate-bearer-token)
    - [Users APIs](#users-apis)
        - [Get User's Public Profile](#get-users-public-profile)
        - [Get User's Portfolio Link](#get-users-portfolio-link)
        - [Get User's Photos](#get-users-photos)
        - [Get User Liked Photos](#get-user-liked-photos)
        - [Get User's Collections](#get-users-collections)
        - [Get User's Statistics](#get-users-statistics)
    - [Photos APIs](#photos-apis)
        - [List Photos](#list-photos)
        - [List Curated Photos](#list-curated-photos)
        - [Get a Photo by Id](#get-a-photo-by-id)
        - [Get a Random Photo](#get-a-random-photo)
        - [Get a Photo's Statistics](#get-a-photos-statistics)
        - [Get a Photo's Download Link](#get-a-photos-download-link)
        - [Update a Photo](#update-a-photo)
        - [Like a Photo](#like-a-photo)
        - [Unlike a Photo](#unlike-a-photo)
    - [Search APIs](#search-apis)
        - [Search Photos](#search-photos)
        - [Search Collections](#search-collections)
        - [Search Users](#search-users)
    - [Current User APIs](#current-user-apis)
        - [Get the user's profile](#get-users-profile)
        - [Update User's Profile](#update-users-profile)
    - [Stats APIs](#stats-apis)
        - [Totals](#stats-totals)
        - [Months](#stats-month)
    - [Collections APIs](#collections-apis)
        - [Link Relations](#link-relations)
        - [List Collections](#list-collections)
        - [List Featured Collections](#list-featured-collections)
        - [List Curated Collections](#list-curated-collections)
        - [Get a Collection](#get-a-collection)
        - [Get a Curated Collection](#get-a-curated-collection)
        - [Get a Collection's Photos](#get-a-collections-photos)
        - [Get a Curated Collection's Photos](#get-a-curated-collections-photos)
        - [List a Collection's Related Collections](#list-a-collections-related-collections)
        - [Create a New Collection](#create-a-new-collection)
        - [Update an Existing Collection](#update-an-existing-collection)
        - [Delete a Collection](#delete-a-collection)
        - [Add a Photo to a Collection](#add-a-photo-to-a-collection)
        - [Remove a Photo from a Collection](#remove-a-photo-from-a-collection)
- [Tests](#tests)
- [License](#license)
- [Acknowledgements](#acknowledgements)

Requirements
------------

[](#requirements)

- PHP 8.1+
- [Guzzle 7](https://docs.guzzlephp.org/) (HTTP client)

Installation
------------

[](#installation)

Install the package from Composer

```
composer require sandeepv/wrapsplash-php
```

### Sample usage

[](#sample-usage)

```
