PHPackages                             joukhar/laravel-pixabay - 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. joukhar/laravel-pixabay

ActiveLibrary[API Development](/categories/api)

joukhar/laravel-pixabay
=======================

Laravel package for accessing the Pixabay API effortlessly.

v1.1.0(1y ago)216MITPHPPHP ^8.0

Since Sep 21Pushed 1y agoCompare

[ Source](https://github.com/joukhar/laravel-pixabay)[ Packagist](https://packagist.org/packages/joukhar/laravel-pixabay)[ Docs](https://github.com/joukhar/laravel-pixabay)[ GitHub Sponsors](https://github.com/joukhar)[ RSS](/packages/joukhar-laravel-pixabay/feed)WikiDiscussions main Synced 1mo ago

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

Laravel package for accessing the Pixabay API effortlessly.
===========================================================

[](#laravel-package-for-accessing-the-pixabay-api-effortlessly)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ad6b7913ddb87c0495aa9b83d06e283c634fe9d5860c61efdb4cabe2c6bec338/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f756b6861722f6c61726176656c2d706978616261792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/joukhar/laravel-pixabay)[![GitHub Tests Action Status](https://camo.githubusercontent.com/2bc3364751f662bdb4761edc2d448fdbdeaf46b02d76b1214fa18f1afb9c1acd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6f756b6861722f6c61726176656c2d706978616261792f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/joukhar/laravel-pixabay/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/a4bf26a53291f2ee329aa63a78daead84cbf9fef9cd60b24c4827d3a1db03284/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6f756b6861722f6c61726176656c2d706978616261792f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/joukhar/laravel-pixabay/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/c1c0c47cd97460b9b69cd3c7b44b37e864929831fbfc54b56ed5d412496b7a52/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f756b6861722f6c61726176656c2d706978616261792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/joukhar/laravel-pixabay)

Overview
--------

[](#overview)

LaravelPixabay is a Laravel package that simplifies the process of interacting with the Pixabay API. It provides a way to search and retrieve images and videos from the Pixabay platform with minimal effort. This package includes various customizable options like image/video type, categories, order, page results, and more.

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

[](#requirements)

- PHP 8.0 or higher
- Laravel 9.x or higher
- Pixabay API key (you can get this from [Pixabay's Developer page](https://pixabay.com/api/docs/))

Support us
----------

[](#support-us)

If you find my packages useful, consider buying me a coffee to support further development.

[![Buy Me A Coffee](https://camo.githubusercontent.com/0cf29a542375e1a46e84d8bf5805a4e5c0a6ee98b6547ccdc0c55eed49d99c69/68747470733a2f2f63646e2e6275796d6561636f666665652e636f6d2f627574746f6e732f76322f64656661756c742d79656c6c6f772e706e67 "Buy Me A Coffee")](https://www.buymeacoffee.com/joukhar)

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

[](#installation)

You can install the package via composer:

```
composer require joukhar/laravel-pixabay
```

You can publish the config file or add pixabay service to (config/services.php) file:

```
php artisan vendor:publish --tag="laravel-pixabay-config"
```

Configuration file (config/pixabay.php):

```
return [
    'key' => env('PIXABAY_API_KEY'),
];
```

Then add your Pixabay API key to the .env file:

```
PIXABAY_KEY=your_pixabay_api_key
```

Usage
-----

[](#usage)

#### get images

[](#get-images)

```
$laravelPixabay = new Joukhar\LaravelPixabay();
$laravelPixabay->getImages();
```

#### get specific image

[](#get-specific-image)

```
$laravelPixabay = new Joukhar\LaravelPixabay();
$laravelPixabay->getImages(id:"< IMAGE ID HERE >");
```

#### get images with specific type ( `Default : PixabayImageType::ALL` )

[](#get-images-with-specific-type--default--pixabayimagetypeall-)

```
use Joukhar\LaravelPixabay\Enums\PixabayImageType;

$laravelPixabay = new Joukhar\LaravelPixabay();
$laravelPixabay->getImages(type: PixabayImageType::ILLUSTRATION );
```

#### get videos

[](#get-videos)

```
$laravelPixabay = new Joukhar\LaravelPixabay();
$laravelPixabay->getVideos();
```

#### get videos with specific type ( `Default : PixabayVideoType::ALL` )

[](#get-videos-with-specific-type--default--pixabayvideotypeall-)

```
use Joukhar\LaravelPixabay\Enums\PixabayVideoType;

$laravelPixabay = new Joukhar\LaravelPixabay();
$laravelPixabay->getVideos(type: PixabayVideoType::ANIMATION);
```

#### get specific video

[](#get-specific-video)

```
$laravelPixabay = new Joukhar\LaravelPixabay();
$laravelPixabay->getVideos(id:"< VIDEO ID HERE >");
```

### Customizing API Requests

[](#customizing-api-requests)

You can customize your queries using several configuration methods provided by the `LaravelPixabay` class.

**Set Current Page**

You can specify which page of results to fetch using `setCurrentPage()`:

```
$pixabay->setCurrentPage(2);
```

**Set Maximum Results Per Page**

The number of results per page can be adjusted using `setMaxResults()`:

```
$pixabay->setMaxResults(50);
```

**Enable Safe Search**

To filter out adult content, use `setSafeSearch()`:

```
$pixabay->setSafeSearch(true);
```

**Only Editor's Choice**

You can request only editor's choice images or videos using `setOnlyEditorChoice()`:

```
$pixabay->setOnlyEditorChoice(true);
```

**Set Category**

To fetch resources of a specific category, use `setCategory()`:

```
use Joukhar\LaravelPixabay\Enums\PixabayCategory;

$pixabay->setCategory(PixabayCategory::NATURE);
```

**Set Order**

To order results by popularity, latest, or custom order, use `setOrder()`:

```
$pixabay->setOrder('latest');
```

**Set Minimum Dimensions**

You can set the minimum width and height for the images/videos to be returned using `setDimentions()`:

```
$pixabay->setDimentions(800, 600);
```

#### Example: Fetching Nature Photos

[](#example-fetching-nature-photos)

```
use Joukhar\LaravelPixabay\LaravelPixabay;
use Joukhar\LaravelPixabay\Enums\PixabayCategory;
use Joukhar\LaravelPixabay\Enums\PixabayImageType;

$pixabay = new LaravelPixabay();
$photos = $pixabay
    ->setCategory(PixabayCategory::NATURE)
    ->setMaxResults(10)
    ->setSafeSearch(true)
    ->getImages(null, PixabayImageType::PHOTO);
```

Exception Handling
------------------

[](#exception-handling)

If there is an issue with the API request (e.g., invalid API key, request failure), the package throws an `Exception` with a detailed error message.

```
try {
    $images = $pixabay->getImages();
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [joukhar](https://github.com/joukhar)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61% 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 ~7 days

Total

3

Last Release

584d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a88a047c007dd922a9dba1b268c38c085b1e62b8f675cc8ace028efbdf6945b1?d=identicon)[joukhar](/maintainers/joukhar)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (359 commits)")[![mvdnbrk](https://avatars.githubusercontent.com/u/802681?v=4)](https://github.com/mvdnbrk "mvdnbrk (46 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (23 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (21 commits)")[![pforret](https://avatars.githubusercontent.com/u/474312?v=4)](https://github.com/pforret "pforret (16 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (15 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (14 commits)")[![patinthehat](https://avatars.githubusercontent.com/u/5508707?v=4)](https://github.com/patinthehat "patinthehat (10 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (9 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (8 commits)")[![crynobone](https://avatars.githubusercontent.com/u/172966?v=4)](https://github.com/crynobone "crynobone (7 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (7 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (5 commits)")[![irfanm96](https://avatars.githubusercontent.com/u/42065936?v=4)](https://github.com/irfanm96 "irfanm96 (5 commits)")[![joukhar](https://avatars.githubusercontent.com/u/94228259?v=4)](https://github.com/joukhar "joukhar (4 commits)")[![IGedeon](https://avatars.githubusercontent.com/u/694313?v=4)](https://github.com/IGedeon "IGedeon (4 commits)")[![abenerd](https://avatars.githubusercontent.com/u/7523903?v=4)](https://github.com/abenerd "abenerd (3 commits)")[![jessarcher](https://avatars.githubusercontent.com/u/4977161?v=4)](https://github.com/jessarcher "jessarcher (3 commits)")[![koossaayy](https://avatars.githubusercontent.com/u/6431084?v=4)](https://github.com/koossaayy "koossaayy (3 commits)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (3 commits)")

---

Tags

laraveljoukharlaravel-pixabay

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/joukhar-laravel-pixabay/health.svg)

```
[![Health](https://phpackages.com/badges/joukhar-laravel-pixabay/health.svg)](https://phpackages.com/packages/joukhar-laravel-pixabay)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.0k7.8M57](/packages/dedoc-scramble)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)

PHPackages © 2026

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