Blog
 / 
API
November 4, 2026

Clinical Trial Search API: Which Registry to Query and How to Build on It

Clinical Trial Search API: Which Registry to Query and How to Build on It

TLDR: For most teams, the clinical trial search API to start with is ClinicalTrials.gov API v2. It is free, needs no key, covers more than 610,000 studies, and returns up to 1,000 records per page. Add NCI's API for cancer trials, the CTIS portal for EU trials, and AACT for SQL analytics. Registries lag behind readouts, so pair them with a search or research API for news and publications.

People who search for a clinical trial search API usually have one of four jobs. They want to find recruiting trials for a patient, track a competitor's pipeline, find the evidence a trial produced, or get told when something changes. One registry handles most of that for free. The hard parts are the query details that quietly drop results, and the gap between what a registry knows and what has actually been announced. This guide covers both, with Python we ran against the live API. Every registry count below comes from the November 4, 2026 data snapshot.

What a clinical trial search API needs to answer

Start from the job rather than the vendor list. Each job maps to a small set of registry fields, and each has a limit that no registry query fixes.

JobTypical userRegistry fields that answer itWhat the registry cannot tell you
Find recruiting trials for a patientPatient-matching apps, sites, advocacy groupsCondition, overall status, site locations and site status, minimum and maximum age, sexWhether the patient meets the eligibility criteria, which are free text
Track a pipelineBusiness development, competitive intelligence, investorsLead sponsor, phase, status, primary completion date, last update dateTopline results that a sponsor announced before posting anything to the registry
Find evidenceMedical affairs, systematic reviewers, HTA teamsHas-results flag, outcome measures, posted resultsWhether a readout was published. The references field lists PubMed IDs and citations, but only some studies have any
Monitor changeAll of the aboveLast update post date, status, datesWhy a date slipped, and often why a trial stopped, because whyStopped is free text and can be empty

Clinical trial registries and their APIs, compared

Five public sources cover the common jobs. Everything below was checked in November 2026.

SourceCoverageAccessLimits and termsWatch out for
ClinicalTrials.gov API v2610,285 studies registered from around the world, as of November 4, 2026REST, JSON or CSV, no keyNo rate limit stated in the spec or API pages. Page size capped at 1,000Results come back unsorted unless you ask for a sort order
NCI Clinical Trials Search API v2Trials supported by NCI or open at an NCI-Designated Cancer Center, open to accrual on or after June 15, 2015REST, registered developer account, x-api-key headerStandard tier: 1 request per second and 50,000 a month. Power tier: 50 per second and 50,000 a weekOnly reachable from the US and Canada, according to the NCI FAQ
EU CTIS public portalTrials submitted through CTIS under the EU Clinical Trials Regulation (EU) No 536/2014Undocumented JSON behind the public search, no keyWe found no EMA specification or published limitsSearch is POST-only, dates are day-first, and the contract can change without notice
WHO ICTRPRecords from registries in the WHO network, with duplicate records for the same trial grouped togetherFree CSV and XML downloads. A web service for agreed partners, with costs quoted on requestWHO says weekly, but on November 5, 2026 the portal's provider list showed last imports from October 26 back to February 2. The download terms bar marketing, promotional or commercial useNot a live API for most teams
AACTThe full ClinicalTrials.gov registry in 40+ relational tablesFree account. Cloud PostgreSQL or full snapshotsRefreshed dailyIt is a database, not an HTTP API, so plan for SQL access

The practical default is ClinicalTrials.gov for search, AACT when you need joins across the whole registry, and the NCI API for oncology, where its separate diseases, interventions and biomarkers endpoints give you controlled vocabularies to match against. Treat CTIS as a scraper target with a contract test, and keep its feed of recently updated trials as the fallback. EMA's 2021 FAQ for public users describes a "Subscribe to Search" feed of trials added or updated in the last seven days, which makes it the channel EMA itself documents. A community-documented schema maps the JSON endpoints in detail. In our test, a GET to the search endpoint returned 403, while a POST with a JSON body returned results without a key.

Querying ClinicalTrials.gov API v2 without silent misses

Everything goes through one endpoint, GET https://clinicaltrials.gov/api/v2/studies. The OpenAPI spec defines two kinds of parameters. The query.* parameters (cond, term, intr, locn, spons, lead, id and others) take Essie expression syntax and affect relevance ranking. The filter.* parameters (overallStatus, geo, ids, advanced) narrow the set without changing rank. Five rules from the spec matter in production:

  • Studies are not sorted by default. Pass sort=@relevance or a date field such as LastUpdatePostDate.
  • The default page size is 10, and larger values are coerced down to 1,000. Follow nextPageToken until it disappears. Every later page must repeat the original parameters except countTotal, pageSize and pageToken. A page can come back empty, so loop on the token.
  • Use fields to trim payloads. Results stay nested under protocolSection.
  • Enums are upper case (RECRUITING, PHASE2, NA), and dates can be partial, such as 2027-03.
  • NLM scheduled the classic API's retirement for June 2024. Code that still calls /api/query/ gets 404s.

Two gotchas we found in testing

Age filters drop trials with no upper age limit. We searched for recruiting type 2 diabetes trials within 25 miles of Chicago and got 40. Adding AREA[MaximumAge]RANGE[62 years, MAX] for a 62-year-old cut that to 14. Of the 26 trials that dropped out, 24 list no maximum age, which means no upper limit, and the range filter treats a missing value as a non-match. Adding OR AREA[MaximumAge]MISSING brings them back.

Site coordinates are city-level. In that same result set, 33 Chicago site records spread across 19 different facilities all carried the same geoPoint, 41.85003, -87.65005. The ClinicalTrials.gov API page notes that since August 26, 2025, locations and geopoint data come from a different database for geographic data. Treat the geo filter and any distance you compute as city-to-city estimates, and geocode the facility address yourself if the last few miles matter. The locations array lists every site, recruiting or not: 1,896 of the 4,932 site records in that result set were not recruiting, so check each site's own status.

This script applies both fixes. It finds recruiting trials for a patient's condition, age and location, follows pagination, retries on 429 and 5xx responses, and reports the nearest recruiting site. It uses only the standard library.

import json
import math
import time
import urllib.error
import urllib.parse
import urllib.request

BASE = "https://clinicaltrials.gov/api/v2/studies"
FIELDS = ("NCTId|BriefTitle|OverallStatus|Phase|LeadSponsorName|MinimumAge|"
          "MaximumAge|LocationFacility|LocationCity|LocationStatus|LocationGeoPoint")


def get_json(params, retries=5):
    url = BASE + "?" + urllib.parse.urlencode(params)
    for attempt in range(retries):
        try:
            with urllib.request.urlopen(url, timeout=60) as resp:
                return json.load(resp)
        except urllib.error.HTTPError as err:
            if err.code not in (429, 500, 502, 503, 504) or attempt == retries - 1:
                raise
            wait = err.headers.get("Retry-After")
            time.sleep(float(wait) if wait and wait.isdigit() else 2 ** attempt)


def miles(lat1, lon1, lat2, lon2):
    p1, p2 = math.radians(lat1), math.radians(lat2)
    dp, dl = p2 - p1, math.radians(lon2 - lon1)
    a = math.sin(dp / 2) ** 2 + math.cos(p1) * math.cos(p2) * math.sin(dl / 2) ** 2
    return 3958.8 * 2 * math.asin(math.sqrt(a))


def find_trials(condition, age, lat, lon, radius_mi=25, max_pages=5):
    # A trial with no MaximumAge has no upper limit, so it must stay in.
    age_filter = (f"AREA[MinimumAge]RANGE[MIN, {age} years] AND "
                  f"(AREA[MaximumAge]RANGE[{age} years, MAX] OR AREA[MaximumAge]MISSING)")
    params = {
        "query.cond": condition,
        "filter.overallStatus": "RECRUITING",
        "filter.geo": f"distance({lat},{lon},{radius_mi}mi)",
        "filter.advanced": age_filter,
        "fields": FIELDS,
        "pageSize": 100,
        "countTotal": "true",
    }
    for _ in range(max_pages):
        page = get_json(params)
        for study in page.get("studies", []):
            yield flatten(study, lat, lon)
        token = page.get("nextPageToken")
        if not token:
            break
        params["pageToken"] = token  # every other parameter must stay the same


def flatten(study, lat, lon):
    ps = study.get("protocolSection", {})
    sites = []
    for loc in ps.get("contactsLocationsModule", {}).get("locations", []):
        geo = loc.get("geoPoint")
        if geo and loc.get("status") == "RECRUITING":
            sites.append((miles(lat, lon, geo["lat"], geo["lon"]), loc.get("facility"), loc.get("city")))
    # key= stops tied distances from falling through to facility names, which can be None
    nearest = min(sites, key=lambda s: s[0]) if sites else None
    return {
        "nct_id": ps.get("identificationModule", {}).get("nctId"),
        "title": ps.get("identificationModule", {}).get("briefTitle"),
        "phases": ps.get("designModule", {}).get("phases", []),
        "sponsor": ps.get("sponsorCollaboratorsModule", {}).get("leadSponsor", {}).get("name"),
        "nearest_site": nearest[1] if nearest else None,
        "nearest_city": nearest[2] if nearest else None,
        "miles": round(nearest[0], 1) if nearest else None,
    }


if __name__ == "__main__":
    rows = list(find_trials("type 2 diabetes", age=62, lat=41.8781, lon=-87.6298))
    rows.sort(key=lambda r: (r["miles"] is None, r["miles"] or 0))
    for r in rows[:10]:
        print(r["nct_id"], r["miles"], r["nearest_site"], "|", r["title"][:70])
    print(len(rows), "recruiting trials")

Against the November 4, 2026 snapshot it returned 37 trials for a 62-year-old, compared with 14 under the naive age filter. Every site in the top ten reported the same distance, 2.2 miles, which is the city-level coordinate problem showing up in the output.

Tracking a sponsor's pipeline with change detection

Competitive intelligence teams rarely need a full search. They need what changed since the last run, and two features make that cheap. First, filter.advanced accepts a date range on LastUpdatePostDate. In the November 4 snapshot, 72 records matching Eli Lilly as lead sponsor had been updated on or after October 28, 2026. Second, /api/v2/version returns a dataTimestamp for the last data refresh, which read 2026-11-04T10:00:04 for that snapshot. ClinicalTrials.gov refreshes Monday through Friday, generally by 9 a.m. ET, and its API page tells developers to check dataTimestamp to confirm a refresh has finished, so schedule the job after 9 a.m. ET or retry until the stamp changes. If the timestamp has not moved since your last run, there is nothing new to fetch.

The script below pulls the updated records, compares status, phase, primary completion date and the has-results flag against the last snapshot, and prints the differences. Run it daily from a scheduler. A second run against an unchanged registry returns nothing and costs one request.

import json
import pathlib
import urllib.parse
import urllib.request

API = "https://clinicaltrials.gov/api/v2"
STATE = pathlib.Path("pipeline_state.json")
FIELDS = "NCTId|BriefTitle|OverallStatus|Phase|PrimaryCompletionDate|HasResults|LastUpdatePostDate"


def fetch(path, params=None):
    url = API + path + ("?" + urllib.parse.urlencode(params) if params else "")
    with urllib.request.urlopen(url, timeout=60) as resp:
        return json.load(resp)


def snapshot(sponsor, since):
    params = {
        "query.lead": sponsor,
        "filter.advanced": f"AREA[LastUpdatePostDate]RANGE[{since}, MAX]",
        "fields": FIELDS,
        "pageSize": 1000,
    }
    out = {}
    while True:
        page = fetch("/studies", params)
        for s in page.get("studies", []):
            ps = s["protocolSection"]
            out[ps["identificationModule"]["nctId"]] = {
                "title": ps["identificationModule"].get("briefTitle"),
                "status": ps["statusModule"].get("overallStatus"),
                "phases": ps.get("designModule", {}).get("phases", []),
                "primary_completion": ps["statusModule"].get("primaryCompletionDateStruct", {}).get("date"),
                "has_results": s.get("hasResults", False),
            }
        if not page.get("nextPageToken"):
            return out
        params["pageToken"] = page["nextPageToken"]


def diff(old, new):
    events = []
    for nct, cur in new.items():
        prev = old.get(nct)
        if prev is None:
            events.append((nct, "new or newly updated", cur["status"]))
            continue
        for key in ("status", "phases", "primary_completion", "has_results"):
            if prev.get(key) != cur.get(key):
                events.append((nct, key, f"{prev.get(key)} -> {cur.get(key)}"))
    return events


def run(sponsor, since):
    state = json.loads(STATE.read_text()) if STATE.exists() else {}
    stamp = fetch("/version")["dataTimestamp"]
    if state.get("data_timestamp") == stamp:
        return []  # registry has not refreshed since the last run
    new = snapshot(sponsor, since)
    events = diff(state.get("studies", {}), new)
    merged = {**state.get("studies", {}), **new}
    STATE.write_text(json.dumps({"data_timestamp": stamp, "studies": merged}))
    return events


if __name__ == "__main__":
    for event in run("Eli Lilly", "2026-10-28"):
        print(*event)

For the first baseline, do not page the whole registry through the search endpoint. At the 17 KB average study size that /api/v2/stats/size reports, 610,285 studies come to about 10.6 GB of JSON. Trim the payload with fields, or load AACT instead, which refreshes the full registry daily and offers full snapshots and SQL access. An incremental query cannot see records the registry removed, so run a full reconciliation monthly.

Eligibility is free text, so treat matching as triage

The structured eligibility fields cover little beyond age, sex and healthy volunteers. Everything else, from prior therapies to lab thresholds and comorbidities, lives in the EligibilityCriteria field as Markdown inclusion and exclusion lists. That leaves three workable patterns:

  1. Apply structured filters first (status, location, age with the missing-value fix, sex). In our example, that took 879 recruiting type 2 diabetes trials worldwide down to 37.
  2. Use a language model to pull out the criteria that commonly exclude people, and show the source sentence next to every flag so a coordinator can check it.
  3. For oncology, match against the NCI API's diseases and biomarkers vocabularies rather than raw strings, so that synonyms for the same mutation or tumor type resolve to one term.

Present the output as a shortlist to discuss with a clinician, never as a determination. The registries say the same thing. WHO's terms state that ICTRP information should not be used in clinical care without consulting a physician or licensed health professional.

Where registries stop, and where You.com fits

Registries are slow to report results by design. Under the FDAAA final rule, results are generally due no later than one year after the primary completion date. Sponsors that certify they are seeking FDA approval, licensure or clearance can delay results by up to three years after that date. Topline readouts, conference presentations, publications and regulatory decisions often show up on the open web before the registry catches up. A status change can also arrive with a terse reason or none, because whyStopped is free text and is sometimes empty.

That second layer is a web retrieval problem, and it is where You.com fits. You.com is not a trial registry. It cannot list every recruiting trial for a condition, and you should not use it for that. Use ClinicalTrials.gov to decide which trials matter. Then use the Research API to answer "what has been reported about this trial?" with numbered citations you can check. Its source_control setting (in beta) takes an allowlist of up to 500 domains and a freshness window, so you can keep answers on regulators, journals and the sponsor's own site. For daily news monitoring at lower cost, the Web Search API takes the same domain and freshness controls.

import json
import os
import sys
import urllib.request

CTGOV = "https://clinicaltrials.gov/api/v2/studies/"
RESEARCH = "https://api.you.com/v1/research"
# The docs do not say whether a domain also matches its subdomains, so name the hosts you rely on
SOURCES = ["clinicaltrials.gov", "fda.gov", "ema.europa.eu", "nejm.org",
           "thelancet.com", "jamanetwork.com", "nih.gov",
           "pubmed.ncbi.nlm.nih.gov"]


def registry_record(nct_id):
    url = CTGOV + nct_id + "?fields=NCTId|BriefTitle|OverallStatus|Phase|LeadSponsorName|PrimaryCompletionDate"
    with urllib.request.urlopen(url, timeout=60) as resp:
        ps = json.load(resp)["protocolSection"]
    return {
        "nct_id": nct_id,
        "title": ps["identificationModule"]["briefTitle"],
        "status": ps["statusModule"]["overallStatus"],
        "sponsor": ps["sponsorCollaboratorsModule"]["leadSponsor"]["name"],
        "primary_completion": ps["statusModule"].get("primaryCompletionDateStruct", {}).get("date"),
    }


def research(record, sponsor_domain=None):
    question = (
        f"What has been publicly reported about {record['nct_id']} ({record['title']}), "
        f"sponsored by {record['sponsor']}? Registry status is {record['status']}, primary "
        f"completion {record['primary_completion']}. Cover topline results, presentations, "
        f"publications and regulatory actions, with dates. Say plainly if nothing is reported."
    )
    domains = SOURCES + ([sponsor_domain] if sponsor_domain else [])
    body = json.dumps({
        "input": question,
        "research_effort": "standard",
        "source_control": {"include_domains": domains},
    }).encode()
    req = urllib.request.Request(RESEARCH, data=body, method="POST", headers={
        "X-API-Key": os.environ["YDC_API_KEY"],
        "Content-Type": "application/json",
        "User-Agent": "my-app/1.0",
    })
    # "standard" runs take roughly 10 to 30 seconds; give "deep" more than 120
    with urllib.request.urlopen(req, timeout=90) as resp:
        return json.load(resp)["output"]


if __name__ == "__main__":
    rec = registry_record(sys.argv[1])
    out = research(rec, sponsor_domain=sys.argv[2] if len(sys.argv) > 2 else None)
    print(out["content"])
    for i, src in enumerate(out["sources"], 1):
        print(f"[{i}] {src.get('title') or 'Untitled'} {src['url']}")

The registry call above runs live. We tested the Research request offline against a fixture shaped like the documented response, which returns Markdown in output.content and a sources list of URLs, titles and snippets. Keep the User-Agent header: in our tests on November 20, 2026, api.you.com answered Python's default urllib one with a 403 (Cloudflare error 1010). The You.com docs include a fuller biomedical research brief that runs four Research calls in parallel per target: mechanism, clinical evidence, competitive landscape, and regulatory and safety. The same pattern of a narrow domain allowlist plus citations is the approach covered in our guide to a legal research API, and it is why LLM citations matter in regulated work.

What a clinical trial monitoring stack costs

Reading the registries costs nothing: NLM calls the ClinicalTrials.gov API open-access, WHO offers ICTRP downloads at no charge (not for commercial use), CTTI calls AACT free, and anyone can search CTIS. NCI's pages list no price, but the Standard tier caps you at 50,000 requests a month. You pay for the web layer. You.com list prices as of November 2026, from the billing docs:

CallPrice per 1,000Use it for
Web Search API$5.00Daily news check per program, up to 100 results per call
Research API, lite$12Quick triage of whether anything was reported
Research API, standard$50Cited trial brief when the registry diff fires
Research API, deep$100Diligence-grade synthesis across more sources

Here is a worked example for a team tracking 300 competitor programs. A daily news search per program is about 9,000 calls a month, or $45. A weekly standard Research brief per program is about 1,300 calls a month, or $65. That is roughly $110 a month on top of the registry data. Run the Research call only when the change detector fires, and the second line shrinks with the number of programs that actually change. For more on choosing a news layer, see our news API guide.

What to test before you ship

  • Age logic. Pick a condition, count trials with and without your age filter, and confirm that trials with no maximum age survive.
  • Distance. Decide whether city-level coordinates are good enough. If they are not, geocode facility addresses.
  • Pagination. Assert that later pages reuse the first page's parameters, that your loop stops when nextPageToken is absent, and that it survives an empty page.
  • Rate behavior. ClinicalTrials.gov's docs state no numeric limit and its responses carry no rate-limit headers, so use bounded concurrency, back off on 429 and 5xx responses, and honor Retry-After instead of hard-coding a quota. For NCI, budget against your tier.
  • Freshness. Log dataTimestamp with every run so you can show which registry snapshot an answer came from.
  • CTIS drift. Run a daily contract test on the fields you parse, and alert when it fails.
  • Citations. For any Research output, check that every cited URL resolves and sits inside your allowlist, and that "nothing reported" comes back as a valid answer rather than a guess.

Get those right, and a free registry plus a cited web layer covers patient search, pipeline tracking and readout monitoring before you sign any data contract. For the wider category, see what a vertical search index adds when a domain needs its own retrieval rules.

Frequently Asked Questions

Yes. ClinicalTrials.gov API v2 is free and needs no API key or account. You send GET requests to https://clinicaltrials.gov/api/v2/studies and get JSON or CSV back, up to 1,000 studies per page. The NCI Clinical Trials Search API works differently: it needs a registered developer account and an x-api-key header, and its Standard tier allows 1 request per second and 50,000 requests a month.

ClinicalTrials.gov's docs state no numeric rate limit for API v2, and its responses carry no rate-limit headers. Don't hard-code a quota. Use bounded concurrency, back off on 429 and 5xx responses, and honor Retry-After when it is present. Before an incremental run, check the dataTimestamp from /api/v2/version, and skip the run if the registry has not refreshed since your last one.

Pass filter.geo=distance(latitude,longitude,25mi) together with filter.overallStatus=RECRUITING and a condition in query.cond. Then check each site's own status in the locations array, because the array lists every site for the study. Site coordinates are city-level, so distances are rough. In our test, 19 Chicago facilities shared one coordinate. Geocode facility addresses yourself if exact distance matters.

Many trials list a minimum age but no maximum age, which means there is no upper limit. A MaximumAge range filter treats the missing value as a non-match and drops those trials. In a Chicago type 2 diabetes search on the November 4, 2026 snapshot, the naive filter returned 14 trials, while the correct one returned 37. Combine the range with OR AREA[MaximumAge]MISSING so open-ended trials stay in the results.

Not an officially documented one. The EU CTIS public portal runs on a JSON API that has no key, but we found no EMA specification for it, and search is POST-only. Community tools document its endpoints, and EMA's own FAQ for public users describes a Subscribe to Search feed of trials added or updated in the last seven days. ClinicalTrials.gov also registers studies from around the world, and WHO ICTRP downloads pool records from registries in the WHO network.

    Share Article:

  1. LI Test

  2. LI Test

Related resources.

Search 1B+ professional profiles, 100M+ companies with Knowledge Pro

December 2, 2026

Product Updates

Introducing the You.com Extract API: fetch and parse any URL, with 80% higher accuracy on PDFs

November 17, 2026

Product Updates

FDA Approval Monitoring API: Sources, Lag and a Working Pipeline

FDA Approval Monitoring API: Sources, Lag and a Working Pipeline

November 15, 2026

Blog

Equity Research Automation API: What to Automate and How to Check the Numbers

Equity Research Automation API: What to Automate and How to Check the Numbers

November 14, 2026

Blog

Retail Assortment Monitoring API: How to Track What Competitors Add, Drop, and Carry

Retail Assortment Monitoring API: How to Track What Competitors Add, Drop, and Carry

November 13, 2026

Blog