BYTETOOLS

Dog API (Facts)

Free dog facts API with no key, using a JSON:API response format. Returns random canine facts with pagination. Tested curl example and live JSON response.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-19

What is the Dog API (Facts)?

The Dog API facts endpoint is a free, key-free API returning random facts about dogs. It follows the JSON:API specification, so data is nested under a `data` array with `attributes` objects.

This API is worth knowing for a reason beyond dog facts: it implements the JSON:API specification properly. That means resources are nested under `data`, each with `id`, `type` and `attributes` — a structure that catches people out the first time they meet it.

If you have only consumed flat JSON APIs, this is a useful, low-stakes introduction to a format widely used in enterprise back ends. The fact text lives at `data[0].attributes.body`, not at the top level.

Quick facts

Base URL
https://dogapi.dog/api/v2
Authentication
No key required.
Rate limit
No published limit.
Pricing
Free.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the Dog API (Facts)

Every request below was executed against the live API on 2026-08-19, and the response shown is the real body it returned — not an illustration.

1. Fetch random dog facts

GET https://dogapi.dog/api/v2/facts

curl
curl 'https://dogapi.dog/api/v2/facts'
JavaScript (fetch)
const res = await fetch("https://dogapi.dog/api/v2/facts");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://dogapi.dog/api/v2/facts", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
{
  "data": [
    {
      "id": "74aa002e-e5d6-4398-85bd-aa6275a70ba0",
      "type": "fact",
      "attributes": {
        "body": "Male dogs have a bone in their penis."
      }
    }
  ]
}

Parameters

ParameterTypeRequiredDescription
limitintegerOptionalNumber of facts to return. 5
page[number]integerOptionalPage number, JSON:API pagination style. 2

Response fields

dataarray
Array of JSON:API resource objects.
data[].idstring
Resource UUID.
data[].typestring
Resource type, `fact`.
data[].attributes.bodystring
The dog fact text — nested two levels deep.

What you can build with the Dog API (Facts)

  • Learn to consume a JSON:API formatted response
  • Add dog facts to a pet or veterinary website
  • Practise navigating nested response structures
  • Build a facts carousel with paginated data

Common errors and how to fix them

undefined when reading .fact

The payload is JSON:API, not flat.

Fix: Read `data[0].attributes.body` rather than a top-level field.

Empty data array

Page number beyond available results.

Fix: Check the `links` object for pagination boundaries.

Dog API (Facts) — frequently asked questions

Why is the dog fact nested so deeply in the response?

The API follows the JSON:API specification, which wraps every resource in `data` with `id`, `type` and `attributes`. The fact text is at `data[0].attributes.body`.

Is the Dog API free?

Yes, the facts endpoint requires no API key or registration.

How do I get more than one fact?

Pass a `limit` parameter, for example ?limit=5, and use JSON:API style pagination with page[number] for further pages.

What is JSON:API?

A specification for how JSON APIs should structure responses, covering resource objects, relationships and pagination. It is common in enterprise back ends, so it is worth recognising.

Tools that pair with this API

Dog API (Facts) is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.