PHPackages                             intellexapps/pixabay-api-client - 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. intellexapps/pixabay-api-client

ActiveLibrary[API Development](/categories/api)

intellexapps/pixabay-api-client
===============================

Lightweight PHP client for Pixabay API

v1.0.1(2y ago)05MITPHPPHP &gt;=7.4

Since Dec 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/IntellexApps/pixabay-api-client)[ Packagist](https://packagist.org/packages/intellexapps/pixabay-api-client)[ RSS](/packages/intellexapps-pixabay-api-client/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (3)Used By (0)

Lightweight PHP client for Pixabay API
======================================

[](#lightweight-php-client-for-pixabay-api)

- Support for the complete **Pixabay API**
- Both **image** and **video**
- Define search parameters using **type-strict fluent setters**
- Utility class for **downloading** the results
- **No 3rd party** libraries used

Disclaimer
----------

[](#disclaimer)

During development there were some minor changes in the API: they removed "favorites" count from the response. However, this broke our code and made v1.x.x unusable.

***BE ADVISED***: Any changes on the side of Pixabay ***CAN*** render this library unusable at any point. For more info, see the [Licence](LICENSE).

Usage
-----

[](#usage)

These are snippets from the files in the [tests/examples](tests/examples) directory.

#### Videos

[](#videos)

```
// Invoke the API directly by passing an array for the search
$response = (new VideoApi(API_KEY))->fetch(new VideoSearchParams([
	'category'       => Category::TRANSPORTATION,
	'editors_choice' => true,
	'per_page'       => 3
]));

// Show images
foreach ($response->getVideos() as $video) {
	echo $video->getMediumVideo()->getUrl() . PHP_EOL;
}
```

#### Images

[](#images)

```
// Define search parameters using fluent setters
$search = (new ImageSearchParams())
	->setColors([ Color::GREEN, Color::ORANGE ])
	->setImageType(ImageType::PHOTO)
	->setCategory(Category::NATURE)
	->setEditorsChoice(true)
	->setPerPage(3);

// Invoke the API
$response = (new ImageApi(API_KEY))->fetch($search);

// Show images
foreach ($response->getImages() as $image) {
	echo $image->getURLForSize180() . PHP_EOL;
}
```

#### Download results

[](#download-results)

```
// Destination must be defined
if ($argc < 2) {
	echo "Usage: php -f tests/examples/download.php  ";
	exit(1);
}

// Read the input parameters
$count = (int) min(50, $argv[2] ?? 50);
$destination = rtrim($argv[1], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
if (!is_dir($destination) || !is_writable($destination)) {
	echo "Supplied destination is not a writable directory: ${destination}";
	exit(2);
}

// Invoke the API
$response = (new ImageApi(API_KEY))->fetch(new ImageSearchParams([
	PixabayParam::Q              => 'kitten',
	PixabayParam::CATEGORY       => Category::ANIMALS,
	PixabayParam::IMAGE_TYPE     => ImageType::PHOTO,
	PixabayParam::ORIENTATION    => Orientation::HORIZONTAL,
	PixabayParam::PER_PAGE       => $count,
	PixabayParam::SAFE_SEARCH    => true,
	PixabayParam::EDITORS_CHOICE => true,
	PixabayParam::ORDER          => OrderAlias::POPULAR
]));

// Download and store
$images = $response->getImages();
$count = count($images);
foreach ($images as $i => $image) {
	$preview = explode('/', $image->getPreviewURL());
	$name = end($preview) . PHP_EOL;
	echo sprintf("%3s / %3s, %s", $i + 1, $count, $name);
	Downloader::downloadTo($image->getLargeImageURL(), "{$destination}/{$name}");
}
```

Run examples
------------

[](#run-examples)

In order to run examples the Pixabay API key needs to be defined.

```
PIXABAY_API_KEY=0000000-0000000000000000000000000 php -f tests/examples/images.php
PIXABAY_API_KEY=0000000-0000000000000000000000000 php -f tests/examples/videos.php
PIXABAY_API_KEY=0000000-0000000000000000000000000 php -f tests/examples/download.php ~/Desktop/ 5
```

References
----------

[](#references)

- [The official Pixabay API docs](https://pixabay.com/api/docs/).

Credits
-------

[](#credits)

Script has been written by the [Intellex](https://intellex.rs/en) team.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

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 ~0 days

Total

2

Last Release

929d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9035401?v=4)[Intellex](/maintainers/intellexapps)[@IntellexApps](https://github.com/IntellexApps)

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/intellexapps-pixabay-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/intellexapps-pixabay-api-client/health.svg)](https://phpackages.com/packages/intellexapps-pixabay-api-client)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k13](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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