PHP Client Library for API


What is Petfinder?

Petfinder is an online, searchable database of animals who need homes. This PHP Client Library helps developers build applications using the API.

Why use this PHP Client Library?

  • You want to build a website or application using data
  • This library has been used to build actual applications, namely

Getting Started

Get a random pet's basic info

// Set $apiKey to your API key string.
// Both XML and JSON responses are available
$pf = new Petfinder(PETFINDER_API_KEY);
$petJson = $pf->pet_getRandom(array('output'=>'basic'));
$pet = json_decode($petJson, TRUE);