{
  "openapi": "3.0.1",
  "info": {
    "title": "FDA Drug Safety & Clinical Trials Scraper ($3/1K)",
    "description": "FDA and ClinicalTrials.gov scraper: trials with sponsor, phase, status, enrollment, eligibility, sites; FDA drug labels, FAERS adverse events, recalls and label interaction checks. Takes drug names, conditions, filters, NCT IDs or a search URL. Use it to track pharma pipelines and drug safety.",
    "version": "1.0",
    "x-build-id": "UgeoS6EY8nXaT0t27"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tamnt67~fda-clinical-trials-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tamnt67-fda-clinical-trials-scraper",
        "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/tamnt67~fda-clinical-trials-scraper/runs": {
      "post": {
        "operationId": "runs-sync-tamnt67-fda-clinical-trials-scraper",
        "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/tamnt67~fda-clinical-trials-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-tamnt67-fda-clinical-trials-scraper",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Extraction Mode",
            "enum": [
              "drug_safety_brief",
              "drug_interactions",
              "drug_label",
              "adverse_events",
              "recalls",
              "trials_search",
              "trials_recent_changes",
              "trials_stats",
              "trial_detail"
            ],
            "type": "string",
            "description": "Select which FDA or ClinicalTrials.gov dataset to extract.",
            "default": "drug_safety_brief"
          },
          "drugs": {
            "title": "Drug Names (Brand or Generic)",
            "type": "array",
            "description": "One or more drug names, brand or generic (e.g. ozempic, semaglutide, metformin, warfarin). Used in the drug modes; drug_interactions needs 2-5. Empty: ozempic.",
            "items": {
              "type": "string"
            }
          },
          "condition": {
            "title": "Medical Condition (Clinical Trials)",
            "type": "string",
            "description": "Disease or medical condition for ClinicalTrials.gov modes (e.g. obesity, lung cancer, diabetes)."
          },
          "intervention": {
            "title": "Intervention / Drug (Clinical Trials)",
            "type": "string",
            "description": "Optional drug or therapy intervention filter for ClinicalTrials.gov modes (e.g. semaglutide)."
          },
          "sponsor": {
            "title": "Lead Sponsor (Clinical Trials)",
            "type": "string",
            "description": "Optional sponsor or collaborator filter (e.g. Novo Nordisk, Pfizer, Eli Lilly). Turn on \"Lead sponsor only\" to match only the lead sponsor."
          },
          "searchUrl": {
            "title": "ClinicalTrials.gov search URL",
            "type": "string",
            "description": "Optional. Paste a search URL from clinicaltrials.gov/search (e.g. https://clinicaltrials.gov/search?cond=obesity&aggFilters=phase:3,status:rec) for trials_search, trials_recent_changes and trials_stats. Its condition, terms, intervention, location, sponsor and filters are used; the fields below are added on top."
          },
          "otherTerms": {
            "title": "Other terms (Clinical Trials)",
            "type": "string",
            "description": "Optional free-text search across the whole study record (e.g. GLP-1, CAR-T, wearable)."
          },
          "location": {
            "title": "Location (Clinical Trials)",
            "type": "string",
            "description": "Optional country, state or city where the study has a site (e.g. United States, Texas, Boston)."
          },
          "titleSearch": {
            "title": "Title or acronym contains",
            "type": "string",
            "description": "Optional search in study titles and acronyms only (e.g. SURMOUNT)."
          },
          "outcomeSearch": {
            "title": "Outcome measure contains",
            "type": "string",
            "description": "Optional search in primary and secondary outcome measures (e.g. HbA1c, overall survival)."
          },
          "leadSponsorOnly": {
            "title": "Lead sponsor only",
            "type": "boolean",
            "description": "On: the Sponsor field matches only the lead sponsor. Off: lead sponsor or collaborator (as before).",
            "default": false
          },
          "nctIds": {
            "title": "Clinical Trial NCT IDs",
            "type": "array",
            "description": "One or more ClinicalTrials.gov NCT IDs (e.g. NCT04881760) for trial_detail mode. Empty: NCT04881760.",
            "items": {
              "type": "string"
            }
          },
          "trialStatus": {
            "title": "Trial Recruitment Status",
            "enum": [
              "RECRUITING",
              "NOT_YET_RECRUITING",
              "ACTIVE_NOT_RECRUITING",
              "COMPLETED",
              "TERMINATED",
              "ALL",
              "ENROLLING_BY_INVITATION",
              "SUSPENDED",
              "WITHDRAWN",
              "UNKNOWN"
            ],
            "type": "string",
            "description": "Filter clinical trials by overall recruitment status. ALL: no status filter. Ignored when a Search URL is given (the URL's own filters are used).",
            "default": "RECRUITING"
          },
          "trialPhase": {
            "title": "Trial Phase",
            "enum": [
              "",
              "EARLY_PHASE1",
              "PHASE1",
              "PHASE2",
              "PHASE3",
              "PHASE4"
            ],
            "type": "string",
            "description": "Optional clinical trial phase filter. Empty: all phases.",
            "default": ""
          },
          "studyType": {
            "title": "Study type",
            "enum": [
              "",
              "INTERVENTIONAL",
              "OBSERVATIONAL",
              "EXPANDED_ACCESS"
            ],
            "type": "string",
            "description": "Optional study type filter.",
            "default": ""
          },
          "sex": {
            "title": "Participant sex",
            "enum": [
              "",
              "FEMALE",
              "MALE"
            ],
            "type": "string",
            "description": "Optional filter by the sex of eligible participants.",
            "default": ""
          },
          "ageGroup": {
            "title": "Age group",
            "enum": [
              "",
              "CHILD",
              "ADULT",
              "OLDER_ADULT"
            ],
            "type": "string",
            "description": "Optional filter by eligible age group.",
            "default": ""
          },
          "healthyVolunteersOnly": {
            "title": "Accepts healthy volunteers",
            "type": "boolean",
            "description": "On: only studies that accept healthy volunteers.",
            "default": false
          },
          "resultsAvailability": {
            "title": "Study results",
            "enum": [
              "",
              "with",
              "without"
            ],
            "type": "string",
            "description": "Optional filter by whether results are posted on ClinicalTrials.gov.",
            "default": ""
          },
          "funderType": {
            "title": "Lead funder type",
            "enum": [
              "",
              "INDUSTRY",
              "NIH",
              "FED",
              "OTHER_GOV",
              "NETWORK",
              "OTHER"
            ],
            "type": "string",
            "description": "Optional filter by the lead sponsor class.",
            "default": ""
          },
          "dateFilterField": {
            "title": "Date filter",
            "enum": [
              "",
              "start",
              "primaryCompletion",
              "completion",
              "firstPosted",
              "lastUpdate",
              "resultsFirstPosted"
            ],
            "type": "string",
            "description": "Which study date \"Date from\" and \"Date to\" apply to.",
            "default": ""
          },
          "dateFrom": {
            "title": "Date from (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional start of the date range for the chosen Date filter."
          },
          "dateTo": {
            "title": "Date to (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional end of the date range for the chosen Date filter."
          },
          "sort": {
            "title": "Sort trials by",
            "enum": [
              "",
              "LastUpdatePostDate:desc",
              "StudyFirstPostDate:desc",
              "StartDate:desc",
              "EnrollmentCount:desc"
            ],
            "type": "string",
            "description": "Order of trials_search results. trials_recent_changes always sorts by last update.",
            "default": ""
          },
          "includeDetails": {
            "title": "Include full trial details",
            "type": "boolean",
            "description": "trials_search and trials_recent_changes: add eligibility criteria (inclusion and exclusion), primary and secondary outcomes, detailed description and up to 15 site locations, as in trial_detail. Site contact persons are never included.",
            "default": false
          },
          "recallCategory": {
            "title": "FDA Recall Category",
            "enum": [
              "all",
              "drug",
              "food",
              "device"
            ],
            "type": "string",
            "description": "Product category for FDA recalls mode.",
            "default": "all"
          },
          "recallState": {
            "title": "US State Code (Recalls)",
            "type": "string",
            "description": "Optional 2-letter US state filter for recalls (e.g. CA, NY, TX).",
            "default": ""
          },
          "query": {
            "title": "Keyword Filter (Recalls)",
            "type": "string",
            "description": "Optional keyword filter for FDA recalls (e.g. listeria, insulin, pacemaker)."
          },
          "days": {
            "title": "Lookback Days (Recent Trial Changes)",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "Number of days to look back in trials_recent_changes mode (1-90).",
            "default": 14
          },
          "seriousOnly": {
            "title": "FAERS Serious Adverse Events Only",
            "type": "boolean",
            "description": "When true, filter FAERS reactions to FDA-classified serious adverse events only.",
            "default": false
          },
          "limit": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of reactions, recalls or clinical trials to return (1-1000).",
            "default": 15
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}