Query ClinicalTrials.gov API v2 for studies by condition and intervention with cursor-based pagination

domain: clinicaltrials.gov/data-api/api · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Construct GET request to https://clinicaltrials.gov/api/v2/studies with query parameters: query.cond (condition/disease), query.intr (intervention), pageSize (max 1000), and optional sort field
  2. Parse the JSON response envelope: studies array contains objects with protocolSection, derivedSection, and hasResults boolean; capture nextPageToken from the response root
  3. Iterate pages by passing the nextPageToken value as the pageToken parameter in subsequent requests until nextPageToken is absent
  4. Extract nested fields from protocolSection (identificationModule for NCT ID and title, statusModule for overall status and phase, eligibilityModule for criteria text) using the published study data structure schema at clinicaltrials.gov/data-api/about-api/study-data-structure
  5. For a single full record, call GET https://clinicaltrials.gov/api/v2/studies/{nctId} to retrieve resultsSection including participant flow and adverse events when hasResults is true
  6. Validate enumerated status values (RECRUITING, COMPLETED, TERMINATED, etc.) against the API schema rather than hardcoding strings, as the v2 schema enforces controlled vocabulary

Known gotchas

Related routes

Pull and process study metadata from the ClinicalTrials.gov v2 API to monitor FDAAA 801 results reporting compliance for a portfolio of trials
clinicaltrials.gov/data-api/api · 6 steps · unrated
Retrieve a federal docket's entries and RECAP documents via CourtListener's v4 REST API using cursor-based pagination
courtlistener.com · 6 steps · unrated
Query a payer Patient Access API (CMS-9115 mandate) to retrieve member claims and clinical data
fhir · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans