How can one check the size of an image or layer in a Docker registry?

I would like to check the size of an image (or alternatively of its layers) before pulling it from a Registry. Is there an API I can use to get size information? Thanks.