A Guide to the Lilly COI API


Click the image to view an infographic about the Lilly COI API

Click to enlarge the infographic.

Click to enlarge the infographic.

As the Internet continues to mature and more people access the web through desktop and mobile apps, the need for APIs (Application Programming Interfaces) has never been more pressing. APIs provide a consistent, easy-to-use way for developers to access data that can be built into mobile apps or websites.

Since 2005, ProgrammableWeb has cataloged the world’s APIs and has become the de facto journal of the API economy. Today there are more than 12,000 APIs listed in the ProgrammableWeb directory, but only 2.07% of those APIs are health-related. Clinical research-related APIs are hardly present at all, accounting for just 0.07% of the APIs listed on ProgrammableWeb.

The Lilly COI API is at the center of our efforts to make it easier for people to find clinical trials that are right for them or their loved ones. The API was created to make publicly-available clinical trial information easier for people to understand and easier for developers to work with.

Data from ClinicalTrials.gov is the gold-standard for updated clinical trials data, so the Lilly COI API takes that data and extends developers capabilities to easily work with the data. Starting with the base data from ClinicalTrials.gov, we added location data for clinical trial sites, and allow for additional trial data in the future.

As developers work with the Lilly COI API, the results are output in modern web-friendly JSON in a RESTful manner, making it easy for developers to plug the data into a simple, lightweight web widget or even robust, full-featured applications. In addition, the Lilly COI API allows access to individual fields and offers paginated result sets and linked location resources, so users can see which trials are happening at specific locations.

If you’re interested in learning more about the technical aspects of the API, check out our developer portal.

Below is an example of a an API call used to return clincial trial data for the Nutrition and Exercise Intervention Study (NEXIS) trial:

var xhr = new XMLHttpRequest();
xhr.open( 'GET', 'https://data.lillycoi.com/trial/nct/NCT00926744', true );
xhr.onreadystatechange = function () {
    if (xhr.readyState === 4) {
        console.log( new Function( 'return ' + this.responseText + ';' )() );
xhr.setRequestHeader( 'Authorization', 'Basic ' + btoa( '<username>:<password>' ) );