not sure is it public API or not but MS uses the following request: if you go to Container properties page, run Fiddler and then click Calculate size - you may see HTTP GET request which will looks like that:
GET https://{storageAccountName}.blob.core.windows.net/{containerName}?restype=container&comp=list&sv=2020-08-04&ss=bqtf&srt=sco&sp=rwdlacuptfxi&se=2021-08-30T22:26:45Z&sig=...
It will return xml response which looks like this:
i.e. set of blobs with different BlobType (on above picture there are only BlockBlob). Then I assume it calculates overall size as sum of sizes of each blob (per type) and shows it on Container size: