You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

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

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
    3 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.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    [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 Staff rankDropbox Staff

        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.