Since our beta launch, we’ve had a steady stream of technical questions about how to use and interact with the data that powers OpenTrials.
Good news! We have a beta public API available that will allow you to retrieve structured data about clinical trials listed in the OpenTrials database for using for your own projects, analyses, and visualisations. While we don’t enforce rate limits on it yet, we ask you to be considerate of our server resources when using the API, limiting your speed to less than a request per few seconds.
We aim to keep adding to this post with new information, demonstrations, and tutorials relating to the OpenTrials API, so bookmark it and come back. If you’ve written something or created an interesting app, visualisation, or analysis, let us know and we’ll add it to the examples below.
Here are some links to help you understand the OpenTrials data and API:
- Introduction to the data
- An overview of the sources we currently import and link together
- Working with the OpenTrials API
- A notebook showing sample code (Python) and output
- API documentation
- Perform test queries against the API using Swagger
- Project ideas
- Simple and complex suggestions, from data cleaning to visualisations
Projects and documentation
Want some inspiration? Here are some projects and documentation which others have created – many thanks to you!
- Visualising interventions, trials, and conditions (Python) – by Matthias König
- Using OpenTrials API with R (R) – by Darko Bergant
If you’ve created a project using the OpenTrials API or used another language to talk to the API, and you’ve documented your efforts we’d love to showcase and link to them – get in touch!
For those of you looking for a database dump, you can find them here.
We’re also happy to discuss potential collaborations, and ask that if you use our data for academic research, you cite our paper – thanks!