# /clinicaltrials/studies/search

`POST /api/clinicaltrials/studies/search`

Price: 10 credits

Search ClinicalTrials.gov clinical studies

## How to use it

Search ClinicalTrials.gov clinical studies. Combine free-text queries (term, condition, intervention, location, title, sponsor, outcome) with structured filters — recruitment status, trial phase, study type, results availability, accepted sex, funder type, specific NCT ids, a geographic radius (geo_latitude/geo_longitude/geo_distance_miles), or a raw advanced expression. Each result is a full study record (same shape as the studies endpoint). Sort by relevance or by date / enrollment fields.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `term` (string, nullable) — Free-text query across all study fields (examples: "covid vaccine", "alzheimer")
- `condition` (string, nullable) — Condition or disease query (examples: "diabetes", "breast cancer")
- `intervention` (string, nullable) — Intervention or treatment query (examples: "metformin", "immunotherapy")
- `location` (string, nullable) — Study location query (city, state, country) (examples: "Boston", "Germany")
- `study_title` (string, nullable) — Query matched against study titles and acronym (examples: "KEYNOTE")
- `sponsor` (string, nullable) — Sponsor or collaborator query (examples: "Pfizer", "National Cancer Institute")
- `outcome` (string, nullable) — Outcome measure query (examples: "overall survival", "mortality")
- `overall_status` (array, nullable) — Restrict to studies with one of these recruitment statuses (one of: "RECRUITING", "NOT_YET_RECRUITING", "ACTIVE_NOT_RECRUITING", "ENROLLING_BY_INVITATION", "COMPLETED", "SUSPENDED", "TERMINATED", "WITHDRAWN", "AVAILABLE", "NO_LONGER_AVAILABLE", "TEMPORARILY_NOT_AVAILABLE", "APPROVED_FOR_MARKETING", "WITHHELD", "UNKNOWN")
- `phase` (array, nullable) — Restrict to studies in one of these trial phases (one of: "0", "1", "2", "3", "4")
- `study_type` (array, nullable) — Restrict to one of these study types (one of: "int", "obs", "exp")
- `results` (string, nullable) — Restrict to studies with or without posted results (one of: "with", "without")
- `sex` (string, nullable) — Restrict to studies accepting this sex (one of: "m", "f")
- `funder_type` (array, nullable) — Restrict to studies with one of these funder types (one of: "nih", "fed", "industry", "other_gov", "indiv", "network", "other", "unknown")
- `nct_ids` (array, nullable) — Restrict to these specific NCT ids (examples: ["NCT00841061","NCT00935818"])
- `geo_latitude` (number, nullable) — Latitude for geographic radius filter (requires geo_longitude) (min: -90; max: 90)
- `geo_longitude` (number, nullable) — Longitude for geographic radius filter (requires geo_latitude) (min: -180; max: 180)
- `geo_distance_miles` (number, nullable) — Search radius in miles around the geo point (default: 50; >: 0)
- `advanced` (string, nullable) — Advanced Essie expression for fine-grained filtering (examples: "AREA[Phase]PHASE3", "AREA[MinimumAge]RANGE[MIN, 18 years]")
- `sort` (string) — Field to sort results by (default: "@relevance"; one of: "@relevance", "LastUpdatePostDate", "StudyFirstPostDate", "EnrollmentCount", "StartDate", "CompletionDate", "PrimaryCompletionDate", "NumArmGroups")
- `order` (string) — Sort direction (ignored for relevance sort) (default: "desc"; one of: "asc", "desc")
- `count` (integer, required) — Number of studies to return (min: 1)

## Response

### 200 — Successful Response

- `@type` (string) (default: "ClinicaltrialsStudy")
- `id` (string, required)
- `org_study_id` (string, nullable)
- `secondary_ids` (array) (default: [])
  - `@type` (string) (default: "ClinicaltrialsSecondaryId")
  - `id` (string, required)
  - `type` (string, nullable)
  - `domain` (string, nullable)
- `brief_title` (string, nullable)
- `official_title` (string, nullable)
- `acronym` (string, nullable)
- `organization` (string, nullable)
- `organization_class` (string, nullable)
- `overall_status` (string, nullable)
- `last_known_status` (string, nullable)
- `status_verified_date` (string, nullable)
- `why_stopped` (string, nullable)
- `start_date` (string, nullable)
- `primary_completion_date` (string, nullable)
- `completion_date` (string, nullable)
- `study_first_post_date` (string, nullable)
- `last_update_post_date` (string, nullable)
- `results_first_post_date` (string, nullable)
- `has_expanded_access` (boolean, nullable)
- `lead_sponsor` (object, nullable)
  - `@type` (string) (default: "ClinicaltrialsSponsor")
  - `name` (string, required)
  - `sponsor_class` (string, nullable)
- `collaborators` (array) (default: [])
  - `@type` (string) (default: "ClinicaltrialsSponsor")
  - `name` (string, required)
  - `sponsor_class` (string, nullable)
- `responsible_party_type` (string, nullable)
- `responsible_party_name` (string, nullable)
- `responsible_party_title` (string, nullable)
- `responsible_party_affiliation` (string, nullable)
- `oversight_has_dmc` (boolean, nullable)
- `is_fda_regulated_drug` (boolean, nullable)
- `is_fda_regulated_device` (boolean, nullable)
- `is_us_export` (boolean, nullable)
- `brief_summary` (string, nullable)
- `detailed_description` (string, nullable)
- `conditions` (array) (default: [])
- `keywords` (array) (default: [])
- `study_type` (string, nullable)
- `is_patient_registry` (boolean, nullable)
- `phases` (array) (default: [])
- `allocation` (string, nullable)
- `intervention_model` (string, nullable)
- `intervention_model_description` (string, nullable)
- `primary_purpose` (string, nullable)
- `masking` (string, nullable)
- `observational_model` (string, nullable)
- `time_perspective` (string, nullable)
- `bio_spec_retention` (string, nullable)
- `bio_spec_description` (string, nullable)
- `enrollment_count` (integer, nullable)
- `enrollment_type` (string, nullable)
- `arm_groups` (array) (default: [])
  - `@type` (string) (default: "ClinicaltrialsArmGroup")
  - `label` (string, required)
  - `type` (string, nullable)
  - `description` (string, nullable)
  - `intervention_names` (array) (default: [])
- `interventions` (array) (default: [])
  - `@type` (string) (default: "ClinicaltrialsIntervention")
  - `type` (string, nullable)
  - `name` (string, required)
  - `description` (string, nullable)
  - `arm_group_labels` (array) (default: [])
  - `other_names` (array) (default: [])
- `primary_outcomes` (array) (default: [])
  - `@type` (string) (default: "ClinicaltrialsOutcome")
  - `measure` (string, required)
  - `description` (string, nullable)
  - `time_frame` (string, nullable)
- `secondary_outcomes` (array) (default: [])
  - `@type` (string) (default: "ClinicaltrialsOutcome")
  - `measure` (string, required)
  - `description` (string, nullable)
  - `time_frame` (string, nullable)
- `eligibility_criteria` (string, nullable)
- `healthy_volunteers` (boolean, nullable)
- `sex` (string, nullable)
- `is_gender_based` (boolean, nullable)
- `gender_description` (string, nullable)
- `minimum_age` (string, nullable)
- `maximum_age` (string, nullable)
- `std_ages` (array) (default: [])
- `study_population` (string, nullable)
- `sampling_method` (string, nullable)
- `central_contacts` (array) (default: [])
  - `@type` (string) (default: "ClinicaltrialsContact")
  - `name` (string, nullable)
  - `role` (string, nullable)
  - `phone` (string, nullable)
  - `email` (string, nullable)
  - `affiliation` (string, nullable)
- `overall_officials` (array) (default: [])
  - `@type` (string) (default: "ClinicaltrialsContact")
  - `name` (string, nullable)
  - `role` (string, nullable)
  - `phone` (string, nullable)
  - `email` (string, nullable)
  - `affiliation` (string, nullable)
- `locations` (array) (default: [])
  - `@type` (string) (default: "ClinicaltrialsLocation")
  - `facility` (string, nullable)
  - `status` (string, nullable)
  - `city` (string, nullable)
  - `state` (string, nullable)
  - `zip` (string, nullable)
  - `country` (string, nullable)
  - `lat` (number, nullable)
  - `lon` (number, nullable)
  - `contacts` (array) (default: [])
    - `@type` (string) (default: "ClinicaltrialsContact")
    - `name` (string, nullable)
    - `role` (string, nullable)
    - `phone` (string, nullable)
    - `email` (string, nullable)
    - `affiliation` (string, nullable)
- `references` (array) (default: [])
  - `@type` (string) (default: "ClinicaltrialsReference")
  - `pmid` (string, nullable)
  - `type` (string, nullable)
  - `citation` (string, nullable)
- `condition_meshes` (array) (default: [])
  - `@type` (string) (default: "ClinicaltrialsMeshTerm")
  - `id` (string, required)
  - `term` (string, required)
- `intervention_meshes` (array) (default: [])
  - `@type` (string) (default: "ClinicaltrialsMeshTerm")
  - `id` (string, required)
  - `term` (string, required)
- `ipd_sharing` (string, nullable)
- `ipd_sharing_description` (string, nullable)
- `ipd_sharing_info_types` (array) (default: [])
- `ipd_sharing_time_frame` (string, nullable)
- `ipd_sharing_access_criteria` (string, nullable)
- `ipd_sharing_url` (string, nullable)
- `documents` (array) (default: [])
  - `@type` (string) (default: "ClinicaltrialsDocument")
  - `type_abbrev` (string, nullable)
  - `label` (string, nullable)
  - `date` (string, nullable)
  - `upload_date` (string, nullable)
  - `size` (integer, nullable)
  - `has_protocol` (boolean, nullable)
  - `has_sap` (boolean, nullable)
  - `has_icf` (boolean, nullable)
  - `filename` (string, nullable)
  - `url` (string, nullable)
- `has_results` (boolean) (default: false)
- `results_summary` (object, nullable)
  - `@type` (string) (default: "ClinicaltrialsResultsSummary")
  - `recruitment_details` (string, nullable)
  - `pre_assignment_details` (string, nullable)
  - `population_description` (string, nullable)
  - `outcome_measure_titles` (array) (default: [])
  - `adverse_event_frequency_threshold` (string, nullable)
  - `adverse_event_groups` (array) (default: [])
    - `@type` (string) (default: "ClinicaltrialsAdverseEventGroup")
    - `serious_num_affected` (integer, nullable)
    - `serious_num_at_risk` (integer, nullable)
    - `other_num_affected` (integer, nullable)
    - `other_num_at_risk` (integer, nullable)
  - `point_of_contact` (object, nullable)
    - `@type` (string) (default: "ClinicaltrialsContact")
    - `name` (string, nullable)
    - `role` (string, nullable)
    - `phone` (string, nullable)
    - `email` (string, nullable)
    - `affiliation` (string, nullable)
- `web_url` (string) (default: "")

## Errors

### 422 — Validation Error

The request body did not validate

What to do: Check the fields against this schema. A URN with the wrong prefix is the most common cause.

- `detail` (array)
  - `loc` (array, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (object)

### 408

The request ran past its time limit

What to do: Raise `timeout` in the request body, up to the maximum this endpoint documents. Lowering `count` or turning off the `with_*` flags also helps, because less work finishes sooner.

### 412

The entity was not found, or a precondition failed

What to do: Retrying will not help: either the entity does not exist, or the input points at a different one.

### 429

Too many requests: a rate limit or a usage window is exhausted

What to do: When the response carries an X-Retry-After header, wait that many seconds and retry: the same number is in the body as `detail.retry_after`, and the limit clears once that window passes. The message in the body names the limit that was hit.

### 500

Something broke on our side

What to do: Retrying will not help. If it keeps happening, send us the X-Request-ID from the response headers.

### 529

Rate limit reached, or the endpoint is overloaded

What to do: Wait at least 30 seconds, then retry.

## Response envelope

Success: Array of objects (may be empty if no results)

Error: Error may coexist with partial results if it occurs mid-execution. Check X-Error header and status code.

Every response carries these headers:

- `X-Error` — Error message text (present only on error)
- `X-Request-ID` — Unique request identifier
- `X-Execution-Time` — Execution time in seconds
- `X-Result-Count` — How many records the body carries. 0 means an empty result, which is a normal answer and not by itself an error. A non-zero count can come back together with X-Error when the failure happened partway through — read this header and X-Error independently.
- `X-Total-Available-Results` — How many records exist for this query, when the endpoint can say. On a `dry_run` request this is the answer and the body is empty. It saturates: the endpoint's documented maximum means 'at least that many', any smaller number is exact.
- `X-Warning` — Present when the request body carried keys this endpoint does not document. They were ignored, so any filter you meant to apply through them did not apply. Check the spelling against this schema and retry.
- `X-Retry-After` — Seconds to wait before retrying. Present only on 429.

