Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
PHP Client Library for Petfinder.com API
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
LICENSE.markdown
Petfinder.php
README.markdown

README.markdown

What is Petfinder?

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

Why use this Petfinder.com PHP Client Library?

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

Getting Started

Get a random pet's basic info

// Set $apiKey to your API key string.
// Both XML and JSON responses are available
include('Petfinder.php');
$pf = new Petfinder(PETFINDER_API_KEY);
$pf->setResponseFormat('json');
$petJson = $pf->pet_getRandom(array('output'=>'basic'));
$pet = json_decode($petJson, TRUE);
print_r($pet);
Something went wrong with that request. Please try again.