PHPackages                             diza/unsplash - 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. diza/unsplash

Abandoned → [cetteup/unsplash](/?search=cetteup%2Funsplash)Library

diza/unsplash
=============

Unofficial PHP wrapper to access the Unsplash API

v1.1(5y ago)1114MITPHPPHP &gt;=5.6.0CI failing

Since Jan 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/cetteup/unsplash-php)[ Packagist](https://packagist.org/packages/diza/unsplash)[ RSS](/packages/diza-unsplash/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

unsplash-php
============

[](#unsplash-php)

An unofficial PHP wrapper to access the [Unsplash API](https://unsplash.com/documentation), focused on API call efficiency and ease of use.

*Note:* This wrapper only supports [public actions](https://unsplash.com/documentation#public-actions).

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

[](#installation)

`Unsplash-PHP` uses [Composer](https://getcomposer.org/). To use it, require the library

```
composer require cetteup/unsplash

```

Usage
-----

[](#usage)

### Configuration

[](#configuration)

Before you can start making calls to the API, you need to configure the client with your application ID.

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
```

### API methods

[](#api-methods)

Please refer to the [official documentation](https://unsplash.com/documentation) for more detailed information on the response structures.

#### Cetteup\\Unsplash\\HttpClient-&gt;user\_find($username)

[](#cetteupunsplashhttpclient-user_findusername)

Retrieve public details on a given user.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/Required`$username`stringRequired**Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$user = $unsplash->user_find('cetteup');
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;user\_portfolio\_link($username)

[](#cetteupunsplashhttpclient-user_portfolio_linkusername)

Retrieve a single user’s portfolio link.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/Required`$username`stringRequired**Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$link = $unsplash->user_portfolio_link('cetteup');
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;user\_photos($username, $page, $per\_page, $order\_by, $stats, $resolution, $quantity, $orientation)

[](#cetteupunsplashhttpclient-user_photosusername-page-per_page-order_by-stats-resolution-quantity-orientation)

Get a list of photos uploaded by a user.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/RequiredNote`$username`stringRequired`$page`intOpt *(Default: 1)*`$per_page`intOpt *(Default: 10 / Maximum: 30)*`$order_by`stringOpt *(Default: latest)*Accepted values: `latest`, `oldest`, `popular``$stats`boolOpt *(Default: false)*`$resolution`stringOpt *(Default: days)*Accepted values: `days``$quantity`intOpt *(Default: 30)*`$orientation`stringOptAccepted values: `landscape`, `portrait`, `squarish`**Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$photos = $unsplash->user_photos('cetteup', 2, 30, 'oldest');
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;user\_likes($username, $page, $per\_page, $order\_by, $orientation)

[](#cetteupunsplashhttpclient-user_likesusername-page-per_page-order_by-orientation)

Get a list of photos liked by a user.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/RequiredNote`$username`stringRequired`$page`intOpt *(Default: 1)*`$per_page`intOpt *(Default: 10 / Maximum: 30)*`$order_by`stringOpt *(Default: latest)*Accepted values: `latest`, `oldest`, `popular``$orientation`stringOptAccepted values: `landscape`, `portrait`, `squarish`**Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$photos = $unsplash->user_likes('cetteup', 2, 20, 'popular');
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;user\_collections($username, $page, $per\_page)

[](#cetteupunsplashhttpclient-user_collectionsusername-page-per_page)

Get a list of collections created by a user.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/Required`$username`stringRequired`$page`intOpt *(Default: 1)*`$per_page`intOpt *(Default: 10 / Maximum: 30)***Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$collections = $unsplash->user_collections('jlantunez', 3, 5);
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;user\_statistics($username, $resolution, $quantity)

[](#cetteupunsplashhttpclient-user_statisticsusername-resolution-quantity)

Retrieve the consolidated number of downloads, views and likes of all user’s photos, as well as the historical breakdown and average of these stats in a specific timeframe.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/RequiredNote`$username`stringRequired`$resolution`stringOpt *(Default: days)*Accepted values: `days``$quantity`intOpt *(Default: 30 / Minimum: 1 / Maximum: 30)***Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$collections = $unsplash->user_statistics('cetteup', 'days', 10);
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;photo\_all($page, $per\_page, $order\_by)

[](#cetteupunsplashhttpclient-photo_allpage-per_page-order_by)

Get a single page from the list of all photos.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/RequiredNote`$page`intOpt *(Default: 1)*`$per_page`intOpt *(Default: 10 / Maximum: 30)*`$order_by`stringOpt *(Default: latest)*Accepted values: `latest`, `oldest`, `popular`**Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$photos = $unsplash->photo_all(2, 30, 'oldest');
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;photo\_find($id)

[](#cetteupunsplashhttpclient-photo_findid)

Retrieve a single photo.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/Required`$id`stringRequired**Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$photo = $unsplash->photo_find('54t5rivyAiI');
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;photo\_random($params)

[](#cetteupunsplashhttpclient-photo_randomparams)

Retrieve a single random photo, given [optional filters](https://unsplash.com/documentation#get-a-random-photo).

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/Required`$params`arrayOpt**Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$photo = $unsplash->photo_random(['orientation' => 'portrait']);
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;photo\_statistics($id, $resolution, $quantity)

[](#cetteupunsplashhttpclient-photo_statisticsid-resolution-quantity)

Retrieve total number of downloads, views and likes of a single photo, as well as the historical breakdown of these stats in a specific timeframe.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/RequiredNote`$id`stringRequired`$resolution`stringOpt *(Default: days)*Accepted values: `days``$quantity`intOpt *(Default: 30 / Minimum: 1 / Maximum: 30)***Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$stats = $unsplash->photo_statistics('54t5rivyAiI', 'days', 14);
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;photo\_download($id)

[](#cetteupunsplashhttpclient-photo_downloadid)

Track a photo download.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/Required`$id`stringRequired**Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$unsplash->photo_download('54t5rivyAiI');
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;search\_photos($search, $page, $per\_page, $order\_by, $content\_filter, $collections, $color, $orientation)

[](#cetteupunsplashhttpclient-search_photossearch-page-per_page-order_by-content_filter-collections-color-orientation)

Get a single page of photo results for a query.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/RequiredNote`$search`stringRequiredMultiple search terms need to be separated by ` `, `,` or `+``$page`intOpt *(Default: 1)*`$per_page`intOpt *(Default: 10 / Maximum: 30)*`$order_by`stringOpt *(Default: relevant)*Accepted values: `latest`, `relevant``$content_filter`stringOpt *(Default: low)*Accepted values: `low`, `high``$collections`stringOptMultiple IDs need to be comma-separated`$color`stringOptAccepted values: `black_and_white`, `black`, `white`, `yellow`, `orange`, `red`, `purple`, `magenta`, `green`, `teal`, `and` `blueblack_and_white`, `black`, `white`, `yellow`, `orange`, `red`, `purple`, `magenta`, `green`, `teal`, `blue``$orientation`stringOptAccepted values: `landscape`, `portrait`, `squarish`**Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$results = $unsplash->search_photos('cats', 5, 30);
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;search\_collections($search, $page, $per\_page)

[](#cetteupunsplashhttpclient-search_collectionssearch-page-per_page)

Get a single page of collection results for a query.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/RequiredNote`$search`stringRequiredMultiple search terms need to be separated by ` `, `,` or `+``$page`intOpt *(Default: 1)*`$per_page`intOpt *(Default: 10 / Maximum: 30)***Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$results = $unsplash->search_collections('dogs', 10, 25);
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;search\_users($search, $page, $per\_page)

[](#cetteupunsplashhttpclient-search_userssearch-page-per_page)

Get a single page of user results for a query.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/RequiredNote`$search`stringRequiredMultiple search terms need to be separated by ` `, `,` or `+``$page`intOpt *(Default: 1)*`$per_page`intOpt *(Default: 10 / Maximum: 30)***Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$results = $unsplash->search_users('photography', 1, 15);
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;collection\_all($page, $per\_page)

[](#cetteupunsplashhttpclient-collection_allpage-per_page)

Get a single page from the list of all collections.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/Required`$page`intOpt *(Default: 1)*`$per_page`intOpt *(Default: 10 / Maximum: 30)***Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$collections = $unsplash->collection_all(10, 30);
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;collection\_featured($page, $per\_page)

[](#cetteupunsplashhttpclient-collection_featuredpage-per_page)

Get a single page from the list of featured collections.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/Required`$page`intOpt *(Default: 1)*`$per_page`intOpt *(Default: 10 / Maximum: 30)***Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$collections = $unsplash->collection_featured(2, 10);
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;collection\_find($id)

[](#cetteupunsplashhttpclient-collection_findid)

Retrieve a single collection.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/RequiredNote`$id`intRequired**Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$collection = $unsplash->collection_find(1121542);
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;collection\_photos($id, $page, $per\_page, $orientation)

[](#cetteupunsplashhttpclient-collection_photosid-page-per_page-orientation)

Retrieve a collection’s photos.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/RequiredNote`$id`intRequired`$page`intOpt *(Default: 1)*`$per_page`intOpt *(Default: 10 / Maximum: 30)*`$orientation`stringOptAccepted values: `landscape`, `portrait`, `squarish`**Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$photos = $unsplash->collection_photos(1121542, 1, 10, 'squarish');
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;collection\_related($id)

[](#cetteupunsplashhttpclient-collection_relatedid)

Retrieve a list of related collections.

*Note:* You need to instantiate an httpclient object first

**Arguments**

ArgumentTypeOpt/Required`$id`intRequired**Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$collections = $unsplash->collection_related(1121542);
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;stats\_total()

[](#cetteupunsplashhttpclient-stats_total)

Get a list of stats for all of Unsplash.

*Note:* You need to instantiate an httpclient object first

**Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$stats = $unsplash->stats_total();
```

---

#### Cetteup\\Unsplash\\HttpClient-&gt;stats\_month()

[](#cetteupunsplashhttpclient-stats_month)

Get the overall Unsplash stats for the past 30 days.

*Note:* You need to instantiate an httpclient object first

**Example**

```
$unsplash = new Cetteup\Unsplash\HttpClient('YOUR APPLICATION ID');
$stats = $unsplash->stats_month();
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~628 days

Total

3

Last Release

2143d ago

PHP version history (2 changes)v1.0PHP &gt;=5.5.0

v1.1PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6c33029dfbd80e90592c04bba20cb6d2891f8fcfc3236438114a7e10391cd535?d=identicon)[cetteup](/maintainers/cetteup)

---

Top Contributors

[![cetteup](https://avatars.githubusercontent.com/u/17167062?v=4)](https://github.com/cetteup "cetteup (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/diza-unsplash/health.svg)

```
[![Health](https://phpackages.com/badges/diza-unsplash/health.svg)](https://phpackages.com/packages/diza-unsplash)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k20](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
