Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Search and analyze clinical trials via the ClinicalTrials.gov v2 API
.claude/skills/brycewang-stanford-clinicaltrials-api-v2/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 176% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 127% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 274% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 28% | 0% |
| case-06 | ✓→✓ | = Same ✓ | 55% | 0% |
ClinicalTrials.gov is the world's largest clinical trial registry, maintained by the U.S. National Library of Medicine (NLM) at NIH. It contains over 576,000 study records from 220+ countries covering interventional trials, observational studies, and expanded access programs. The v2 API provides structured JSON access with field-level filtering, cursor-based pagination, and statistics endpoints.
Key v2 improvements over the legacy API: JSON-native responses, sparse field selection via the fields parameter, nextPageToken pagination, and dedicated statistics endpoints. Study data is organized into protocolSection (sponsor-submitted) and derivedSection (NLM-computed).
No authentication required. All endpoints are publicly accessible without API keys or registration. Users should comply with NCBI usage policies and maintain reasonable request rates.
GET https://clinicaltrials.gov/api/v2/studies| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | query.term | string | No | Free-text search across all fields | | query.cond | string | No | Condition or disease filter | | query.intr | string | No | Intervention or treatment filter | | query.spons | string | No | Sponsor or collaborator filter | | filter.overallStatus | string | No | RECRUITING, COMPLETED, ACTIVE_NOT_RECRUITING, etc. | | filter.phase | string | No | EARLY_PHASE1, PHASE1, PHASE2, PHASE3, PHASE4, NA | | filter.geo | string | No | Geographic filter (distance(lat,lng,dist)) | | fields | string | No | Comma-separated fields for sparse response | | sort | string | No | Sort field and direction (e.g., LastUpdatePostDate:desc) | | pageSize | int | No | Results per page (default 10, max 1000) | | pageToken | string | No | Cursor token for next page | | format | string | No | json (default) or csv |
bashcurl "https://clinicaltrials.gov/api/v2/studies?query.cond=diabetes&query.intr=metformin&pageSize=1&fields=NCTId,BriefTitle,OverallStatus"
json{ "studies": [{ "protocolSection": { "identificationModule": { "nctId": "NCT06649773", "briefTitle": "The Experiment of Noiiglutide Injection in Type 2 Diabetes Patients" }, "statusModule": { "overallStatus": "ACTIVE_NOT_RECRUITING" } } }], "nextPageToken": "ZVNj7o2Elu8o3lpo..." }
Full responses include protocolSection with: identificationModule (NCT ID, titles, organization), statusModule (status, dates), descriptionModule (summary), conditionsModule, designModule (type, phases, enrollment), armsInterventionsModule, eligibilityModule (criteria, sex, age), outcomesModule, and contactsLocationsModule.
GET https://clinicaltrials.gov/api/v2/studies/{nctId}bashcurl "https://clinicaltrials.gov/api/v2/studies/NCT04280705?fields=NCTId,BriefTitle,OverallStatus,Phase,LeadSponsorName,EnrollmentCount,Condition,InterventionName"
json{ "protocolSection": { "identificationModule": { "nctId": "NCT04280705", "briefTitle": "Adaptive COVID-19 Treatment Trial (ACTT)" }, "statusModule": { "overallStatus": "COMPLETED", "startDateStruct": { "date": "2020-02-21" }, "completionDateStruct": { "date": "2020-05-21" } }, "sponsorCollaboratorsModule": { "leadSponsor": { "name": "National Institute of Allergy and Infectious Diseases (NIAID)" } }, "conditionsModule": { "conditions": ["COVID-19"] }, "designModule": { "phases": ["PHASE3"], "enrollmentInfo": { "count": 1062 } }, "armsInterventionsModule": { "interventions": [{ "name": "Placebo" }, { "name": "Remdesivir" }] } } }
GET https://clinicaltrials.gov/api/v2/stats/sizebashcurl "https://clinicaltrials.gov/api/v2/stats/size"
json{ "totalStudies": 576554, "averageSizeBytes": 17186, "largestStudies": [ { "id": "NCT02723955", "sizeBytes": 3596689 }, { "id": "NCT03688620", "sizeBytes": 2865033 } ] }
GET https://clinicaltrials.gov/api/v2/stats/fieldValues/{fieldName}bashcurl "https://clinicaltrials.gov/api/v2/stats/fieldValues/Phase"
json{ "type": "ENUM", "piece": "Phase", "field": "protocolSection.designModule.phases", "missingStudiesCount": 136632, "topValues": [ { "value": "NA", "studiesCount": 222829 }, { "value": "PHASE2", "studiesCount": 87478 }, { "value": "PHASE1", "studiesCount": 63716 }, { "value": "PHASE3", "studiesCount": 48700 }, { "value": "PHASE4", "studiesCount": 34911 }, { "value": "EARLY_PHASE1", "studiesCount": 6179 } ] }
No formal rate limits are published for the v2 API. Follow NCBI usage guidelines: stay under 3 requests/second without an API key, up to 10/second with one. For bulk data access, use the AACT relational database (https://aact.ctti-clinicaltrials.org/) or downloadable flat files rather than paginating through the full API.
query.cond + query.intr + filter.overallStatus=COMPLETED to build PRISMA-compliant trial inventories. Paginate with nextPageToken to collect all records, then extract outcomes and enrollment for quantitative synthesis.stats/fieldValues to map phase distributions, sponsor concentration, and geographic spread for a therapeutic area -- useful for identifying evidence gaps in grant proposals.RECRUITING status and filter.geo to find active enrollment opportunities. Automate periodic queries for new trials in your domain.pythonimport requests, time def collect_trials(condition, intervention, status="COMPLETED"): base = "https://clinicaltrials.gov/api/v2/studies" studies, token = [], None while True: params = { "query.cond": condition, "query.intr": intervention, "filter.overallStatus": status, "pageSize": 100, "fields": "NCTId,BriefTitle,Phase,EnrollmentCount,CompletionDate", } if token: params["pageToken"] = token data = requests.get(base, params=params).json() studies.extend(data.get("studies", [])) token = data.get("nextPageToken") if not token: break time.sleep(0.34) return studies trials = collect_trials("type 2 diabetes", "metformin") print(f"Collected {len(trials)} completed metformin T2D trials")
pythonimport requests from collections import Counter params = {"query.cond": "Alzheimer's Disease", "pageSize": 100, "fields": "NCTId,Phase,LeadSponsorName"} data = requests.get("https://clinicaltrials.gov/api/v2/studies", params=params).json() phases, sponsors = Counter(), Counter() for s in data["studies"]: p = s["protocolSection"] for ph in p.get("designModule", {}).get("phases", []): phases[ph] += 1 sponsors[p.get("sponsorCollaboratorsModule", {}) .get("leadSponsor", {}).get("name", "Unknown")] += 1 for ph, n in phases.most_common(): print(f"{ph}: {n}")
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 15,855 | 11,809 | -26% | 1 | 1 | 0% | 3,182 | 4,083 | +28% | 0 | 0 | — |
case-06 | pass→pass | 10,096 | 5,259 | -48% | 1 | 1 | 0% | 1,965 | 3,047 | +55% | 0 | 0 | — |
case-02 | pass→pass | 4,946 | 3,870 | -22% | 1 | 1 | 0% | 855 | 2,982 | +249% | 0 | 0 | — |
case-03 | pass→pass | 12,225 | 9,628 | -21% | 1 | 1 | 0% | 2,197 | 4,222 | +92% | 0 | 0 | — |
case-04 | fail→pass | 6,671 | 4,839 | -27% | 1 | 1 | 0% | 1,172 | 3,230 | +176% | 0 | 0 | — |
case-05 | pass→pass | 7,902 | 2,778 | -65% | 1 | 1 | 0% | 1,394 | 2,835 | +103% | 0 | 0 | — |
case-07 | pass→pass | 11,449 | 8,516 | -26% | 1 | 1 | 0% | 2,145 | 4,029 | +88% | 0 | 0 | — |
case-08 | fail→pass | 8,017 | 4,442 | -45% | 1 | 1 | 0% | 1,343 | 3,046 | +127% | 0 | 0 | — |
case-09 | pass→pass | 14,692 | 10,362 | -29% | 1 | 1 | 0% | 2,356 | 4,122 | +75% | 0 | 0 | — |
case-10 | pass→pass | 5,864 | 3,609 | -38% | 1 | 1 | 0% | 1,065 | 2,934 | +175% | 0 | 0 | — |
case-19 | pass→pass | 24,365 | 21,185 | -13% | 1 | 1 | 0% | 4,154 | 6,297 | +52% | 0 | 0 | — |
case-11 | fail→pass | 4,228 | 2,903 | -31% | 1 | 1 | 0% | 747 | 2,796 | +274% | 0 | 0 | — |
case-12 | pass→pass | 7,263 | 6,608 | -9% | 1 | 1 | 0% | 1,343 | 3,575 | +166% | 0 | 0 | — |
case-13 | pass→pass | 8,131 | 4,922 | -39% | 1 | 1 | 0% | 1,519 | 3,191 | +110% | 0 | 0 | — |
case-14 | pass→pass | 8,278 | 4,730 | -43% | 1 | 1 | 0% | 1,570 | 3,121 | +99% | 0 | 0 | — |
case-15 | pass→pass | 4,207 | 4,906 | +17% | 1 | 1 | 0% | 815 | 3,272 | +301% | 0 | 0 | — |
case-16 | pass→pass | 9,213 | 9,271 | +1% | 1 | 1 | 0% | 1,734 | 4,205 | +143% | 0 | 0 | — |
case-17 | pass→pass | 5,527 | 2,441 | -56% | 1 | 1 | 0% | 699 | 2,680 | +283% | 0 | 0 | — |
case-18 | pass→pass | 4,584 | 2,134 | -53% | 1 | 1 | 0% | 692 | 2,610 | +277% | 0 | 0 | — |
case-20 | pass→pass | 11,499 | 7,873 | -32% | 1 | 1 | 0% | 2,286 | 4,024 | +76% | 0 | 0 | — |
case-21 | pass→pass | 4,546 | 5,718 | +26% | 1 | 1 | 0% | 902 | 3,456 | +283% | 0 | 0 | — |
case-22 | pass→pass | 16,132 | 12,874 | -20% | 1 | 1 | 0% | 2,579 | 4,249 | +65% | 0 | 0 | — |
case-23 | pass→pass | 12,390 | 17,648 | +42% | 1 | 1 | 0% | 2,194 | 5,181 | +136% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +13 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.