ClinicalTrials.gov Study Scraper
Search ClinicalTrials.gov studies or fetch one exact NCT record through the public ClinicalTrials.gov v2 API, returning normalized trial metadata, status, sponsors, conditions, interventions, phases, enrollment, dates, eligibility, outcomes, and locations.
Overview
ClinicalTrials.gov Study Scraper gives agents a structured route into the official ClinicalTrials.gov v2 API. Search by condition, intervention, sponsor, location, or free-text term, filter by overall status or supported aggregate filters, or fetch a known NCT record directly. The tool normalizes the nested API response into compact trial rows with NCT IDs, study URLs, titles, current status, result availability, conditions, interventions, phases, study type, enrollment, sponsors, important dates, eligibility criteria, outcome measures, countries, and locations. It is designed for clinical-trial monitoring, pharma pipeline research, patient-recruitment discovery, competitive intelligence, medical literature triage, and research-agent workflows that need reliable public trial metadata without scraping the website.
Last validated: Jul 3, 2026
Playground
Input
mode"search" | "study"default: "search"Search ClinicalTrials.gov studies or fetch one exact NCT record.
sort"@relevance" | "LastUpdatePostDate:desc" | "StudyFirstPostDate:desc" | "StartDate:desc" | "EnrollmentCount:desc"default: "@relevance"Sort expression for search mode.
querystringGeneral free-text search across ClinicalTrials.gov study fields.
nct_idstringExact NCT identifier for study mode, e.g. NCT04280705.
statusstringOverall status filter. Use API enum values such as RECRUITING, COMPLETED, ACTIVE_NOT_RECRUITING, NOT_YET_RECRUITING, TERMINATED, or comma-separated values.
sponsorstringSponsor or collaborator query, mapped to query.spons.
locationstringLocation query such as Boston, Massachusetts or United States, mapped to query.locn.
conditionstringDisease or condition query, mapped to query.cond.
page_sizeintegerdefault: 10Maximum studies to return in search mode.
page_tokenstringClinicalTrials.gov nextPageToken from a previous search response.
agg_filtersstringOptional raw ClinicalTrials.gov aggregate filter expression, e.g. phase:3 or studyType:int.
interventionstringDrug, device, procedure, or other intervention query, mapped to query.intr.
include_locationsbooleandefault: trueInclude compact facility/city/country location strings.
include_eligibilitybooleandefault: falseInclude truncated eligibility criteria text when available.
Output
modestringrequiredMode used for this run
countintegerrequiredNumber of returned studies
querystringSearch query summary
nct_idstringExact NCT ID used
studiesobject[]requiredNormalized ClinicalTrials.gov study records
source_urlstringrequiredClinicalTrials.gov API URL fetched
total_matchesintegerTotal matches reported by ClinicalTrials.gov when requested
next_page_tokenstringToken for the next search page
Examples
recruiting-diabetes
{
"mode": "search",
"status": "RECRUITING",
"condition": "diabetes",
"page_size": 2
}actt-study
{
"mode": "study",
"nct_id": "NCT04280705",
"include_eligibility": true
}Use cases
FAQ
Does ClinicalTrials.gov Study Scraper require an API key?
No. Version 0.1 uses the public ClinicalTrials.gov v2 API and keeps each run to one bounded request. Large exports should page through results politely with the returned next_page_token.
Can it filter by clinical-trial phase?
Yes, through the agg_filters input using ClinicalTrials.gov aggregate filter syntax, for example phase:3. The normalized output always includes the phase labels reported by each returned study.
Is this tool affiliated with ClinicalTrials.gov or NIH?
No. This Better Fetch tool uses public ClinicalTrials.gov API data and is not endorsed by or affiliated with ClinicalTrials.gov, NIH, NLM, or the U.S. government.
Use it anywhere
MCP (Claude, Cursor, any client)
# Add the Better Fetch MCP connector (or paste the URL into # Claude → Settings → Connectors → Add custom connector): claude mcp add --transport http better-fetch https://betterfetch.co/api/mcp \ --header "Authorization: Bearer bf_your_key_here" # Then ask for the tool by name: clinicaltrials_study_scraper
REST
curl -sS -X POST "https://betterfetch.co/api/tools/clinicaltrials_study_scraper/run" \
-H "Authorization: Bearer bf_your_key_here" \
-H "Content-Type: application/json" \
-d '{"input": {"mode":"search","status":"RECRUITING","condition":"diabetes","page_size":2}}'Run locally
git clone https://github.com/better-fetch/tools/tree/main/tools/clinicaltrials-study-scraper && cd clinicaltrials-study-scraper && npm i
BETTER_FETCH_API_KEY=bf_your_key_here npx bf-tool run --input '{"mode":"search","status":"RECRUITING","condition":"diabetes","page_size":2}'