RandomDuck API

Beginner's Pick Animals / No Auth Required Beginner HTTPS
Free to Use Varies (check documentation)

Overview

RandomDuck serves random photos and illustrations of ducks from a community-curated collection, returning a JSON object with the direct image URL. It requires no authentication and responds to a single GET request, making it ideal for a first fetch() exercise. The API also supports a plain-text endpoint that returns just the image URL for even simpler integration.

Beginner Tip

Hit https://random-d.uk/api/v2/random to get a JSON response with a "url" field — assign that value directly to an img src to display the duck photo.

Available Data

randomly generated data
customizable output format
Use case: Integrate random pictures of ducks data into web and mobile applications

Example Response

JSON Response
{
  "image_url": "https://api.example.com/randomduck/random.jpg",
  "status": "success"
}

Field Reference

url Direct URL to the duck image — suitable for use as an img src.
message A fun duck-related message, typically "quack".

Implementation Example

Request
// ⚠️ Note: This URL may be a documentation page. Check official docs for actual API endpoint.
const url = "https://random-d.uk/api";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Unexpected illustration instead of photo The collection mixes real duck photos and cartoon illustrations without a way to filter
Use the ?type=jpg parameter to request only photographic images
Response is a plain string, not JSON Hitting the /quack endpoint instead of /v2/random returns just the URL as a plain string
Use /api/v2/random for a JSON response, or treat the /quack response directly as a URL string
fetch() fails silently Not checking HTTP response status before calling .json()
Add: if (!response.ok) throw new Error(response.status) before parsing the response body

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS NO
Category Animals
Difficulty Beginner
Verified: 2026-04-04

Related Tags

Similar APIs

View All →