Docker Community Forums

Share and learn in the Docker community.

API to read the pull counter




the pull counter for one of our repository shows 10K+ on the web page. How can we query an API to read the exact count value? If possible, we’d like to query and push this information to a time series DB.

Many thanks

(Gary Forghetti) #2

Try this curl command below. It also requires the jq command.
Change the text xxxxxxxx to your Docker Hub user.
Change the text yyyyyyyy to your Docker repository name.

curl -s**xxxxxxxx**/**yyyyyyyy**/ | jq -r '.pull_count' | xargs printf "%'d\n"

Example for the Docker Official Ubuntu image:

curl -s | jq -r '.pull_count' | xargs printf "%'d\n"