An interactive web application that helps users query and analyze data from the ClinicalTrials.gov API using natural language questions.
- Natural language query interface for clinical trials data
- Automatic conversion of questions into structured API queries
- Real-time search results with detailed study information
- Smart summarization of relevant findings
- Dark/Light theme support
- Mobile-responsive design
- Enter a question in the search box or select from sample questions
- The application will:
- Convert your question into API parameters
- Search relevant clinical trials
- Display matching studies in a table
- Provide a summarized answer with citations
- "What are inclusion-exclusion criteria for a diabetes trial on 65+ patients?"
- "What are primary and secondary outcomes for breast cancer patients?"
- "Which interventions are being tested in 50+ Alzheimer's patients?"
- "What are the eligibility criteria for pediatric asthma trials?"
- "What is the average duration of depression medications trials?"
- Modern web browser with JavaScript enabled
- Access to LLM Foundry API (for question processing)
- Internet connection for accessing ClinicalTrials.gov API
- Clone this repository:
git clone https://github.com/gramener/clinicaltrialsapi.git
cd clinicaltrialsapi
- Serve the files using any static web server. For example, using Python:
python -m http.server
- Open
http://localhost:8000
in your web browser
On Cloudflare DNS,
proxy CNAME clinicaltrialsapi.straive.app
to gramener.github.io
.
On this repository's page settings, set
- Source:
Deploy from a branch
- Branch:
main
- Folder:
/
- Frontend: Vanilla JavaScript with lit-html for rendering
- API Integration: ClinicalTrials.gov API v2, specifically the
/studies
endpoint - LLM Integration: LLM Foundry API for query processing, specifically the
/openai/v1/chat/completions
endpoint withgpt-4o-mini
model - Styling: Bootstrap 5.3.3 with dark mode support
- lit-html: Template rendering
- asyncLLM: Streaming LLM responses
- marked: Markdown parsing
- partial-json: JSON parsing
- Bootstrap: UI framework
- Bootstrap Icons: Icon set
├── index.html # Main HTML file
├── script.js # Main application logic
├── clinicaltrials.js # API integration module
└── README.md # Documentation
- Query Processing: Converts natural language to structured API queries
- Study Rendering: Displays study data in a responsive table
- Summary Generation: Creates natural language summaries of findings
- Theme Management: Handles dark/light mode preferences
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request