Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download files from Dropbox shared folder using Dropbox API

Tags:

dropbox-api

A friend sent me the URL of a dropbox folder he shared with me. This folder has files whose total size is about 8GB.

I have a basic account with 2GB limit, so I cannot add the shared folder contents to my dropbox folder.

How do I programmatically download all the files from the shared folder to my PC?

I checked the documentation (both v1 and v2) and didn't find any APIs that would do this. Am I missing something?

like image 409
Krishna Padmasola Avatar asked Feb 18 '26 10:02

Krishna Padmasola


1 Answers

The current version of the Dropbox API, has endpoints for getting the metadata of shared links, as well as downloading files from shared links:

  • to get the metadata for a shared link: /2/sharing/get_shared_link_metadata
  • to download files from a shared link: /2/sharing/get_shared_link_file

The /2/sharing/get_shared_link_metadata endpoint unfortunately doesn't return the file listing though, so if you need to programmatically get the file listing for use with /2/sharing/get_shared_link_file, as a workaround you can use the API v1 endpoint /1/metadata/link.


Edit:

Dropbox API v2 now supports listing the contents of a shared link for a folder. This can be accomplished using the same interface as listing a folder in a connected user's account, via the list_folder functionality. To list the contents of a shared link for a folder, you instead provide the shared link URL in the shared_link parameter to /2/files/list_folder.

If you're using an official SDK, there will also be a corresponding method for this endpoint.

like image 53
Greg Avatar answered Feb 21 '26 14:02

Greg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!