Skip to content

ClinicalTrials Study Search

Queries the ClinicalTrials.gov v2 Studies endpoint and returns study search results along with metadata. Supports rich filtering (e.g., additional terms, location, sponsors, status) and sorting. Outputs either JSON results or raw CSV text depending on the selected format.
Preview

Usage

Use this node to search for clinical studies by condition or disease and refine results using additional query and filter parameters. Typical workflow: provide a primary condition (e.g., "diabetes"), optionally select fields to return and additional filters (e.g., location, sponsor), choose the format (JSON for structured processing or CSV for tabular handling), and connect the results to downstream parsing or display nodes.

Inputs

FieldRequiredTypeDescriptionExample
condition_or_diseaseTrueSTRINGPrimary search query for conditions or diseases. Mapped to the ClinicalTrials API parameter query.cond.diabetes
formatTrueSTRINGResponse format. JSON returns a studies array; CSV returns raw CSV text.json
fieldsFalseSTRINGOptional comma-separated list of fields to include in the response.NCTId,BriefTitle,Condition,OverallStatus
sortFalseSTRINGSorting directive passed to the API (e.g., @relevance or field-based sorts).@relevance
count_totalFalseBOOLEANIf true, requests the API to include the total count of matching studies.true
other_termsFalseSTRINGAdditional free-text search terms. Mapped to query.term.type 2
location_termsFalseSTRINGLocation-based search terms (country, city, etc.). Mapped to query.locn.United States
title_acronymFalseSTRINGSearch in titles or acronyms. Mapped to query.titles.insulin
intervention_treatmentFalseSTRINGSearch by intervention/treatment terms. Mapped to query.incr.metformin
outcome_measuresFalseSTRINGSearch by outcome measure terms. Mapped to query.outc.HbA1c
sponsor_collaboratorFalseSTRINGSearch by sponsor/collaborator names. Mapped to query.spons.NIH
lead_sponsor_nameFalseSTRINGSearch by lead sponsor name. Mapped to query.lead.University of Example
study_idsFalseSTRINGSearch by study IDs (comma-separated NCT IDs or other IDs). Mapped to query.id.NCT01234567,NCT07654321
patient_search_areaFalseSTRINGPatient-centric search area terms. Mapped to query.patient.Boston, MA
filter_overallStatusFalseSTRINGOverall status filter as a comma-separated list. Mapped to filter.overallStatus.RECRUITING,ENROLLING_BY_INVITATION
filter_idsFalseSTRINGFilter explicitly by IDs (comma-separated). Mapped to filter.ids.NCT01234567,NCT07654321

Outputs

FieldTypeDescriptionExample
resultsSTRINGSearch results. If format=json, a JSON string containing an array of studies. If format=csv, raw CSV text.[{ "protocolSection": { ... } }, { ... }]
metadataSTRINGSearch metadata. For JSON: includes total_studies, query, api_version. For CSV: includes format, content_length, query.{ "total_studies": 1234, "query": "diabetes", "api_version": "2.0" }

Important Notes

  • Formats: Supported formats are json and csv. JSON returns a studies array; CSV returns raw text.
  • Fields parameter: Provide a comma-separated list of fields to limit payload size and select specific attributes.
  • Sorting: Default sort is @relevance. Ensure the value conforms to ClinicalTrials.gov sorting rules.
  • Status filter: The default filter_overallStatus is "AVAILABLE,COMPLETED". Adjust to include statuses like RECRUITING as needed.
  • Network behavior: The request uses a 30-second timeout. Network or API errors yield an error JSON string in both outputs.
  • Empty results: Strict filters can yield zero studies; relax filters (e.g., remove location or status limits) if needed.

Troubleshooting

  • No results returned: Broaden the search by removing or loosening filters like location_terms or filter_overallStatus.
  • Unexpected CSV content: Verify the fields selection and that format is set to csv; CSV is returned as raw text.
  • Invalid sort value: Use recognized sort directives (e.g., @relevance). Remove sort to fall back to the default.
  • Large payloads/slow responses: Limit fields and avoid overly broad queries; consider using count_total sparingly.
  • Network error: Check connectivity and try again. The node returns '{"error": "Network error"}' on failures.
  • JSON decode error: Ensure format is set to json when expecting structured JSON; the node returns a JSON error string if parsing fails.