{
  "openapi": "3.0.1",
  "info": {
    "title": "Clinical Trials & FDA API — ClinicalTrials.gov + openFDA",
    "description": "Query ClinicalTrials.gov v2 and openFDA from one Actor. Search 600,000+ registered studies by condition, drug, sponsor, phase, status or location, and get FDA drug and device recalls, labels, NDC entries, approvals, 510(k) clearances and adverse-event reports for the same drug. No API key.",
    "version": "0.1",
    "x-build-id": "U06UkGFBJnLUqZfne"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/insight.solutions~clinical-trials-fda-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-insight.solutions-clinical-trials-fda-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/insight.solutions~clinical-trials-fda-api/runs": {
      "post": {
        "operationId": "runs-sync-insight.solutions-clinical-trials-fda-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/insight.solutions~clinical-trials-fda-api/run-sync": {
      "post": {
        "operationId": "run-sync-insight.solutions-clinical-trials-fda-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "conditions": {
            "title": "Conditions or diseases",
            "type": "array",
            "description": "Search ClinicalTrials.gov by condition — `type 2 diabetes`, `alzheimer`, `breast cancer`. Several entries are OR-ed, and an entry containing a space is quoted for you so `type 2 diabetes` is one phrase rather than three words.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "statuses": {
            "title": "Recruitment status",
            "type": "array",
            "description": "Restrict to these overall statuses. Leave empty for every status. Remember that a status is what the sponsor last told the registry — `statusVerifiedDate` on every row says how recently.",
            "items": {
              "type": "string",
              "enum": [
                "RECRUITING",
                "NOT_YET_RECRUITING",
                "ENROLLING_BY_INVITATION",
                "ACTIVE_NOT_RECRUITING",
                "COMPLETED",
                "SUSPENDED",
                "TERMINATED",
                "WITHDRAWN",
                "AVAILABLE",
                "NO_LONGER_AVAILABLE",
                "TEMPORARILY_NOT_AVAILABLE",
                "APPROVED_FOR_MARKETING",
                "WITHHELD",
                "UNKNOWN"
              ],
              "enumTitles": [
                "Recruiting",
                "Not yet recruiting",
                "Enrolling by invitation",
                "Active, not recruiting",
                "Completed",
                "Suspended",
                "Terminated",
                "Withdrawn",
                "Available (expanded access)",
                "No longer available (expanded access)",
                "Temporarily not available (expanded access)",
                "Approved for marketing (expanded access)",
                "Withheld",
                "Unknown status"
              ]
            },
            "default": []
          },
          "maxTrials": {
            "title": "Maximum trials",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "How many trial rows to return at most. `0` means every trial the filters allow, bounded by the time budget and by your maximum total charge. One request returns 100 trials with every module on them, so a big number is not a slow run.",
            "default": 100
          },
          "trialFields": {
            "title": "Trial detail",
            "enum": [
              "summary",
              "full"
            ],
            "type": "string",
            "description": "`summary` returns the flattened columns. `full` adds a `raw` column holding the study's complete `protocolSection` and `derivedSection` — the same request, just more of the answer kept. It costs no extra HTTP call and no extra charge.",
            "default": "summary"
          },
          "sort": {
            "title": "Sort trials by",
            "enum": [
              "LastUpdatePostDate:desc",
              "StartDate:desc",
              "EnrollmentCount:desc",
              "PrimaryCompletionDate:asc",
              "@relevance"
            ],
            "type": "string",
            "description": "How ClinicalTrials.gov orders the results before the cap is applied.",
            "default": "LastUpdatePostDate:desc"
          },
          "interventions": {
            "title": "Interventions or drugs",
            "type": "array",
            "description": "Search by intervention — a drug, device, procedure or behavioural intervention. `semaglutide` returns the 177 phase-3 studies that name it.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "terms": {
            "title": "Free-text terms",
            "type": "array",
            "description": "Searched across the whole study record. Also accepts raw Essie expressions such as `AREA[Phase]PHASE3` if you already know the registry's query language.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sponsors": {
            "title": "Sponsors or collaborators",
            "type": "array",
            "description": "Matches the lead sponsor **or** any collaborator. `Pfizer` matches 6,083 studies.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "leadSponsors": {
            "title": "Lead sponsors only",
            "type": "array",
            "description": "Matches the lead sponsor only, ignoring collaborators. Use this when \"sponsors\" returns too many studies a company merely helped with.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "nctIds": {
            "title": "NCT identifiers",
            "type": "array",
            "description": "Look up specific studies by registry id, e.g. `NCT04368728`. Each id is read from `/studies/<nctId>`, so an id list ignores the other search fields. An entry that is not `NCT` plus eight digits gets a free diagnostic row instead of a request.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "phases": {
            "title": "Phase",
            "type": "array",
            "description": "Restrict to these phases. A study can be registered in two phases at once — `PHASE2` and `PHASE3` on the same record — so `phases` is a list on the output as well as the input.",
            "items": {
              "type": "string",
              "enum": [
                "EARLY_PHASE1",
                "PHASE1",
                "PHASE2",
                "PHASE3",
                "PHASE4",
                "NA"
              ],
              "enumTitles": [
                "Early phase 1",
                "Phase 1",
                "Phase 2",
                "Phase 3",
                "Phase 4",
                "Not applicable"
              ]
            },
            "default": []
          },
          "studyTypes": {
            "title": "Study type",
            "type": "array",
            "description": "Restrict to interventional, observational or expanded-access studies.",
            "items": {
              "type": "string",
              "enum": [
                "INTERVENTIONAL",
                "OBSERVATIONAL",
                "EXPANDED_ACCESS"
              ],
              "enumTitles": [
                "Interventional",
                "Observational",
                "Expanded access"
              ]
            },
            "default": []
          },
          "locationName": {
            "title": "Location name",
            "type": "string",
            "description": "A place name matched against study sites, e.g. `Boston`, `Texas` or `Germany` (ClinicalTrials.gov `query.locn`). Leave empty to search everywhere. Use \"Location radius\" for a lat/lon circle instead."
          },
          "updatedSince": {
            "title": "Updated since",
            "type": "string",
            "description": "Only studies whose registry record was last updated on or after this date (`YYYY-MM-DD`). The freshest data available is the registry's own `dataTimestamp`, which is on every summary row."
          },
          "fdaEndpoints": {
            "title": "openFDA endpoints",
            "type": "array",
            "description": "Which openFDA datasets to search. Every selected endpoint produces `fda-record` rows in the same table as the trials.",
            "items": {
              "type": "string",
              "enum": [
                "drug/event",
                "drug/label",
                "drug/enforcement",
                "drug/ndc",
                "drug/drugsfda",
                "device/510k",
                "device/pma",
                "device/recall",
                "device/event",
                "device/classification",
                "device/enforcement",
                "food/enforcement",
                "food/event",
                "animalandveterinary/event"
              ],
              "enumTitles": [
                "Drug adverse-event reports (FAERS)",
                "Drug labels (SPL)",
                "Drug recalls (enforcement)",
                "National Drug Code directory",
                "Drug approvals (Drugs@FDA)",
                "Device 510(k) clearances",
                "Device premarket approvals (PMA)",
                "Device recalls",
                "Device adverse-event reports (MAUDE)",
                "Device classifications",
                "Device recalls (enforcement)",
                "Food recalls (enforcement)",
                "Food adverse-event reports (CAERS)",
                "Veterinary adverse-event reports"
              ]
            },
            "default": []
          },
          "drugNames": {
            "title": "Drug names",
            "type": "array",
            "description": "Brand, generic or substance name. Applied to every drug, food and veterinary endpoint; the device endpoints carry no drug names, so selecting one of those with a drug name gets a free `unsupported-filter` row saying so.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "deviceNames": {
            "title": "Device names",
            "type": "array",
            "description": "Trade or generic device name — `pacemaker`, `stent`. Applied to the six device endpoints only.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "fdaSearch": {
            "title": "Raw openFDA search expression",
            "type": "string",
            "description": "For power users: a raw openFDA `search=` expression, AND-ed onto whatever the fields above built. Example: `serious:1 AND patient.patientsex:2`. Note that openFDA answers an unrecognised field name with the same 404 it uses for \"no matches\", so a typo here looks like an empty result."
          },
          "fdaCount": {
            "title": "Count fields (free aggregates)",
            "type": "array",
            "description": "Up to 20 field names to aggregate instead of listing, and at most 20 count requests per run across every endpoint. Each one costs a single request and returns up to 100 free `aggregate` rows — e.g. `patient.reaction.reactionmeddrapt.exact` gives a drug's top reported reactions. Use the `.exact` suffix on any text field, or the API counts individual words rather than whole phrases.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxFdaRecords": {
            "title": "Maximum FDA records per endpoint",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Applied per endpoint, so four endpoints at 100 is 400 rows. `0` fetches none, which is how you get aggregates only. Above 25,000 the run switches to openFDA's cursor paging, because skip-based paging stops there.",
            "default": 100
          },
          "fdaDateFrom": {
            "title": "FDA records dated on or after",
            "type": "string",
            "description": "`YYYY-MM-DD`, applied to each endpoint's own date field — `receivedate` for FAERS, `report_date` for recalls, `decision_date` for 510(k)s, and so on. `device/classification` has no date field at all and gets a free `unsupported-filter` row instead."
          },
          "fdaDateTo": {
            "title": "FDA records dated on or before",
            "type": "string",
            "description": "`YYYY-MM-DD`. The upper end of the FDA date window, applied to each endpoint's own date field, same as **FDA records dated on or after**. Leave it empty for no upper bound. Useful for pinning a quarter on the adverse-event datasets, which lag the present by six weeks or more."
          },
          "fdaFullText": {
            "title": "Keep full label text",
            "type": "boolean",
            "description": "Off by default, every text section is trimmed to 5,000 characters and the raw HTML `*_table` sections are dropped. On, a drug label row keeps everything and can exceed 400 KB. Recall lot lists (`code_info`) and recall actions stay capped either way — one real `device/recall` record carries 5.2 MB of lot numbers in a single string.",
            "default": false
          },
          "fdaRaw": {
            "title": "Include the raw FDA record",
            "type": "boolean",
            "description": "Keep the trimmed openFDA record in the `raw` column. Turn it off for a much smaller dataset when the flattened columns are enough.",
            "default": true
          },
          "openFdaApiKey": {
            "title": "openFDA API key (optional)",
            "type": "string",
            "description": "Optional. A free key from open.fda.gov raises openFDA's limits from 1,000 to 120,000 requests a day and lets pages hold 1,000 records instead of 100. Everything here works without one."
          },
          "location": {
            "title": "Location radius",
            "type": "object",
            "description": "A radius as `{\"lat\": 40.7128, \"lon\": -74.0060, \"radiusMiles\": 50}`. Selects **studies that have at least one site inside it** — the study's own `locations` array is left whole, so a 279-site study still reports all 279 in `locationsCount`. For a place name use \"Location name\" instead."
          },
          "startDateFrom": {
            "title": "Study started on or after",
            "type": "string",
            "description": "`YYYY-MM-DD`. Filters on the study start date the sponsor registered, which may be an estimate."
          },
          "startDateTo": {
            "title": "Study started on or before",
            "type": "string",
            "description": "`YYYY-MM-DD`. The upper end of the study-start window; pair it with **Study started on or after** to pin a period. Leave it empty for no upper bound. Like the lower bound, it filters on the start date the sponsor registered, which may still be an estimate."
          },
          "titles": {
            "title": "Words in the study title",
            "type": "array",
            "description": "Matches the brief and official titles only.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "outcomes": {
            "title": "Words in the outcome measures",
            "type": "array",
            "description": "Matches the primary, secondary and other outcome measures.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeResults": {
            "title": "Include posted results",
            "type": "boolean",
            "description": "Fetch the posted results for studies that have them, adding serious-event, other-event, death and enrolment counts and the study documents. This is the **only** setting that costs an extra HTTP request per study, and it is spent only on studies whose row already says `hasResults: true`.",
            "default": false
          },
          "maxResultFetches": {
            "title": "Maximum result fetches",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Ceiling on those extra requests, so \"include posted results\" on a thousand-trial run cannot become a thousand extra round trips.",
            "default": 25
          },
          "maxLocationsPerTrial": {
            "title": "Maximum locations per trial",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many study sites to keep in the `locations` column. `locationsCount` always reports the real number, whatever the cap.",
            "default": 50
          },
          "includeSummary": {
            "title": "Include free summary rows",
            "type": "boolean",
            "description": "Add one free `summary` row per source: status, phase, sponsor and country breakdowns over the trials this run returned, the registry's `dataTimestamp`, and how many records matched upstream per FDA endpoint.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Maximum concurrency",
            "minimum": 1,
            "maximum": 6,
            "type": "integer",
            "description": "How many sources may be in flight at once. There are only two, so this matters mainly for politeness.",
            "default": 2
          },
          "maxRunSecs": {
            "title": "Time budget (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "When this runs out the run stops fetching, keeps everything already written, adds one free `timeout` row and finishes successfully.",
            "default": 240
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Both APIs answer unproxied, and ClinicalTrials.gov was nine times faster that way in testing. The datacenter proxy is on by default for IP hygiene. **Clear this field for heavy openFDA work without a key** — openFDA counts its keyless quota of 1,000 requests a day per IP address, and a shared datacenter exit is a small pool.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}