The entire OpenTrials database is saved monthly automatically. This is what we use to power our API, and contains everything that you can see on this website. Having the entire database in your local machine allows you to analyze the data using your favorite tool, or even create your own copy of the OpenTrials API.
Below are the latest available dumps of our database. Their file names contain the date at which the dump was produced:
- opentrials-api-2018-01-01.dump (2.1 GB)
- opentrials-api-2017-12-01.dump (2.1 GB)
- opentrials-api-2017-11-01.dump (2.1 GB)
- opentrials-api-2017-10-01.dump (2.1 GB)
- opentrials-api-2017-09-01.dump (2.1 GB)
- opentrials-api-2017-08-01.dump (2.1 GB)
- opentrials-api-2017-07-01.dump (2.1 GB)
- opentrials-api-2017-06-01.dump (2.1 GB)
- opentrials-api-2017-05-01.dump (2.1 GB)
- opentrials-api-2017-04-01.dump (2.1 GB)
- opentrials-api-2017-03-20.dump (2.1 GB)
- opentrials-api-2017-03-01.dump (2.1 GB)
- opentrials-api-2017-02-01.dump (2.1 GB)
- opentrials-api-2017-01-01.dump (2.1 GB)
- opentrials-api-2016-12-01.dump (2.1 GB)
How to use
The dump files you can download above were generated using the pg_dump command of PostgreSQL 9.4. To load it, you need a local database running PostgreSQL 9.4 or newer.
Assuming you have a database called DATABASE created in a PostgreSQL 9.4+ server running on HOST, with user USER, you can restore a dump named OPENTRIALS_DUMP.dump by opening a command line and running:
pg_restore --no-owner --no-acl --create --host=HOST --username=USER --dbname=DATABASE OPENTRIALS_DUMP.dump
Please refer to the PostgreSQL documentation for more information about the restoring process.