Docker Hub API

Development / API Key Intermediate HTTPS CORS
Varies by plan (check documentation)

Overview

The Docker Hub API lets you programmatically interact with Docker Hub registries — searching repositories, pulling image metadata, managing tags, and automating image builds. It is the same API that the Docker CLI uses under the hood when you run docker pull or docker push. An API key or Docker Hub credentials are required for private repositories and write operations.

💡

Beginner Tip

Docker Hub API is straightforward for read operations on public images — no auth needed to search or inspect public repos. Authentication via a personal access token (not your password) is required for private images or write operations. Get your token at hub.docker.com > Account Settings > Personal Access Tokens.

Available Data

Use case: Integrate interact with docker hub data into web and mobile applications
Docker Hub data via REST API
JSON-formatted response data
Requires API key authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Docker Hub",
    "description": "Interact with Docker Hub",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

name Tag name of the image (e.g., "latest", "alpine", "1.25").
full_size Compressed size of the image in bytes as stored on Docker Hub.
last_updated ISO 8601 timestamp of the most recent push to this tag.
digest SHA256 content-addressable digest uniquely identifying this image version.
images Per-platform image variants (architecture/OS) included in this tag, e.g., linux/amd64 and linux/arm64.

Implementation Example

const url = "https://docs.docker.com/docker-hub/api/latest/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
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

401 Unauthorized on private repo Missing or incorrect Bearer token in the Authorization header
Generate a personal access token at hub.docker.com and use Authorization: Bearer <token> — do not use your raw password.
404 Not Found for existing image The namespace (username/org) or repository name has a typo, or the image is truly private
Double-check the exact repository path — Docker Hub is case-sensitive and org names must be lowercase.
Rate limit exceeded (429) Docker Hub enforces pull rate limits: 100 pulls/6h for anonymous, 200/6h for free accounts
Authenticate with a paid Docker Hub account or reduce pull frequency; consider mirroring images to a private registry.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 10/20
🔒 Security 15/15
🛠 Developer XP 17/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS YES
Category Development
Difficulty Intermediate
Verified: 2026-04-07

Similar APIs

View All →