---
title: "Docker Hub API: image search, repository details as JSON"
description: "Docker Hub API for image search, repository details with pulls and stars, and tags with sizes, digests and platforms as JSON. 1 credit per successful call."
url: https://perceptlayer.com/apis/docker-hub
---

[APIs](https://perceptlayer.com/apis) / [Apps and media](https://perceptlayer.com/verticals/apps) / Docker Hub

1 credit per call 3 endpoints 7 datapoints 

# Docker Hub API

Docker Hub API for image search, repository details with pulls and stars, and tags with sizes, digests and platforms as JSON. 1 credit per successful call.

[Get a free API key](https://perceptlayer.com/signup) Run it below

Docker Hub

GET /v1/docker-hub/search?query=nginx&page\_size=10 

```
{
  "success": true,
  "data": {
    "total": 297082,
    "page": 1,
    "has_more": true,
    "count": 10,
    "items": [
      {
        "name": "nginx",
        "description": "Official build of Nginx.",
        "stars": 21438,
        "pulls": 13654538231,
        "official": true,
        "automated": false,
        "url": "https://hub.docker.com/_/nginx"
      },
      {
        "name": "nginx/nginx-ingress",
        "description": "NGINX and  NGINX Plus Ingress Controllers for Kubernetes",
        "stars": 124,
        "pulls": 1089096520,
        "official": false,
        "automated": false,
        "url": "https://hub.docker.com/r/nginx/nginx-ingress"
      },
      {
        "name": "nginx/nginx-prometheus-exporter",
        "description": "NGINX Prometheus Exporter for NGINX and NGINX Plus",
        "stars": 53,
        "pulls": 93031540,
        "official": false,
        "automated": false,
        "url": "https://hub.docker.com/r/nginx/nginx-prometheus-exporter"
      }
    ]
  },
  "meta": {
    "request_id": "req_02a362a34484491da65821ecbf6e4996",
    "credits_charged": 1,
    "credits_remaining": 1996
  }
}
```

200 OK JSON X-Credits-Used: 1

Recorded from our API and shortened.

Sample data

## What one call returns

A recorded run of `search`: the fields and shapes you will get, shortened to 3 items.

| # | name string | description string | stars integer | pulls integer | official boolean | automated boolean | url url |
| --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | nginx | Official build of Nginx. | 21438 | 13654538231 | true | false | https://hub.docker.com/\_/nginx |
| 2 | nginx/nginx-ingress | NGINX and NGINX Plus Ingress Controllers for Kubernetes | 124 | 1089096520 | false | false | https://hub.docker.com/r/nginx/nginx-ingress |
| 3 | nginx/nginx-prometheus-exporter | NGINX Prometheus Exporter for NGINX and NGINX Plus | 53 | 93031540 | false | false | https://hub.docker.com/r/nginx/nginx-prometheus-exporter |

Recorded from our API · 3 items shown · 7 datapoints per item GET /v1/docker-hub/search?query=nginx&page\_size=10

7 datapoints

### Identity

-   name string

### Contact

-   url url

### Reputation

-   stars integer

### Other

-   description string
-   pulls integer
-   official boolean
-   automated boolean

Playground

## Run this API

cURL shell 

```
curl "https://api.perceptlayer.com/v1/docker-hub/search?query=nginx&page_size=10" \
  -H "X-API-Key: $API_KEY"
```

Docker Hub · 3 endpoints

## Endpoints

Every endpoint takes the same key. Open one for its parameters, the fields it returns and an example request.

| Endpoint | Required parameters | Returns | Cost |
| --- | --- | --- | --- |
| [GET `/v1/docker-hub/repository`](https://perceptlayer.com/apis/docker-hub/repository) | `name` | `name` `namespace` `description` `full_description` `stars` `pulls` +6 more | 1 credit |
| [GET `/v1/docker-hub/search`](https://perceptlayer.com/apis/docker-hub/search) | `query` +2 optional | `name` `description` `stars` `pulls` `official` `automated` +1 more | 1 credit |
| [GET `/v1/docker-hub/tags`](https://perceptlayer.com/apis/docker-hub/tags) | `name` +3 optional | `tag` `size_bytes` `digest` `last_updated` `last_pushed` `platforms` | 1 credit |

Overview

## About the Docker Hub API

## What you can get

The Docker Hub API returns Docker Hub image repository data as JSON through 3 endpoints. Repositories are named namespace/name, or by a bare name for an official image.

-   **Search:** `search` takes a `query`, with `page` and `page_size` (1 to 100).
-   **Repositories:** `repository` takes a `name`, for example `bitnami/redis` or `nginx`.
-   **Tags:** `tags` takes a `name`, with `ordering` (last\_updated or name), `page` and `page_size`.

The recorded `search` for "nginx" returns `items`, each with `name`, `description`, `stars`, `pulls`, `official`, `automated` and `url`, plus `total` (297,082 in that recording), `page` and `has_more`. The first result, the official `nginx` image, had 21,438 stars and 13,654,538,231 pulls. `repository` adds `namespace`, `full_description` (the repository's readme), `categories`, `last_updated`, `created_at` and `storage_bytes`.

## How a call works

Search, then look up: `GET /v1/docker-hub/search?query=nginx&page_size=10` with your key in the `X-API-Key` header returns each repository's `name`; `repository` and `tags` take that `name`, for example `GET /v1/docker-hub/tags?name=nginx&page_size=10`. Check `has_more` before asking for the next `page`. Answers come from a cache for up to an hour, so pulls, stars and new tags can be up to an hour old. Every successful call costs 1 credit; failed calls cost nothing.

Apps and media JSON REST MCP

### More apps and media APIs

[Apple App Store](https://perceptlayer.com/apis/apple-app-store) [Apple Podcasts](https://perceptlayer.com/apis/apple-podcasts) [arXiv](https://perceptlayer.com/apis/arxiv) [Audible](https://perceptlayer.com/apis/audible) [Bandcamp](https://perceptlayer.com/apis/bandcamp) [Chrome Web Store](https://perceptlayer.com/apis/chrome-web-store) [CISA KEV](https://perceptlayer.com/apis/cisa-kev) [ClinicalTrials.gov](https://perceptlayer.com/apis/clinicaltrials) [Coursera](https://perceptlayer.com/apis/coursera) [crates.io](https://perceptlayer.com/apis/crates-io) [Crossref](https://perceptlayer.com/apis/crossref) [Discogs](https://perceptlayer.com/apis/discogs)

Use cases

### Check the newest tags of a base image before bumping a Dockerfile

`Use the Docker Hub API to check the newest tags of a base image before bumping a Dockerfile` 

### Check which platforms a tag is built for, by \`os\` and \`architecture\`

`` Use the Docker Hub API to check which platforms a tag is built for, by `os` and `architecture` `` 

### Compare candidate images by pulls, stars and whether they are official

`Use the Docker Hub API to compare candidate images by pulls, stars and whether they are official` 

### Pin an image by digest from the tag list

`Use the Docker Hub API to pin an image by digest from the tag list` 

FAQ

## Questions

**How much does the Docker Hub API cost?**

Each successful call costs one credit, and each page of results or tags is one call. New accounts get free credits to start, and credit packs bring the price down as you scale.

**How do I name an official image?**

Pass the bare name, such as \`nginx\`; it is returned as \`library/nginx\`. Other repositories take namespace/name, such as \`bitnami/redis\`.

**What does \`tags\` return?**

Each tag's \`tag\`, \`size\_bytes\`, \`digest\`, \`last\_updated\`, \`last\_pushed\` and \`platforms\`, each platform with \`os\`, \`architecture\`, \`size\_bytes\` and \`digest\`, plus a \`total\` (1,437 tags for \`nginx\` in the recording). It does not return image layers or vulnerability scans.

**Do I need a Docker Hub account?**

No. You call this Docker Hub API with your Perceptlayer key in the \`X-API-Key\` header, with no Docker Hub login or token.

**Should I build a Docker Hub scraper instead?**

You can, but a Docker Hub scraper is code you maintain: page changes break it, requests get blocked, and Docker Hub's terms govern how you collect data. The Docker Hub API gives you 3 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first.

## Try the Docker Hub API with 100 free credits

No credit card. Failed calls are never billed.

[Get a free API key](https://perceptlayer.com/signup) [Read the docs](https://docs.perceptlayer.com)
