Composer PHP development

Example of GettyImages API using Composer

Spread the love

With Using Composer, API works are much easier. It’s my best friend for implementing APIs.

  1. Register on GettyImages for Developers. You will get Email with API Keys
    Register on Gettyimages APIgettyimages developers Get API keys
  2. I need to get GettyImages API PHP from GitHub.
    composer.json file is already configured, so you don’t need to worry about anything.

    $ git clone


  3. Install Composer.
    $ curl -sS | php
    $ php composer.phar install
  4. Create example  file like below.
    require 'vendor/autoload.php';
    use GettyImages\Api\GettyImages_Client;
    $apiKey = "Your API KEY";
    $apiSecret = "Your Secret KEY";
    $client = new GettyImages_Client($apiKey,$apiSecret);
    $response = $client->Search()->Images()->withPhrase("dog")->execute();


  5. Here we go! Json format is returned.
    GettyImages API php example

Thanks bud, Composer!

Composer PHP development

Facebook Comments

Published by

Titus Choi

I love technology. Working for information technology. Interested in AVR technology. Playing with RC stuff.