Downloading Programmatically

Data files are accessible using HTTP basic authentication, using your account email and password. Downloads are named by the drug category and type. You can view the different names on the download pages, or get a list of downloads for a release in JSON format.

Note that you need to pass the -L parameter to tell cURL to follow redirects (our data is stored privately on Amazon S3).


Grab the latest full XML download:
> curl -Lfv -o filename.zip -u EMAIL:PASSWORD https://www.drugbank.ca/releases/latest/downloads/all-full-database 

You can also access the downloads by version and name using the following URL format:
> curl -Lfv -o filename.zip -u EMAIL:PASSWORD https://www.drugbank.ca/releases/4-5-0/downloads/all-full-database 

Querying Downloads

You can access information about releases and downloads in JSON format.


To get a list of all releases in JSON format, you can access this URL:
> curl -L -u [email protected]:PASSWORD https://www.drugbank.ca/releases.json 

To get a list of all downloads in JSON format for the latest release, you can access this URL:
> curl -L -u [email protected]:PASSWORD https://www.drugbank.ca/releases/latest.json 

To get a list of all downloads in JSON format for a particular release, you can access this URL:
> curl -L -u [email protected]:PASSWORD https://www.drugbank.ca/releases/4-5-0.json