🐶 Dog API by kinduff

The Dog API provides dog data as a service!

Dog breeds, groups and facts as a free JSON API

Hi, I'm kinduff. This is a free API with dog breeds, breed groups and facts. I've kept it running since 2016, mostly because people learning to code keep finding it useful. No key, no sign up, nothing to pay.

Stray dogs in Moscow have learned to ride the subway to find food. a fact this API served when you loaded the page

Right now it holds 283 breeds with their life spans and weights, 9 breed groups, and 483 dog facts. It answers about 60,000 requests on an average day, from universities, bootcamps, home labs and a lot of people poking at it on a Saturday.

Try it

Nothing to install. Paste this into a terminal, or press the button and watch what comes back.

Terminal
curl -s "https://dogapi.dog/api/v2/facts?limit=1"
Try it
Runs against this site.

Pictures need even less than that. The image endpoint redirects straight to a file, so an img tag can point at it and nothing else is needed:

A dog, in one tag
<img src="https://dogapi.dog/api/v2/breeds/image">

No id means any dog. Add one — /api/v2/breeds/<id>/image — and you get that breed, which is where the pictures at the top of this page come from.

When you want the rest, the docs explain every endpoint, and the breeds pages let you browse all of them from the page.

If you're teaching with it

Go ahead — course, workshop, tutorial, video, paid or free. You don't need to ask me and you don't need to credit me, though I always like hearing about it.

A few things worth knowing before you put it in front of a class. There's no key, so nobody can leak one in a public repo or a screen share. It works straight from the browser, so fetch() in a static page or a CodePen is fine. The rate limit is 300 requests per minute per IP, which a whole room sharing one connection stays well under, and there's no monthly quota to run out of halfway through a lesson.

If it breaks in the middle of a class, email me at dev@dogapi.dog and I'll look at it.

Things to build with it

In case you need somewhere to start: show a random fact and add a button that fetches another one. List every breed and filter them with a search box. Walk through the pages with page[number]. Pick a group and follow its breeds to fetch each one. Ask for a breed that doesn't exist and handle the 404 without breaking the page. Chart the life spans across a group and argue about what the numbers actually mean.

If you make something with it, send it over. Seeing what people build is the reason this is still online.

3 pugs with glasses in front of a computer in an office, digital art

Questions I get

Do I need an API key?

No, and I don't plan to require one. If that ever changes, whatever you've already built will keep working.

Why is it free?

Because it's mostly used for learning and for fun, and I've paid for it myself this long without it hurting. If you feel like helping with the bill, you can buy me a coffee.

Why is V1 deprecated?

I wrote V1 without following any standard and it doesn't grow well. V2 follows JSON:API and is where breeds, groups and anything new lives. V1 still answers, and I'm not going to switch it off.

Where's the Slack button?

I lost ownership of the Slack app to a policy change and couldn't get it back.

Who are you?

kinduff. I like building silly things and putting them online. The code for this one is on GitHub, MIT licensed, and pull requests are welcome.

Dog API - JSON API with information on dog breeds and fun facts | Product Hunt