random.dog API
Free random dog API with no key: returns a URL to a photo, GIF or video with its file size in bytes, so you can filter before downloading. Tested example included.
Endpoint tested and returned HTTP 200 on 2026-08-21
What is the random.dog API?
random.dog returns a random dog image with no API key. The JSON response is two fields — a `url` to the media and `fileSizeBytes` giving its size — and the media can be a JPEG, PNG, GIF or MP4.
The `fileSizeBytes` field is the reason to prefer this over the other dog picture services. Media here is user-submitted and unprocessed, so a single response can be a 30 KB JPEG or, as in the captured example, a 3 MB GIF. Knowing the size before you fetch means you can reject anything too heavy for a thumbnail and ask again, which no comparable service lets you do.
The other thing to plan for is that `url` is not always an image. The corpus includes MP4 and WEBM video alongside stills, so an `img` tag will silently fail on a meaningful fraction of responses. Check the file extension and render a `video` element when appropriate, or use the `filter` parameter on the `/woof` endpoint to exclude formats you cannot handle. There is a `/woof` variant that returns the bare filename as plain text if you would rather not parse JSON at all.
Quick facts
- Base URL
https://random.dog- Authentication
- No API key and no account.
- Rate limit
- No published limit. It is a small community project — cache and keep volumes reasonable.
- Pricing
- Free.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the random.dog API
Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.
1. Fetch a random dog with its file size
GET https://random.dog/woof.json
curl 'https://random.dog/woof.json'const res = await fetch("https://random.dog/woof.json");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://random.dog/woof.json", timeout=20)
res.raise_for_status()
print(res.json()){
"fileSizeBytes": 3128227,
"url": "https://random.dog/86a6af7a-eee8-4c04-8730-8656593f34d9.gif"
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
(none) | n/a | Optional | `/woof.json` takes no parameters. |
filter | query | Optional | On the `/woof` endpoint, a comma-separated list of extensions to exclude, such as `mp4,webm`. mp4,webm |
/doggos | path | Optional | Lists every filename in the collection. |
Response fields
urlstring- Absolute URL of the media. The extension can be `.jpg`, `.png`, `.gif`, `.mp4` or `.webm` — check it before choosing how to render.
fileSizeBytesinteger- Size of the media in bytes. Use it to reject oversized files before downloading; the captured example is over 3 MB.
What you can build with the random.dog API
- Add a random dog command to a chat bot
- Fill a demo gallery with real, varied media
- Teach conditional rendering with a response that can be image or video
- Reject oversized media before fetching, using the byte count
Common errors and how to fix them
Broken image icon
The URL points at an MP4 or WEBM, not a still.
Fix: Check the extension and render a `video` element, or exclude those formats with the `filter` parameter on `/woof`.
Very slow load
Some entries are multi-megabyte GIFs.
Fix: Read `fileSizeBytes` first and request again if it exceeds your threshold. That is what the field is for.
Cross-origin canvas operations fail
Media is served without permissive CORS for pixel access.
Fix: Displaying in an `img` or `video` tag works. Reading pixels requires a proxy.
Repeated media
The collection is finite.
Fix: Track recently seen URLs client-side if repeats are noticeable in your context.
random.dog API — frequently asked questions
Is random.dog free?
Yes, free with no key and no account. It is a small community project, so cache what you fetch and keep volumes modest.
Why does my image tag sometimes show nothing?
Because the corpus includes MP4 and WEBM video as well as stills. Check the file extension in `url` and render a video element when needed.
Can I exclude videos?
Yes. The `/woof` endpoint accepts a `filter` parameter taking a comma-separated list of extensions to exclude, such as `mp4,webm`.
What is fileSizeBytes for?
So you can decide whether to load the media before you fetch it. Entries range from small JPEGs to multi-megabyte GIFs, and no other service in this category tells you up front.
Tools that pair with this API
Image Cropper
Crop images online to an exact rectangle with pixel-precise x, y, width and height inputs or aspect-ratio presets. Free, private and browser-based.
GIF to PNG Converter
Convert GIF images to PNG format in your browser — extracts the first frame of animated GIFs as a lossless still. Free, instant and private.
Compress Image to Size (KB)
Compress a JPG, PNG or WebP to an exact file size in KB — 20KB, 50KB, 100KB, 200KB presets for online forms. Free and 100% in-browser.
random.dog is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.