BYTETOOLS

Random-d.uk API

Free random duck picture API with no key: JPG, PNG and GIF ducks, plus HTTP-status duck images. Tiny two-field JSON response. Tested example included.

No API key requiredHTTPSFree tier

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

What is the Random-d.uk API?

Random-d.uk is a free, key-free API returning random duck images. A request to its random endpoint returns a small JSON object containing a direct URL to a duck photo or GIF, with variants for specific file types and for HTTP status codes.

Random-d.uk is a deliberately tiny API and that is its appeal: a two-field JSON response with a message and a URL, and nothing to configure. It sits in the same family as the cat and dog placeholder APIs and serves the same purpose — a dependable, free image source for demos, tests and bots.

One detail to plan for: the `url` field is returned over plain HTTP rather than HTTPS. Embedding it directly on an HTTPS page triggers mixed-content blocking in every modern browser, so rewrite the scheme to `https://` before you use it. The host serves HTTPS perfectly well; only the JSON field is stale.

Quick facts

Base URL
https://random-d.uk/api/v2
Authentication
No API key or account. The maintainer asks for credit back to random-d.uk where practical.
Rate limit
No published limit; reasonable use expected.
Pricing
Free.
CORS
Not enabled — call it from your server
Official docs
Read the docs

How to use the Random-d.uk 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 duck image URL

GET https://random-d.uk/api/v2/random

curl
curl 'https://random-d.uk/api/v2/random'
JavaScript (fetch)
const res = await fetch("https://random-d.uk/api/v2/random");
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://random-d.uk/api/v2/random", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
{
  "message": "Powered by random-d.uk",
  "url": "http://random-d.uk/api/380.JPG"
}

Parameters

ParameterTypeRequiredDescription
typequeryOptionalRestrict the result to one file type: `jpg`, `png` or `gif`. gif
(quack)path segmentOptionalThe `/quack` endpoint returns the image itself rather than JSON, so it works directly in an `img` tag.
(http)path segmentOptionalThe `/http/{code}` endpoint returns a duck illustrating an HTTP status code, like the HTTP Cats and HTTP Dogs services. 404
(list)path segmentOptionalThe `/list` endpoint returns every available image filename in one response.

Response fields

urlstring
Direct link to the duck image. Note it comes back as `http://` — rewrite it to `https://` before embedding on a secure page.
messagestring
Attribution string, currently "Powered by random-d.uk". The maintainer asks that you surface credit somewhere.
(/quack)image
The alternative endpoint returns raw image bytes rather than this JSON envelope.

What you can build with the Random-d.uk API

  • Supply placeholder imagery for a prototype or design mockup
  • Add a random-duck command to a chat bot
  • Illustrate HTTP status codes in API documentation or an error page
  • Provide a stable, free image fixture for front-end tests

Common errors and how to fix them

404

Unknown file type or an HTTP code with no matching illustration.

Fix: Only `jpg`, `png` and `gif` are valid types, and the `/http/` endpoint covers common status codes rather than every possible number.

Mixed content blocked

Not an API error — the returned URL uses `http://`.

Fix: Rewrite the scheme to `https://` before rendering. The host supports HTTPS; only the JSON field is out of date.

Random-d.uk API — frequently asked questions

Is the Random Duck API free?

Yes, free with no API key and no account. The maintainer asks that you credit random-d.uk somewhere in your project, which the response's own `message` field reminds you of.

Why does the returned URL start with http instead of https?

The JSON field has simply not been updated, even though the host serves HTTPS fine. Because browsers block mixed content, rewrite the scheme to `https://` before embedding the image on a secure page.

How do I get the image directly instead of JSON?

Use the `/quack` endpoint, which returns the image bytes themselves. That means the URL can be dropped straight into an `img` tag with no JSON parsing step.

Does it support HTTP status code images?

Yes. The `/http/{code}` endpoint returns a duck illustrating a status code, the same idea as HTTP Cats and HTTP Dogs. It covers common codes rather than every number.

Tools that pair with this API

Random-d.uk 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.