jorisnoo / pexels

Pexels API Client for

Home Page:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pexels API Client

Scrutinizer Code Quality Build Status Latest Stable Version Total Downloads License


Install the Pexels API Client with Composer.

"require": {
    "glooby/pexels": "~0.1"


Create an instance of the Pexels API Client by passing in your API token as parameter.

$pexels = new \Glooby\Pexels\Client("xxxxx");

Perform a search, the response gets returned as an array

$response = $pexels->search('london');

Loop trough photos and display them

$photos = json_decode($pexels->search('london')->getBody())->photos;
foreach ($photos as $photo) {
 echo "<img src='{$photo->src->small}' width='{$photo->width}' heigth='{$photo->height}'>"

Example response



Pexels API Client for

License:MIT License


Language:PHP 72.6%Language:Shell 27.4%