Pets & Pet Analysis
Manage your users' pets, upload their photos, and use computer vision to analyse their health, age, and breed composition. This controller allows for comprehensive pet profile management and advanced image analysis.
Core Management
Create a Pet
Create a profile for a pet. You can include multiple initial images during creation by repeating the images field.
curl -X POST -H "x-api-key: YOUR-API-KEY" -H "Content-Type: multipart/form-data" \
-F "name=Mochi" \
-F "breed_id=abys" \
-F "date_of_birth=2022-06-15" \
-F "sub_id=my-user-123" \
-F "description=My best friend" \
-F "images=@/path/to/front_view.jpg" \
-F "images=@/path/to/side_view.jpg" \
https://api.thecatapi.com/v1/pets
List your Pets
Retrieve a paginated list of all pets associated with your account.
curl -H "x-api-key: YOUR-API-KEY" "https://api.thecatapi.com/v1/pets?limit=10&page=0"
Get Pet Details
Retrieve full profile details for a specific pet, including all their uploaded images.
curl -H "x-api-key: YOUR-API-KEY" https://api.thecatapi.com/v1/pets/{pet_id}
Update a Pet
Update metadata like name, breed, description, or manually record/update a WSAVA Body Condition Score (body_condition_score 1-9).
curl -X PATCH -H "x-api-key: YOUR-API-KEY" -H "Content-Type: application/json" \
-d '{"description": "Loves playing fetch", "body_condition_score": 5}' \
https://api.thecatapi.com/v1/pets/{pet_id}
Media Management
Upload Pet Images
To upload additional photos for an existing pet, use the /images sub-resource. This is useful for providing the AI with more reference angles for higher-quality analysis.
curl -X POST -H "x-api-key: YOUR-API-KEY" -H "Content-Type: multipart/form-data" \
-F "images=@/path/to/photo_3.jpg" \
-F "images=@/path/to/photo_4.jpg" \
https://api.thecatapi.com/v1/pets/{pet_id}/images
AI Health & Condition Analysis
Computer vision algorithms analyse the pet's images to provide quantitative and qualitative insights.
Body Condition Score (BCS)
The AI analyses profile and overhead photos to determine if a pet is underweight, ideal, or overweight. Body condition scores can also be manually recorded or updated directly on a pet profile via PATCH /pets/{pet_id}.
curl -X POST -H "x-api-key: YOUR-API-KEY" \
https://api.thecatapi.com/v1/pets/{pet_id}/body-condition-score
Example Output
{
"score": 5,
"reasons": [
"Ribs are easily palpable with minimal fat cover.",
"Waist is easily noted when viewed from above.",
"Abdominal tuck is evident when viewed from the side."
],
"generated_at": "2024-03-23T10:00:00.000Z"
}
Muscle Condition Score
Analyses muscle mass across the spine, scapulae, and hips to identify risks of muscle wasting.
curl -X POST -H "x-api-key: YOUR-API-KEY" \
https://api.thecatapi.com/v1/pets/{pet_id}/muscle-condition-score
Estimated Age
If a pet's exact history is unknown, our AI can estimate their age by analysing physical indicators.
curl -X POST -H "x-api-key: YOUR-API-KEY" \
https://api.thecatapi.com/v1/pets/{pet_id}/estimated-age
Estimated Weight
Estimate the pet's weight from its photos and breed, useful when a scale reading is not available.
curl -X POST -H "x-api-key: YOUR-API-KEY" \
https://api.thecatapi.com/v1/pets/{pet_id}/estimated-weight
Genealogy & Breed Insights
Understand a pet's ancestry through visual pattern recognition.
curl -X POST -H "x-api-key: YOUR-API-KEY" \
https://api.thecatapi.com/v1/pets/{pet_id}/genealogy
Genealogy Response
{
"breed_mixture": [
{ "id": "mcoo", "name": "Maine Coon", "percentage": 60 },
{ "id": "ragd", "name": "Ragdoll", "percentage": 40 }
],
"creative_description": "A gentle giant with a plush semi-long coat and a laid-back temperament.",
"gender_prediction": "female"
}
AI Portraits
Generate stylised, professional-quality artwork featuring the pet.
1. List Available Styles
curl -H "x-api-key: YOUR-API-KEY" https://api.thecatapi.com/v1/pets/portrait-styles
Styles include studio, watercolour, pencil_sketch, comic_book, anime, superhero, astronaut, renaissance, pop_art and seasonal editions such as christmas_edition and halloween_spooky. Each style has an id, name, description, category and popularity_score.
2. Generate Artwork
curl -X POST -H "x-api-key: YOUR-API-KEY" -H "Content-Type: application/json" \
-d '{"style": "studio"}' \
https://api.thecatapi.com/v1/pets/{pet_id}/portrait
3. List Generated Portraits
curl -H "x-api-key: YOUR-API-KEY" https://api.thecatapi.com/v1/pets/{pet_id}/portraits
Cleanup
Delete a Pet
Permanently remove a pet profile and all associated data.
curl -X DELETE -H "x-api-key: YOUR-API-KEY" https://api.thecatapi.com/v1/pets/{pet_id}