Docker Hub API

Development / API Key Intermediate HTTPS CORS
180 per window (180 remaining at test time)
66 C
Measured Score 0 50 100 Speed 15/30 Consistency 20/20 Security 20/20 Browser access 0/15 Transparency 11/15 TESTED 2026-08-10

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.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://hub.docker.com/v2/repositories/library/nginx/tags?page_size=5
Result
HTTP 200 · application/json · 27,766 bytes
Response time
265 ms (median of 3) · fastest 256 ms
Transport
TLSv1.3 · TLS_AES_256_GCM_SHA384 · certificate issued by Let's Encrypt
Browser CORS
No Access-Control-Allow-Origin header — call it from a server, not the browser
Rate limit
180 per window (180 remaining at test time)
Served by
cloudflare
Recorded
2026-08-10

Fields Returned

Top-level fields present in the response we captured, with the type and value we actually received.

Field Type Value received
count integer 1283
next string (url) https://hub.docker.com/v2/repositories/librar…
previous null null
results array [1 item]

Captured Response

Captured from a real request to https://hub.docker.com/v2/repositories/library/nginx/tags?page_size=5 on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
{
  "count": 1283,
  "next": "https://hub.docker.com/v2/repositories/library/nginx/tags?page=2&page_size=5",
  "previous": null,
  "results": [
    {
      "creator": 1156886,
      "id": 1037391008,
      "images": [
        {
          "…": "(11 more fields)"
        }
      ],
      "last_updated": "2026-08-05T19:52:15.690518Z",
      "last_updater": 1156886,
      "last_updater_username": "doijanky",
      "name": "stable-trixie",
      "repository": 21171,
      "full_size": 63093193,
      "v2": true,
      "tag_status": "active",
      "tag_last_pulled": "2026-08-10T19:44:39.116138951Z",
      "tag_last_pushed": "2026-08-05T19:52:15.690518Z",
      "media_type": "application/vnd.oci.image.index.v1+json",
      "…": "(2 more fields)"
    }
  ]
}

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.
images Per-platform image variants (architecture/OS) included in this tag, e.g., linux/amd64 and linux/arm64.

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
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.

How This API Fails

We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.

HTTP 404 Requesting a path that does not exist application/json
{
  "message": "httperror 404: tag 'apisscore-nonexistent-path' not found",
  "errinfo": {
    "namespace": "library",
    "repository": "nginx",
    "tag": "apisscore-nonexistent-path"
  }
}

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

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.

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 15/30
Consistency 20/20
Security 20/20
Browser access 0/15
Transparency 11/15
Endpoint Response Time 265ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS YES
Category Development
Difficulty Intermediate
Endpoint last called: 2026-08-10

Related Tags

Similar APIs

View All →