ClinicalTrials Study Search¶
Searches ClinicalTrials.gov (API v2) for studies matching a condition/disease and optional filters. Returns either a JSON-formatted list of studies plus metadata, or raw CSV content with basic metadata. Supports additional query terms (e.g., location, title, sponsor) and filters (e.g., overall status, IDs) with sorting and an option to request total counts.

Usage¶
Use this node to retrieve clinical trial studies for a given condition or disease, optionally refining results by location, title/acronym, interventions, outcomes, sponsors, study IDs, or overall status. Typical workflow: provide a condition (e.g., 'diabetes'), choose output format (JSON recommended), optionally specify fields to include, add filters and sorting, then pass results to downstream nodes for parsing, display, or analysis.
Inputs¶
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
| condition_or_disease | True | STRING | Primary search query for conditions or diseases. Mapped to query.cond. | type 2 diabetes |
| format | True | STRING | Response format. JSON returns structured results; CSV returns raw text. | json |
| fields | False | STRING | Comma-separated list of fields to include in the response. Applied when supported by the API. | protocolSection.identificationModule.briefTitle,protocolSection.statusModule.overallStatus |
| sort | False | STRING | Sort order for results. Defaults to relevance. | @relevance |
| count_total | False | BOOLEAN | If true, requests total count of studies (API parameter countTotal=true). | true |
| other_terms | False | STRING | Additional keyword terms. Mapped to query.term. | pediatric OR adolescent |
| location_terms | False | STRING | Location-based query terms. Mapped to query.locn. | United States, California |
| title_acronym | False | STRING | Match text in study titles or acronyms. Mapped to query.titles. | metformin |
| intervention_treatment | False | STRING | Intervention/treatment terms. Mapped to query.incr. | insulin |
| outcome_measures | False | STRING | Outcome measures terms. Mapped to query.outc. | HbA1c |
| sponsor_collaborator | False | STRING | Sponsor or collaborator terms. Mapped to query.spons. | National Institutes of Health |
| lead_sponsor_name | False | STRING | Lead sponsor name. Mapped to query.lead. | Pfizer |
| study_ids | False | STRING | Study identifiers (e.g., NCT IDs). Mapped to query.id. | NCT01234567,NCT08976543 |
| patient_search_area | False | STRING | Patient-centered search area terms. Mapped to query.patient. | Boston, MA |
| filter_overallStatus | False | STRING | Filter by overall status (comma-separated). Mapped to filter.overallStatus. | RECRUITING,ACTIVE,NOT_YET_RECRUITING |
| filter_ids | False | STRING | Filter by IDs (comma-separated). Mapped to filter.ids. | NCT01234567,NCT07654321 |
Outputs¶
| Field | Type | Description | Example |
|---|---|---|---|
| results | STRING | If format=json: JSON string of the 'studies' array. If format=csv: raw CSV text. | [{ "protocolSection": { ... } }, { ... }] |
| metadata | STRING | If format=json: JSON string containing total_studies, query, api_version. If format=csv: JSON string with format, content_length, and query. | {"total_studies": 124, "query": "type 2 diabetes", "api_version": "2.0"} |
Important Notes¶
- Fields must be provided as a comma-separated list; unknown fields may be ignored by the API.
- Default sort is @relevance; use API-supported sort strings for other orderings.
- JSON format is recommended for structured downstream processing; CSV returns raw text.
- When count_total is true, total count is included in JSON metadata where supported by the API.
- This node queries ClinicalTrials.gov API v2 at the /studies endpoint with a 30-second timeout.
- Error responses are returned as JSON strings in both outputs with an 'error' key.
Troubleshooting¶
- Network error: Ensure internet connectivity and that ClinicalTrials.gov is reachable; try again or reduce request size.
- JSON decode error: Use format=json only when the endpoint returns valid JSON; otherwise switch to CSV.
- Empty results: Check the condition_or_disease and filters; broaden search terms or remove restrictive filters.
- Invalid filters/sort: Verify values for filter_overallStatus, filter_ids, and sort match API expectations.
- Large response/timeout: Narrow the search or specify fields to reduce payload size; try again later.