docker hub api list image tags

get image tags from docker hub can be done like so:

username=mac2000
password=*******
token=$(curl -s -X POST -H 'Content-Type: application/json' https://hub.docker.com/v2/users/login -d '{"username": "'${username}'", "password": "'${password}'"}' | jq -r .token)

curl -s -H "Authorization: JWT $token" "https://hub.docker.com/v2/repositories/grafana/grafana/tags?page_size=100" | jq -r '.results|.[]|.name'

# https://hub.docker.com/v2/repositories/library/nginx