Skip to main content

2 posts tagged with "features"

View All Tags

API Enhancements: Sub-IDs, Localization, and Health Tips

· 2 min read
Aden Forshaw
Founder/CEO of ThatAPICompany

We're constantly working to make The Dog API more robust and easier to integrate into your applications. Today, we're excited to announce a series of quality-of-life API enhancements that give you more control over your data and provide richer content for your users.

Here's a breakdown of the new features available now:

🏷️ Organizing Pets with Sub-IDs

Managing pets created by different users within your application just got a lot easier. We've introduced the sub_id field to the Pets API!

When creating or updating a pet, you can now pass a string to the sub_id field (such as your internal user ID). You can then filter the list of pets by this sub_id, making it incredibly simple to isolate and retrieve only the pets belonging to a specific user in your system.

# Creating a pet with a sub_id
curl -X POST -H "x-api-key: YOUR-API-KEY" \
-F "name=Rex" \
-F "sub_id=user-98765" \
https://api.thedogapi.com/v1/pets

# Retrieving pets for a specific user
curl -H "x-api-key: YOUR-API-KEY" \
"https://api.thedogapi.com/v1/pets?sub_id=user-98765"

🇬🇧 British English (en-gb) Localization

We're expanding our internationalization support! By popular demand, we have fully translated our extensive database of dog (and cat!) facts into British English (en-gb).

You can now specify your preferred locale when requesting facts, ensuring that the spelling and terminology feel natural to your UK audience (expect to see "colours" instead of "colors", and "behaviour" instead of "behavior"!).

💡 Categorized Health Tips

Providing actionable and personalized advice is a great way to engage your users. We've completely revamped our Health Tips feature.

Health tips are now strictly categorized, making it easier to query specific types of advice—whether it's regarding nutrition, exercise, grooming, or preventative care. These tips have been enriched to provide deeper, more personalized guidance based on a dog's specific physical characteristics and breed.

🌟 Breed Pro Features

For our Premium tier users, we've unlocked a new set of "Breed Pro" features. These endpoints return highly detailed, structured schemas containing extensive breed information that goes far beyond the standard physical traits.

These enhancements are available immediately across all supported endpoints. We hope these updates make building with The Dog API an even better experience!

Introducing Pet Portraits: Turn Photos into Masterpieces

· 3 min read
Aden Forshaw
Founder/CEO of ThatAPICompany

We are thrilled to announce a brand-new feature to The Dog API: Pet Portraits.

You can now use our API endpoints to transform regular photos of dogs into beautiful, stylized portraits. Whether you're building a pet profile app or just want to offer a fun feature for your users, our new portrait generation endpoints make it seamless to create stunning artwork from uploaded images.

🎨 Available Styles

Our portrait generation supports several distinct artistic styles. Here’s a look at what you can create, using a beautiful Border Collie as our model!

Studio

Create a clean, professional-looking headshot with beautiful lighting:

Border Collie Studio Portrait

Watercolour

Transform the photo into a delicate and vibrant watercolour painting:

Border Collie Watercolour Portrait

Pencil Sketch

Give the image a classic, hand-drawn pencil sketch appearance:

Border Collie Pencil Sketch

🚀 How to Use It

Generating Pet Portraits is a simple two-step process: you first create a Pet profile in the system with their initial photos, and then you call the portrait endpoint for that Pet.

1. Create a Pet Profile

First, create a pet via the API, attaching the original image you want to use. This provides the base image for our portrait generation.

curl -X POST -H "x-api-key: YOUR-API-KEY" -H "Content-Type: multipart/form-data" \
-F "name=Buddy" \
-F "description=A very good boy" \
-F "images=@/path/to/front_view.jpg" \
https://api.thedogapi.com/v1/pets

This request will return a Pet object containing an id (your pet_id) which you'll use in the next step.

2. Generate the Portrait

Once the pet is created, you can generate a stylized portrait by specifying the pet_id and your desired style (such as studio, watercolour, or pencil_sketch).

curl -X POST -H "x-api-key: YOUR-API-KEY" -H "Content-Type: application/json" \
-d '{"style": "watercolour"}' \
https://api.thedogapi.com/v1/pets/{pet_id}/portrait

And that's it! The API will return the generated masterpiece based on your uploaded image.

3. Maintain Consistent Poses Across Styles (Optional)

Want to generate multiple styles of the exact same pose? You can pass an array of image_ids containing the ID of a previously uploaded image or a generated portrait. This tells the system to use that specific image as the structural reference.

curl -X POST -H "x-api-key: YOUR-API-KEY" -H "Content-Type: application/json" \
-d '{
"style": "pencil_sketch",
"image_ids": ["your_image_or_portrait_id"]
}' \
https://api.thedogapi.com/v1/pets/{pet_id}/portrait

This ensures that whether you're generating a watercolour or a pencil sketch, the pet's pose and composition remain beautifully consistent!

If you'd like to see a complete implementation, check out our open-source Pet Portrait Example codebase that demonstrates exactly how to interact with these endpoints to generate these amazing styles.

We can't wait to see the beautiful portraits you and your users create!