Questions / Feedback / Bugs for the Cat or Dog APIs?

Hi Aden,

My team is looking to create an app that would involve image recognition of dog photos, and we were excited to find this api! However, we’re having trouble with the https://api.thedogapi.com/v1/images/upload endpoint through your website.

We’re putting our API key in the header field x-api-key, checking the box next to Send requests directly from the browser (CORS must be enabled) in Settings, and for the body we’re putting:
{
“file”: “https://live.staticflickr.com/65535/47698046842_78ef1be8b7_b.jpg”,
“sub_id”: “EliasBichon”
}

However, upon clicking Send, it works on it for about 30 seconds and finally responds with:
{
“level”: “info”,
“message”: “Cannot read property ‘name’ of undefined”,
“status”: 500
}

What are we doing wrong? I’ve tried the images/search and it seems to be working fine, so I don’t think the server is down. I’ve also tried using Postman and it doesn’t seem to work either.

Interesting question.

The image/upload method expects an actual file, instead of a url to a file hosted elsewhere.

So quickest way is to download the file first, then use the upload method, either manually or building a little proxy script.

It’s a good feature suggestion though, so i’ll look at adding it as a core feature next week!

Best, Aden

n.b - the Postman collection has been updated to clarify the ‘file’ parameter - apologies, it was definitely not clear. - https://documenter.getpostman.com/view/5578104/RWgqUxxh

Thanks Aden for the quick response! I think updating the documentation will certainly help prevent confusion in the future (although I did notice you only updated The Cat API but not The Dog API documentation, neither on Postman nor thedogapi.com website).

Anyway I’ve now got everything working on Postman. Actually before I posted on this forum I did try using Postman to upload a file from my local machine, but I wasn’t able to get it to work. But after you posted the reply I tried troubleshooting again and it turned out the reason it wasn’t working was because I didn’t have TheDogAPI - live set as my environment.

Hello @Aden ,

I’m playing with Dog Api and have been very funny. My Suggestion is include a thumb url on body of Breeds Model, (Maybe the first image related or null ?) so we can have a preview of that breed without make an extra request.

I’m building an app that show the breeds and would be awesome to show the image thumb on a list, like pinterest or something.

Thanks for your project, its very well documented and fun !

Hi @Aden,

First I gotta say, love the api! Thanks!

I’ve implemented a python wrapper for thecatapi (catapi.py if you’re curious), and I have some questions on what a few parameters are for and feedback on the api at the moment.

Questions:
On docs.thecatapi.com/api-reference/breeds/breeds-list , what is the attach_breed parameter for? I couldn’t find anything on it.

What mime_types are available when searching for an image? How are the mime_types used? Do you have an example url that would show how to pass an array in for a parameter? Any attempts I’ve made at using mime_types have failed.

Feedback:
The image analysis data returned from /images/{image_id}/analysis doesn’t seem to match the example response shown. Rather than getting [image, labels, moderation labels, vendor, approved, rejected] attributes back, I get [image, labels, moderation labels, vendor, created at] without any approved/rejected status.

There’s a misspelling on images-search page in the docs, Iterate should only have one t.

Thanks again for the api!

Hi Aden,

When trying to get a specific image i don’t get the vote and favourite.
GET images/<IMG_ID>?image_id=<IMG_ID>&sub_id=<SUB_ID>

Atfer looking at the documentation, it appears that these properties are only returned if i’m the owner of the image, which i guess means that i uploaded it.

“If you are the owner then the full Image response will be present, and any Vote or Favourite matching your account & sub_id will be attached.”

Would it be possible to have these properties on the object event if i’m not the owner, like it’s already done on the route “GET /images/search” ?

Thanks !

Hey, just found your API! It’s cool, but I had a question:

If I have a list like this (attached image), I’d like to have an image of the breed to the left of the name.

Currently, the breed list doesn’t provide an image url.

Would it be possible to add one to the Breed model? Like a “cover photo”. I’d prefer not to make 50+ GET requests for an image for each list item :slight_smile:

Thanks!

34