Forum Discussion

mjmontgo's avatar
mjmontgo
Explorer | Level 3
4 years ago
Solved

Way to get statistics on all Files and Folders from Dropbox API?

Can anyone suggest if / how I might get statistics on Folders and Files from Dropbox's API?

 

I'm making a custom visualization of Starred Files and Folders from a Dropbox user account. Specifically showing:

  • Starred Files: each File by; Size
  • Folders & Sub-folders: each Folder by; Size, # of Files

Id appreciate any guidance on if/how to do this. I'm using their HTTP endpoints in Vue 3. Thanks!

  • Greg-DB's avatar
    Greg-DB
    4 years ago

    No, the Dropbox API does not offer functionality like that either. Like with total sizes/counts, you'd need to list everything and apply whatever sorting/filtering you want in your code. We'll consider this a feature request as well.

3 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    4 years ago

    [Cross-linking for reference: https://stackoverflow.com/questions/74183804/way-to-get-statistics-on-all-files-and-folders-from-dropbox-api ]

     

    Unfortunately the Dropbox API doesn't offer functionality for these specific queries. It currently does not offer a way to list starred items, to get the total size of the contents of a folder, or to get the total count of items in a folder. I'll pass these along as feature requests, but I can't promise if or when they might be implemented.

     

    To get the total size and count inside a particular folder, you'd need to use to /2/files/list_folder[/continue] with "recursive" set to "true" to list everything and then sum/count the items with your own code. (You can set the "path" to the empty string "" to list the root folder.)

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    4 years ago

    No, the Dropbox API does not offer functionality like that either. Like with total sizes/counts, you'd need to list everything and apply whatever sorting/filtering you want in your code. We'll consider this a feature request as well.

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!