4
votes

Is there a way to get the size in bytes of a folder from google cloud storage through an API? I saw there is a du command for the https://cloud.google.com/storage/docs/gsutil/commands/du for gsutil. But I didn't find anywhere if it is possible to get this data through an API.

1

1 Answers

3
votes

I found that this can be done by calling the list method from this api https://cloud.google.com/storage/docs/json_api/v1/objects. The objects have a size property and you can put a prefix if you want the get only the objects from a specific path.