pet-finder-api
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/pet-finder-api package

1.0.1 • Public • Published

Petfinder API

This Module is created to simplify working with the PetFinder API That allows you to look for pets needing adoption. Most Calls Are public and do not require a secret.

Installation

NPM

npm install pet-finder-api --save

--save adds pet-finder-api to your package.json file

Package Manager package.json:

{
  ...
  "dependencies": {
    ...
    "petfinder": "latest"
  }
}

Example

// Import module
var petfinder = require('pet-finder-api')('api_key','api_secret');
 
// Get list of breeds
petfinder.getBreedList('cat', function(err, breeds) {
  console.log(breeds)
});

Methods

Pets

// animal = barnyard, bird, cat, dog, horse, pig, reptile, smallfurry
getBreedList( animal, callback )
 
getPet( petId, options, callback )
getRandomPet ( options, callback )
findPet ( location, options, callback )

Shelters

findShelter( location, options, callback )
getShelter( shelterId, options, callback )
getPetsInShelter( shelterId, options, callback )
 
// breed get from getBreedList
getSheltersWithBreeds ( animal, breed, options, callback )

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some awesome feature')
  4. Push to the remote branch (git push origin my-new-feature)
  5. Create a pull request

Running Tests

cp .env.example .env
npm test

to record api calls

REPLAY=record npm test

to debug recorded api calls

DEBUG=replay npm test

/pet-finder-api/

    Package Sidebar

    Install

    npm i pet-finder-api

    Weekly Downloads

    9

    Version

    1.0.1

    License

    none

    Last publish

    Collaborators

    • drlukeangel