Petfinder API

Animals / API Key Intermediate HTTPS CORS
Varies by plan (check documentation)

Overview

The Petfinder API connects you to a database of adoptable pets — dogs, cats, rabbits, birds, and more — from thousands of shelters and rescue organizations across North America. It is popular among beginner developers building pet adoption apps or practicing with paginated, filterable JSON datasets. After registering for free credentials, you get access to real animal listings with photos, age, breed, and shelter location.

💡

Beginner Tip

You must first exchange your API key and secret for a Bearer token via a POST to https://api.petfinder.com/v2/oauth2/token — then include that token in an Authorization: Bearer header on all subsequent requests.

Available Data

Petfinder data via REST API
JSON-formatted response data
Requires API key authentication

Example Response

JSON Response
{
  "name": "Petfinder",
  "data": "Petfinder-specific information and attributes",
  "source": "Petfinder"
}

Field Reference

animals List of adoptable animal objects matching your query filters.
animals[].name The pet name as listed by the shelter.
animals[].species Species of the animal, e.g. "Dog", "Cat", "Rabbit".
animals[].breeds.primary Primary breed of the animal.
animals[].photos Array of photo objects each containing small, medium, large, and full-size image URLs.
pagination Contains count_per_page, total_count, current_page, and total_pages for navigating large result sets.

Implementation Example

const url = "https://www.petfinder.com/developers/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized Using the raw API key directly instead of the OAuth2 Bearer token
POST client_id and client_secret to /v2/oauth2/token first, then use the returned access_token as the Bearer token
Empty "animals" array Your location or distance filter is too narrow, or no animals match the type filter
Try a broader location, increase distance to 100 miles, and remove optional breed or age filters
Token expired (401 after working calls) The Bearer token expires after one hour
Request a new token by repeating the POST to /v2/oauth2/token and update your stored access_token

Matrix Score Breakdown

🌐 Reachability 0/30
⚡ Speed 15/20
🔒 Security 15/15
🛠 Developer XP 17/20
✓ Reliability 0/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS YES
Category Animals
Difficulty Intermediate
Verified: 2026-04-04

Recipes Using Petfinder

Build something with this API. Each recipe includes step-by-step instructions and code outlines.

Similar APIs

View All →