Skip to content
Automation
Skill

/clinicaltrials-database

Query ClinicalTrials.gov via API v2. Search trials by condition, drug, location, status, or phase. Retrieve trial details by NCT ID, export data, for clinical research and patient matching.

From plugin
vibe-skills
2.7k200 skills8 agents3 commands
Install
$ npx -y skills add foryourhealth111-pixel/Vibe-Skills --skill clinicaltrials-database --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/clinicaltrials-database

Context preview

The summary Claude sees to decide when to auto-load this skill.

Query ClinicalTrials.gov via API v2. Search trials by condition, drug, location, status, or phase. Retrieve trial details by NCT ID, export data, for clinical research and patient matching.

SKILL.md

clinicaltrials-database.SKILL.md
name: clinicaltrials-database
description: Query ClinicalTrials.gov via API v2. Search trials by condition, drug, location, status, or phase. Retrieve trial details by NCT ID, export data, for clinical research and patient matching.
license: Unknown
metadata:
    skill-author: K-Dense Inc.

ClinicalTrials.gov Database

Overview

ClinicalTrials.gov is a comprehensive registry of clinical studies conducted worldwide, maintained by the U.S. National Library of Medicine. Access API v2 to search for trials, retrieve detailed study information, filter by various criteria, and export data for analysis. The API is public (no authentication required) with rate limits of ~50 requests per minute, supporting JSON and CSV formats.

When to Use This Skill

This skill should be used when working with clinical trial data in scenarios such as:

  • **Patient matching** - Finding recruiting trials for specific conditions or patient populations
  • **Research analysis** - Analyzing clinical trial trends, outcomes, or study designs
  • **Drug/intervention research** - Identifying trials testing specific drugs or interventions
  • **Geographic searches** - Locating trials in specific locations or regions
  • **Sponsor/organization tracking** - Finding trials conducted by specific institutions
  • **Data export** - Extracting clinical trial data for further analysis or reporting
  • **Trial monitoring** - Tracking status updates or results for specific trials
  • **Eligibility screening** - Reviewing inclusion/exclusion criteria for trials

Quick Start

Basic Search Query

Search for clinical trials using the helper script:

cd scientific-databases/clinicaltrials-database/scripts
python3 query_clinicaltrials.py

Or use Python directly with the `requests` library:

import requests

url = "https://clinicaltrials.gov/api/v2/studies"
params = {
    "query.cond": "breast cancer",
    "filter.overallStatus": "RECRUITING",
    "pageSize": 10
}

response = requests.get(url, params=params)
data = response.json()

print(f"Found {data['totalCount']} trials")

Retrieve Specific Trial

Get detailed information about a trial using its NCT ID:

import requests

nct_id = "NCT04852770"
url = f"https://clinicaltrials.gov/api/v2/studies/{nct_id}"

response = requests.get(url)
study = response.json()

# Access specific modules
title = study['protocolSection']['identificationModule']['briefTitle']
status = study['protocolSection']['statusModule']['overallStatus']

Core Capabilities

1. Search by Condition/Disease

Find trials studying specific medical conditions or diseases using the `query.cond` parameter.

**Example: Find recruiting diabetes trials**

from scripts.query_clinicaltrials import search_studies

results = search_studies(
    condition="type 2 diabetes",
    status="RECRUITING",
    page_size=20,
    sort="LastUpdatePostDate:desc"
)

print(f"Found {results['totalCount']} recruiting diabetes trials")
for study in results['studies']:
    protocol = study['protocolSection']
    nct_id = protocol['identificationModule']['nctId']
    title = protocol['identificationModule']['briefTitle']
    print(f"{nct_id}: {title}")

**Common use cases:**

  • Finding trials for rare diseases
  • Identifying trials for comorbid conditions
  • Tracking trial availability for specific diagnoses

2. Search by Intervention/Drug

Search for trials testing specific interventions, drugs, devices, or procedures using the `query.intr` parameter.

**Example: Find Phase 3 trials testing Pembrolizumab**

from scripts.query_clinicaltrials import search_studies

results = search_studies(
    intervention="Pembrolizumab",
    status=["RECRUITING", "ACTIVE_NOT_RECRUITING"],
    page_size=50
)

# Filter by phase in results
phase3_trials = [
    study for study in results['studies']
    if 'PHASE3' in study['protocolSection'].get('designModule', {}).get('phases', [])
]

**Common use cases:**

  • Drug development tracking
  • Competitive intelligence for pharmaceutical companies
  • Treatment option research for clinicians

3. Geographic Search

Find trials in specific locations using the `query.locn` parameter.

**Example: Find cancer trials in New York**

from scripts.query_clinicaltrials import search_studies

results = search_studies(
    condition="cancer",
    location="New York",
    status="RECRUITING",
    page_size=100
)

# Extract location details
for study in results['studies']:
    locations_module = study['protocolSection'].get('contactsLocationsModule', {})
    locations = locations_module.get('locations', [])
    for loc in locations:
        if 'New York' in loc.get('city', ''):
            print(f"{loc['facility']}: {loc['city']}, {loc.get('state', '')}")

**Common use cases:**

  • Patient referrals to local trials
  • Geographic trial distribution analysis
  • Site selection for new trials

4. Search by Sponsor/Organization

Find trials conducted by specific organizations using the `query.spons` parameter.

**Example: Find trials sponsored by NCI**

from scripts.query_clinicaltrials import search_studies

results = search_studies(
    sponsor="National Cancer Institute",
    page_size=100
)

# Extract sponsor information
for study in results['studies']:
    sponsor_module = study['protocolSection']['sponsorCollaboratorsModule']
    lead_sponsor = sponsor_module['leadSponsor']['name']
    collaborators = sponsor_module.get('collaborators', [])
    print(f"Lead: {lead_sponsor}")
    if collaborators:
        print(f"  Collaborators: {', '.join([c['name'] for c in collaborators])}")

**Common use cases:**

  • Tracking institutional research portfolios
  • Analyzing funding organization priorities
  • Identifying collaboration opportunities

5. Filter by Study Status

Filter trials by recruitment or completion status using the `filter.overallStatus` parameter.

**Valid status values:**

  • `RECRUITING` - Currently recruiting participants
Read more
Ships withvibe-skills

VibeSkills is a general-purpose Skill that automatically routes local Skills and intelligently orchestrates harness workflows.

Get the whole plugin

Other skills on vibe-skills.