ClinicalTrials Study Search¶
Queries the ClinicalTrials.gov v2 /studies endpoint to find clinical studies matching a condition or disease and optional filters. Returns either a JSON-formatted list of studies with summary metadata or raw CSV content depending on the selected format. Supports fine-grained query parameters such as location, interventions, sponsors, status filters, and sorting.

Usage¶
Use this node to search for clinical trials by condition (e.g., "lung cancer") and refine results with additional terms, location filters, sponsors, and study status. Choose JSON when you need a structured list of studies for downstream processing, or CSV for spreadsheet-like output. Typically used early in a workflow to collect study candidates before fetching details or performing analytics.
Inputs¶
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
| condition_or_disease | True | STRING | Primary search term for the condition or disease. Sets query.cond. | lung cancer |
| format | True | STRING | Output format. JSON returns a structured studies list; CSV returns raw text content. | json |
| fields | False | STRING | Comma-separated list of fields to include in the response (when supported by the API). | protocolSection.identificationModule.briefTitle,hasResults |
| sort | False | STRING | Sort order for results. Passed as sort (e.g., @relevance). | @relevance |
| count_total | False | BOOLEAN | If true, includes countTotal=true to request total count metadata. | true |
| other_terms | False | STRING | Additional free-text terms. Sets query.term. | phase 3 randomized |
| location_terms | False | STRING | Location-related search terms (country, city, etc.). Sets query.locn. | United States; California |
| title_acronym | False | STRING | Search in study titles/acronyms. Sets query.titles. | KEYNOTE |
| intervention_treatment | False | STRING | Filter by intervention or treatment. Sets query.incr. | Pembrolizumab |
| outcome_measures | False | STRING | Filter by outcome measures. Sets query.outc. | overall survival |
| sponsor_collaborator | False | STRING | Sponsor or collaborator name search. Sets query.spons. | National Cancer Institute (NCI) |
| lead_sponsor_name | False | STRING | Lead sponsor name. Sets query.lead. | Merck Sharp & Dohme LLC |
| study_ids | False | STRING | Search by one or more study IDs (e.g., NCT IDs). Sets query.id. | NCT04000165,NCT05012345 |
| patient_search_area | False | STRING | Patient-centric search area terms. Sets query.patient. | Boston, MA |
| filter_overallStatus | False | STRING | Comma-separated overall status filters. Sets filter.overallStatus. | RECRUITING,ACTIVE,NOT RECRUITING |
| filter_ids | False | STRING | Comma-separated list of IDs to filter. Sets filter.ids. | NCT04000165,NCT05012345 |
Outputs¶
| Field | Type | Description | Example |
|---|---|---|---|
| results | STRING | Search results. For JSON format, a prettified JSON array of study objects; for CSV, the raw CSV text. | [{ "protocolSection": { "identificationModule": { "nctId": "NCT04000165" } } }] |
| metadata | STRING | Metadata about the request/response. For JSON format, includes totalStudies, query, apiVersion; for CSV, includes format, content_length, and query. | { "total_studies": 1234, "query": "lung cancer", "api_version": "2.0" } |
Important Notes¶
- Format behavior: With format=json, the node parses and returns the 'studies' array and constructs summary metadata; with CSV, it returns raw text content and basic metadata only.
- Core query: condition_or_disease maps to query.cond; many other inputs map to query. or filter. parameters supported by ClinicalTrials.gov v2.
- Sorting: Default sort is '@relevance'. Override by setting the sort input.
- Counts: Enabling count_total sets countTotal=true; total_studies is populated in JSON mode when the API returns it.
- Fields selection: The fields input is a comma-separated list passed through to the API; ensure requested fields exist in the v2 API.
- Timeouts and errors: The node uses a 30-second timeout and returns error strings on network or JSON parsing failures.
- Status filters: filter_overallStatus accepts comma-separated status values recognized by ClinicalTrials.gov (e.g., RECRUITING, COMPLETED).
Troubleshooting¶
- Empty results: Broaden condition_or_disease or remove restrictive filters (e.g., intervention_treatment, filter_overallStatus).
- Network error: Verify internet connectivity and ClinicalTrials.gov availability; retry. The node returns '{"error": "Network error"}' in both outputs on failure.
- JSON decode error: Ensure format is set to 'json' when expecting parsed JSON. If the API returns malformed JSON, try again later or switch to CSV.
- Unexpected fields missing: Check that your fields list matches valid v2 field paths; remove invalid fields.
- Large responses slow or truncated downstream: Prefer JSON with specific fields to reduce payload size, or add additional filters to narrow results.
- Sort not applied: Confirm sort value syntax (e.g., '@relevance') and that it is supported by the API.