ClinicalTrials APIclinicaltrials.gov ↗
Access clinical trial data from ClinicalTrials.gov: search studies by condition or intervention, retrieve full protocols, results, eligibility, metadata, and stats.
What is the ClinicalTrials API?
This API exposes 8 endpoints covering the full ClinicalTrials.gov study registry, from searching trials by condition or intervention to retrieving complete protocol and results data for a single NCT ID. The search_studies endpoint supports filtering by condition, intervention, and trial status with cursor-based pagination, while get_study returns the complete protocol section, eligibility criteria, outcome measures, adverse events, and participant flow for any registered trial.
curl -X GET 'https://api.parse.bot/scraper/5119bcad-b856-44f8-8ee6-bfe31e079b44/search_studies?pageSize=10&query_cond=diabetes&query_intr=aspirin&query_term=heart&filter_overallstatus=RECRUITING' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace clinicaltrials-gov-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
from parse_apis.clinicaltrials_gov_api import ClinicalTrials, StudyStatus, StudyNotFound
client = ClinicalTrials()
# Search for recruiting diabetes trials
for study in client.studies.search(query_cond="diabetes", filter_overallstatus=StudyStatus.RECRUITING, limit=5):
print(study.nct_id, study.brief_title, study.overall_status, study.has_results)
# Get full details for a specific trial
trial = client.studies.get(nct_id="NCT04516746")
print(trial.nct_id, trial.overall_status, trial.has_results)
# Get database statistics
stats = client.sizestatses.get()
print(stats.total_studies, stats.average_size_bytes)
for r in stats.ranges[:3]:
print(r.size_range, r.studies_count)
# Get API version info
version = client.apiversions.get()
print(version.api_version, version.data_timestamp)
# List available enum types
for enum_type in client.enumtypes.list(limit=3):
print(enum_type.type, enum_type.pieces)
for val in enum_type.values:
print(val.value, val.legacy_value)
Search for clinical trials with extensive filtering and cursor-based pagination. Supports condition, intervention, status filters, and general keyword search. Returns paginated results with a nextPageToken for fetching subsequent pages. Each study includes protocolSection (identification, status, description, design, eligibility), derivedSection (condition/intervention browse), and hasResults flag.
| Param | Type | Description |
|---|---|---|
| sort | string | Sort order. Use '@relevance' for relevance-based sorting, or a field name with :asc or :desc suffix (e.g. 'LastUpdatePostDate:desc') |
| fields | string | Comma-separated list of fields to return (e.g. 'NCTId,BriefTitle,OverallStatus') |
| format | string | Response format: 'json' or 'csv' |
| pageSize | integer | Number of results per page (max 1000) |
| pageToken | string | Token for next page of results, obtained from a previous response's nextPageToken |
| query_cond | string | Search by condition or disease (e.g. 'diabetes', 'cancer') |
| query_intr | string | Search by intervention or treatment (e.g. 'aspirin', 'immunotherapy') |
| query_term | string | General search terms across all fields |
| filter_advanced | string | Advanced filter expression using Essie expression syntax (e.g. 'AREA[Phase]PHASE3') |
| filter_overallstatus | string | Filter by study status. Accepted values: RECRUITING, COMPLETED, ACTIVE_NOT_RECRUITING, NOT_YET_RECRUITING, ENROLLING_BY_INVITATION, SUSPENDED, TERMINATED, WITHDRAWN, UNKNOWN. Multiple values pipe-separated (e.g. 'RECRUITING|COMPLETED'). |
{
"type": "object",
"fields": {
"studies": "array of study objects containing protocolSection, derivedSection, and hasResults",
"nextPageToken": "string pagination token for next page, absent on last page"
},
"sample": {
"data": {
"studies": [
{
"hasResults": false,
"derivedSection": {
"miscInfoModule": {
"versionHolder": "2026-06-09"
}
},
"protocolSection": {
"identificationModule": {
"nctId": "NCT04669912",
"briefTitle": "COVID-19 Pandemic Lockdown Effect in Adolescents and Young Adults With Type 1 Diabetes"
}
}
}
],
"nextPageToken": "ZVNj7o2Elu8o3lp0Cty4oarumpOQJJxuZfWp"
},
"status": "success"
}
}About the ClinicalTrials API
Study Search and Retrieval
The search_studies endpoint accepts parameters including query_cond (condition or disease), query_intr (intervention or treatment), query_term (general terms), sort, and pageSize (up to 1000 per page). Results include an array of study objects — each with a protocolSection, derivedSection, and hasResults flag — plus a totalCount and a nextPageToken for cursor-based pagination. For a complete single-study record, get_study takes an NCT ID and returns the full protocolSection (identification, status, sponsor, description, design, outcomes, eligibility, contacts) and, when available, a resultsSection containing participant flow, baseline characteristics, outcome measures, and adverse events.
Bulk Retrieval and Metadata
The list_all_studies endpoint handles multi-page bulk retrieval automatically, accepting a limit and optional fields list, and returning the studies array alongside a total_returned count. For schema exploration, get_studies_metadata returns the full hierarchical field model — every field name, type, source type, title, and nested children — so you can identify exactly which fields to request. get_search_areas maps query parameters to underlying data fields and their weights, useful for understanding how query_cond or query_intr translate to indexed fields.
Enumerations and Database Statistics
get_enums returns all valid values for categorical fields (e.g. trial status, phase, sponsor type), each entry listing the enum type name, accepted values array, and the field names that use it — essential for building validated filter UIs. get_stats_size gives aggregate database statistics: total study count, average record size in bytes, percentile distribution, size ranges with per-range study counts, and the largest studies by NCT ID. get_api_version returns the current API version string and a dataTimestamp ISO timestamp indicating when the underlying data was last refreshed.
The ClinicalTrials API is a managed, monitored endpoint for clinicaltrials.gov — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when clinicaltrials.gov changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official clinicaltrials.gov API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Search open clinical trials for a specific disease using
query_condto surface recruiting studies for patient-matching applications - Pull full eligibility criteria and outcome measures from
get_studyto build structured trial-matching pipelines - Enumerate valid trial phase and status values via
get_enumsto populate validated filter dropdowns in research tools - Bulk export trial records with
list_all_studiesand specifiedfieldsfor offline analysis or database seeding - Monitor database freshness by polling
get_api_versionfordataTimestampchanges before triggering downstream sync jobs - Analyze study size distribution using
get_stats_sizepercentiles andlargestStudiesfor database capacity planning - Explore the data model with
get_studies_metadatato map available fields before constructing targeted field-subset queries
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does ClinicalTrials.gov have an official developer API?+
list_all_studies for automatic pagination.What does `get_study` return for a trial that has posted results?+
hasResults is true, the response includes a resultsSection alongside the standard protocolSection and derivedSection. The resultsSection contains participant flow, baseline characteristics, outcome measures with their data tables, and adverse event summaries. When hasResults is false, resultsSection is absent.How does pagination work across `search_studies` and `list_all_studies`?+
search_studies uses cursor-based pagination: each response includes a nextPageToken string that you pass as the pageToken parameter on the next request. The token is absent on the final page. list_all_studies handles this cursor loop automatically up to the limit you specify, returning a flat studies array and a total_returned count.Can I filter search results by geographic location or trial site country?+
search_studies endpoint exposes query_cond, query_intr, and query_term as text search parameters, along with sort and field selection. Location-based filtering is not a dedicated parameter in the current endpoint set. You can fork the API on Parse and revise it to add location-specific query parameters if your use case requires geographic filtering.