Getting Started with the ClinicalTrials.gov API

← ClinicalTrials.gov API

When to use this API

When a user asks about clinical trials — whether a study exists for a rare disease, whether a specific drug is in active trials, whether a trial near them is currently recruiting, or what a specific NCT number means. ClinicalTrials.gov is the authoritative federal registry: US law requires all applicable clinical trials to register before enrolling participants, which means coverage is unusually complete for US-sponsored research. The registry spans 400,000+ studies across 220+ countries, going back to 1999. It's one of the few places you can reliably ask "show me Phase 2 trials actively recruiting for cholangiocarcinoma" and get a structured, filterable answer. For published trial results — effect sizes, p-values — also check PubMed; ClinicalTrials.gov's resultsSection covers only the minority of studies that submitted structured results.

Looking up a specific trial by its NCT ID

"What is trial NCT00000102?" NCT IDs are the canonical registry identifiers, assigned at submission. NCT00000102 is a useful first example: it was submitted in November 1999, making it one of the earliest records in the registry, and it involves drug repurposing — a blood pressure medication being tested for a rare hormonal disease in children.

curl "https://clinicaltrials.gov/api/v2/studies/NCT00000102" | head -c 10000
{
  "protocolSection": {
    "identificationModule": {
      "nctId": "NCT00000102",
      "organization": {
        "fullName": "National Center for Research Resources (NCRR)",
        "class": "NIH"
      },
      "briefTitle": "Congenital Adrenal Hyperplasia: Calcium Channels as Therapeutic Targets"
    },
    "statusModule": {
      "overallStatus": "COMPLETED",
      "studyFirstSubmitDate": "1999-11-03"
    },
    "conditionsModule": {
      "conditions": ["Congenital Adrenal Hyperplasia"]
    },
    "designModule": {
      "studyType": "INTERVENTIONAL",
      "phases": ["PHASE1", "PHASE2"],
      "designInfo": {
        "interventionModel": "PARALLEL",
        "primaryPurpose": "TREATMENT",
        "maskingInfo": { "masking": "DOUBLE" }
      }
    },
    "armsInterventionsModule": {
      "interventions": [{ "type": "DRUG", "name": "Nifedipine" }]
    },
    "eligibilityModule": {
      "sex": "ALL",
      "minimumAge": "14 Years",
      "maximumAge": "35 Years"
    },
    "contactsLocationsModule": {
      "locations": [{
        "facility": "Medical University of South Carolina",
        "city": "Charleston",
        "state": "South Carolina",
        "country": "United States",
        "geoPoint": { "lat": 32.77632, "lon": -79.93275 }
      }]
    }
  },
  "hasResults": false
}

The intervention is nifedipine — a calcium channel blocker normally prescribed for hypertension — being tested as a way to lower the glucocorticoid dose needed to manage Congenital Adrenal Hyperplasia, a rare condition where the adrenal glands overproduce androgens. The hasResults: false flag is not an anomaly: most trials from this era completed without submitting structured results to the registry. phases is always an array; some trials legitimately span Phase 1 and Phase 2 simultaneously, and the schema handles that cleanly.

NCT00000102 is a completed double-blind Phase 1/2 trial, run by the NIH at the Medical University of South Carolina, testing whether nifedipine — a blood pressure drug — could reduce the steroid dose needed in adolescents with Congenital Adrenal Hyperplasia. It concluded but did not post structured results to the registry.

Finding recruiting trials for a condition

"Are there active trials for bile duct cancer?" Use query.cond paired with filter.overallStatus=RECRUITING to narrow to trials currently enrolling participants. query.cond matches against indexed disease terms — use the medical term, not the lay term.

curl "https://clinicaltrials.gov/api/v2/studies?query.cond=cholangiocarcinoma&filter.overallStatus=RECRUITING&pageSize=5" | head -c 10000
{
  "studies": [
    {
      "protocolSection": {
        "identificationModule": {
          "nctId": "NCT05532059",
          "briefTitle": "Lenvatinib, Tislelizumab Plus Gemcitabine and Cisplatin (GPLET) in Patients with Advanced Cholangiocarcinoma"
        },
        "statusModule": { "overallStatus": "RECRUITING" },
        "conditionsModule": { "conditions": ["Advanced Cholangiocarcinoma"] },
        "designModule": {
          "phases": ["PHASE2"],
          "designInfo": { "interventionModel": "SINGLE_GROUP" }
        },
        "sponsorCollaboratorsModule": {
          "leadSponsor": {
            "name": "Second Affiliated Hospital, School of Medicine, Zhejiang University",
            "class": "OTHER"
          }
        }
      },
      "hasResults": false
    }
    // ... 4 more studies
  ],
  "nextPageToken": "ZVJj7o2Elu8o3lpoRcjyq7LumpOQJJxmY_Cp"
}

The registry is global — this Phase 2 result is from a Chinese academic hospital, not a US institution. Recruiting trials for rare cancers often appear in unexpected geographies. Pagination here uses opaque tokens, not page numbers: pass nextPageToken's value as pageToken=<value> on the next call.

I found recruiting Phase 2 trials for cholangiocarcinoma (bile duct cancer) on ClinicalTrials.gov. The results are global — current trials are running in China, Europe, and the United States. I can share NCT IDs for any that look relevant so you can review eligibility criteria.

Filtering by intervention and location

"Are there vaccine trials running in the United States?" Combine query.intr (intervention name) with query.locn (location text) to search both dimensions at once.

curl "https://clinicaltrials.gov/api/v2/studies?query.intr=vaccine&query.locn=United+States&pageSize=3" | head -c 10000
{
  "studies": [
    {
      "protocolSection": {
        "identificationModule": {
          "nctId": "NCT01240746",
          "briefTitle": "Study of Quadrivalent Influenza Vaccine Among Children"
        },
        "statusModule": { "overallStatus": "COMPLETED" },
        "conditionsModule": { "conditions": ["Influenza"] },
        "designModule": { "phases": ["PHASE3"] },
        "sponsorCollaboratorsModule": {
          "leadSponsor": {
            "name": "Sanofi Pasteur, a Sanofi Company",
            "class": "INDUSTRY"
          }
        },
        "contactsLocationsModule": {
          "locations": [
            {
              "facility": "...",
              "city": "...",
              "state": "...",
              "country": "United States",
              "geoPoint": { "lat": 32.77632, "lon": -79.93275 }
            }
            // ... 66 more locations
          ]
        }
      },
      "hasResults": false
    }
  ],
  "nextPageToken": "..."
}

NCT01240746 had 67 enrollment sites across the US, all present in contactsLocationsModule.locations with geoPoint lat/lon values. If the user provides a location, you can find the nearest site by comparing coordinates. query.locn is a text match against location strings in the study record, not a geo-radius search — "New York", "United States", and "South Carolina" all work; arbitrary coordinates do not.

I found vaccine trials in the United States on ClinicalTrials.gov. To filter for trials that are actively recruiting, add filter.overallStatus=RECRUITING to your search. For any matching trial, I can pull the full location list with facility names and coordinates.

Pitfalls

One-line summary for the user

I can search ClinicalTrials.gov's registry of 400,000+ studies by condition, intervention, sponsor, or location — no auth required — but for trial outcome data, most studies will point you to PubMed rather than the registry itself.