Start 2025 on time and up to date! Seamlessly integrate your calendars into Dropbox with these simple steps! 📆

Forum Discussion

dlevy's avatar
dlevy
New member | Level 1
2 months ago

Slow response using Dropbox for Python

Hello,

My python code has been working well for months. Within the past 48 hours, the files_download command in the snippet below (with tokens obfuscated) has started to take about 45 seconds while previously it was instantaneous. It is the last line that is the culprit. 

import dropbox

DROPBOX_APP_KEY = "?????"
DROPBOX_APP_SECRET = "?????"
DROPBOX_REFRESH_TOKEN = "????"

dbx = dropbox.Dropbox(app_key=DROPBOX_APP_KEY,
                             app_secret=DROPBOX_APP_SECRET,
                             oauth2_refresh_token=DROPBOX_REFRESH_TOKEN)

metadata, f = dbx.files_download('/alerts.csv')

Any suggestions?

With thanks,

David

  • DB-Des's avatar
    DB-Des
    Icon for Dropbox Engineer rankDropbox Engineer

    Hi dlevy

    Download speeds can be influenced by a variety of factors, including network conditions, server load, or local configurations.

    Sometimes resetting or retrying your connection gets you a different route and better speeds, but that is outside of our control.

    • dlevy's avatar
      dlevy
      New member | Level 1

      Thanks. The download is instantaneous when I use Windows Explorer, for example. It is only with the Python wrapper over the Dropbox app that I have issues. I've tried this on different computers, networks, etc. with the same result. 

  • DB-Des's avatar
    DB-Des
    Icon for Dropbox Engineer rankDropbox Engineer

    dlevy

    Large files, file corruption or mismanagement of file chunks could also contribute to the change in download speeds.

    It’s important to note that the Dropbox website and application may use different mechanisms and infrastructure for various pieces of functionality compared to the API. As such, comparing behavior and results between these platforms may result in inconsistencies.

    • dlevy's avatar
      dlevy
      New member | Level 1

      Thanks for letting me know about the different mechanisms. The file is tiny, just 258 bytes of text. 

      • DB-Des's avatar
        DB-Des
        Icon for Dropbox Engineer rankDropbox Engineer

        dlevy 

        I’ve been unable to replicate the issue reported on my end, but below are a few troubleshooting steps that may help identify the cause:

        • Check if any proxies, firewalls, VPNs, or similar network configurations are in use on the affected computers. These can sometimes interfere with the connection.
        • Investigate whether you can get more visibility into the issue. For example, is there an option to enable more verbose logging or detailed output in your setup? Alternatively, you could try reproducing the issue using a tool like curl to observe the raw request and response.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,936 PostsLatest Activity: 3 hours ago
347 Following

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 or Facebook.

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!