DockerHub API - listing tags
You can add the query parameter page_size=X
to determine how many tags will be displayed. It won't automatically give you every tag, but you can set it to a really big number to ensure you get what you want.
https://hub.docker.com/v2/repositories/library/ubuntu/tags?page_size=1000
Here is an example way to retrieve all the tags associated with ubuntu docker image:
https://hub.docker.com/v2/repositories/library/ubuntu/tags
Credits to Simon in the comments.