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.

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¶
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
| condition_or_disease | True | STRING | Primary search query for conditions or diseases. Mapped to the ClinicalTrials API parameter query.cond. | diabetes |
| format | True | STRING | Response format. JSON returns a studies array; CSV returns raw CSV text. | json |
| fields | False | STRING | Optional comma-separated list of fields to include in the response. | NCTId,BriefTitle,Condition,OverallStatus |
| sort | False | STRING | Sorting directive passed to the API (e.g., @relevance or field-based sorts). | @relevance |
| count_total | False | BOOLEAN | If true, requests the API to include the total count of matching studies. | true |
| other_terms | False | STRING | Additional free-text search terms. Mapped to query.term. | type 2 |
| location_terms | False | STRING | Location-based search terms (country, city, etc.). Mapped to query.locn. | United States |
| title_acronym | False | STRING | Search in titles or acronyms. Mapped to query.titles. | insulin |
| intervention_treatment | False | STRING | Search by intervention/treatment terms. Mapped to query.incr. | metformin |
| outcome_measures | False | STRING | Search by outcome measure terms. Mapped to query.outc. | HbA1c |
| sponsor_collaborator | False | STRING | Search by sponsor/collaborator names. Mapped to query.spons. | NIH |
| lead_sponsor_name | False | STRING | Search by lead sponsor name. Mapped to query.lead. | University of Example |
| study_ids | False | STRING | Search by study IDs (comma-separated NCT IDs or other IDs). Mapped to query.id. | NCT01234567,NCT07654321 |
| patient_search_area | False | STRING | Patient-centric search area terms. Mapped to query.patient. | Boston, MA |
| filter_overallStatus | False | STRING | Overall status filter as a comma-separated list. Mapped to filter.overallStatus. | RECRUITING,ENROLLING_BY_INVITATION |
| filter_ids | False | STRING | Filter explicitly by IDs (comma-separated). Mapped to filter.ids. | NCT01234567,NCT07654321 |
Outputs¶
| Field | Type | Description | Example |
|---|---|---|---|
| results | STRING | Search results. If format=json, a JSON string containing an array of studies. If format=csv, raw CSV text. | [{ "protocolSection": { ... } }, { ... }] |
| metadata | STRING | Search 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.