https://github.com/zoonman/pixabay-php-api
Pixabay PHP API for searching and retrieving public domain images.
https://github.com/zoonman/pixabay-php-api
api api-client composer free guzzlehttp images php pixabay pixabay-php-api pixabay-php-client
Last synced: 19 days ago
JSON representation
Pixabay PHP API for searching and retrieving public domain images.
- Host: GitHub
- URL: https://github.com/zoonman/pixabay-php-api
- Owner: zoonman
- License: mit
- Created: 2014-12-14T14:21:43.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-06-26T16:10:25.000Z (almost 2 years ago)
- Last Synced: 2025-04-06T03:17:18.317Z (25 days ago)
- Topics: api, api-client, composer, free, guzzlehttp, images, php, pixabay, pixabay-php-api, pixabay-php-client
- Language: PHP
- Homepage: https://www.zoonman.com/projects/pixabay/
- Size: 49.8 KB
- Stars: 31
- Watchers: 3
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Pixabay PHP Client
[](https://github.com/zoonman/pixabay-php-api/actions/workflows/php.yml) [](https://codeclimate.com/github/zoonman/pixabay-php-api) []() []()This is unofficial wrapper for [Pixabay RESTful API](http://pixabay.com/api/docs/) for searching and retrieving Pixabay public domain images.
[](http://pixabay.com/)
### Installing via Composer
The recommended way to install Pixabay PHP Client is through
[Composer](http://getcomposer.org).```bash
# Install Composer
curl -sS https://getcomposer.org/installer | php
```Next, run the Composer command to install the latest stable version of Pixabay PHP Client:
```bash
composer require zoonman/pixabay-php-api
```After installing, you need to require Composer's autoloader:
```php
require 'vendor/autoload.php';
```### Documentation
Compatible with PHP verisons:
- 7.2+
- 8
- hhvm
- nightlySee current build status above.
#### Usage example
```php
'yourPixabayKey'
]);// run simplest possible query against the API
$results = $pixabayClient->get(['q' => 'nature'], true);
// show the results
var_dump($results);// to get images use
$results = $object->getImages(['q' => 'flowers', 'per_page' => 3], true);
var_dump($results);// to get videos use
$results = $object->getVideos(['q' => 'smile', 'per_page' => 3], true);
var_dump($results);
```To obtain your keys go to https://pixabay.com/api/docs/
More information can be found in the online documentation at
https://www.zoonman.com/projects/pixabay/