Dropbox API Downloading a file using the Dropbox Python library

Download Dropbox API for free


This uses the Dropbox Python SDK to download a file from the Dropbox API at the remote path /Homework/math/Prime_Numbers.txt to the local file Prime_Numbers.txt:

import dropbox
dbx = dropbox.Dropbox("<ACCESS_TOKEN>")

with open("Prime_Numbers.txt", "wb") as f:
    metadata, res = dbx.files_download(path="/Homework/math/Prime_Numbers.txt")

<ACCESS_TOKEN> should be replaced with your access token.

Downloading a file via curl