Pixabay PHP Client Library

On Pixabay you may find and share images free of copyrights. You can copy, modify, distribute and use the images, even for commercial purposes, all without asking permission and without paying attribution.

Pixabay PHP Client utilitize REST service, provided by Pixabay.

How to install library for work with Pixabay?

You can do it using Composer.

To install Composer, run this command:

curl -sS https://getcomposer.org/installer | php

After you need to install the library:

composer require zoonman/pixabay-php-api

Now you can create simple example, using the Pixabay API. You can find you PixabayKey on the Pixabay API page. Also, there a description of options.

Create a file pixabay.php with the following content:

<?php

require_once 'vendor/autoload.php';

$pixabayClient = new \Pixabay\PixabayClient([
	'key' => 'yourPixabayKey'
]);

// test it
$results = $pixabayClient->get(['q' => 'nature'], true);
// show the results
var_dump($results);

Now you can run it and observe results.

php pixabay.php

Now you know, how to get Pixabay images.

You can define library inside composer.json as

{
	"require": {
		"zoonman/pixabay-php-api": "dev-master"
	}
}

View project on GitHub Download zip-achive

Pixabay PHP Client Library released under MIT License, so it is free for commercial and personal use.

Comments:

You can left first comment.

For commenting you should proceed to enter or register on the site.