{
  "openapi": "3.0.1",
  "info": {
    "title": "ClinicalTrials.gov Scraper & Trial Monitor",
    "description": "Search and export ClinicalTrials.gov trials via the official API, then monitor them: each run returns only new trials, status changes and posted results with a field-level diff. Sponsor watchlist, phase/status/country filters, recruiting sites.",
    "version": "0.4",
    "x-build-id": "AO5e2zxMahcsCFEwB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/heaped_qualm~clinicaltrials-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-heaped_qualm-clinicaltrials-monitor",
        "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/heaped_qualm~clinicaltrials-monitor/runs": {
      "post": {
        "operationId": "runs-sync-heaped_qualm-clinicaltrials-monitor",
        "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/heaped_qualm~clinicaltrials-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-heaped_qualm-clinicaltrials-monitor",
        "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": {
          "condition": {
            "title": "Condition / disease",
            "type": "string",
            "description": "Disease or condition to search, e.g. glioblastoma or type 2 diabetes (API parameter query.cond). With every search field empty, the demo search runs: glioblastoma trials that are recruiting."
          },
          "intervention": {
            "title": "Intervention / drug",
            "type": "string",
            "description": "e.g. pembrolizumab, semaglutide. Maps to query.intr."
          },
          "sponsor": {
            "title": "Sponsor / collaborator",
            "type": "string",
            "description": "Single sponsor search (query.spons). For several companies use the watchlist below."
          },
          "sponsorWatchlist": {
            "title": "Sponsor / competitor watchlist",
            "type": "array",
            "description": "One search per sponsor, e.g. Pfizer, Novartis, BioNTech. Each row is tagged with the matching watchlist entry, and a trial found for two sponsors is returned once. Max results applies per sponsor.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Free-text keywords",
            "type": "string",
            "description": "Free text across all fields (API parameter query.term). ClinicalTrials.gov search syntax works, e.g. \"mRNA vaccine\" AND melanoma."
          },
          "nctIds": {
            "title": "NCT IDs",
            "type": "array",
            "description": "Track specific trials by NCT number, e.g. NCT04368728. Lower case is accepted. With monitor mode on, you get a row only when one of these trials changes.",
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "e.g. Germany. Filters trials with a site in this country and adds per-country site counts."
          },
          "location": {
            "title": "City / region / site text",
            "type": "string",
            "description": "Optional extra location text, e.g. Berlin or Charité (query.locn)."
          },
          "phases": {
            "title": "Phase",
            "type": "array",
            "description": "Keep trials in any of the selected phases. Empty = all phases.",
            "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"
              ]
            }
          },
          "statuses": {
            "title": "Overall status",
            "type": "array",
            "description": "Keep trials with any of the selected overall statuses. Empty = all statuses.",
            "items": {
              "type": "string",
              "enum": [
                "RECRUITING",
                "NOT_YET_RECRUITING",
                "ACTIVE_NOT_RECRUITING",
                "ENROLLING_BY_INVITATION",
                "COMPLETED",
                "SUSPENDED",
                "TERMINATED",
                "WITHDRAWN",
                "UNKNOWN"
              ],
              "enumTitles": [
                "Recruiting",
                "Not yet recruiting",
                "Active, not recruiting",
                "Enrolling by invitation",
                "Completed",
                "Suspended",
                "Terminated",
                "Withdrawn",
                "Unknown"
              ]
            }
          },
          "studyType": {
            "title": "Study type",
            "enum": [
              "",
              "INTERVENTIONAL",
              "OBSERVATIONAL",
              "EXPANDED_ACCESS"
            ],
            "type": "string",
            "description": "Interventional, observational or expanded access. Empty = any.",
            "default": ""
          },
          "sex": {
            "title": "Sex",
            "enum": [
              "all",
              "f",
              "m"
            ],
            "type": "string",
            "description": "Eligible sex of participants. \"All\" applies no filter.",
            "default": "all"
          },
          "ageGroup": {
            "title": "Age group",
            "enum": [
              "",
              "child",
              "adult",
              "older"
            ],
            "type": "string",
            "description": "Eligible age group of participants. Empty = any age."
          },
          "healthyVolunteers": {
            "title": "Accepts healthy volunteers",
            "type": "boolean",
            "description": "Only trials that accept healthy volunteers.",
            "default": false
          },
          "resultsAvailable": {
            "title": "Results",
            "enum": [
              "",
              "with",
              "without"
            ],
            "type": "string",
            "description": "Keep only trials with posted results, or only trials without. Empty = any."
          },
          "funderType": {
            "title": "Funder type",
            "enum": [
              "",
              "industry",
              "nih",
              "fed",
              "other"
            ],
            "type": "string",
            "description": "Class of the lead sponsor or funder. Empty = any."
          },
          "startDateFrom": {
            "title": "Start date from",
            "type": "string",
            "description": "Earliest study start date (YYYY-MM-DD)."
          },
          "startDateTo": {
            "title": "Start date to",
            "type": "string",
            "description": "Latest study start date (YYYY-MM-DD)."
          },
          "lastUpdateFrom": {
            "title": "Last update posted from",
            "type": "string",
            "description": "Earliest \"last update posted\" date (YYYY-MM-DD). Useful for a one-off export of recent changes."
          },
          "lastUpdateTo": {
            "title": "Last update posted to",
            "type": "string",
            "description": "Latest \"last update posted\" date (YYYY-MM-DD)."
          },
          "firstPostedFrom": {
            "title": "First posted from",
            "type": "string",
            "description": "Earliest first-posted date (YYYY-MM-DD): finds newly registered trials."
          },
          "firstPostedTo": {
            "title": "First posted to",
            "type": "string",
            "description": "Latest first-posted date (YYYY-MM-DD)."
          },
          "primaryCompletionFrom": {
            "title": "Primary completion from",
            "type": "string",
            "description": "Start of the primary completion window (YYYY-MM-DD): finds trials that read out soon."
          },
          "primaryCompletionTo": {
            "title": "Primary completion to",
            "type": "string",
            "description": "End of the primary completion window (YYYY-MM-DD)."
          },
          "sortBy": {
            "title": "Sort",
            "enum": [
              "LastUpdatePostDate:desc",
              "StudyFirstPostDate:desc",
              "StartDate:desc",
              "EnrollmentCount:desc",
              "@relevance"
            ],
            "type": "string",
            "description": "Order used when more trials match than Max results.",
            "default": "LastUpdatePostDate:desc"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of trials fetched per run (per sponsor when you use the watchlist). Newest updates come first with the default sort.",
            "default": 200
          },
          "onlyNewSinceLastRun": {
            "title": "Only new or changed since last run",
            "type": "boolean",
            "description": "Monitor mode: emit only NEW, STATUS_CHANGED, RESULTS_POSTED and UPDATED trials (with a field-level diff) vs the last run with the same monitor name. First run emits everything as BASELINE. Switch off for a full one-off export. It starts switched off in the form, so a manual test run always shows results. Switch it on in the task you schedule. API calls that omit this field get monitor mode on.",
            "default": true
          },
          "stateKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name of this monitor's memory (letters, digits and dashes; other characters become dashes). Use a different name for each saved task or schedule so their change detection stays separate.",
            "default": "default"
          },
          "includeLocations": {
            "title": "Include site list",
            "type": "boolean",
            "description": "Adds the list of sites (facility, city, state, ZIP, country, site status, coordinates).",
            "default": true
          },
          "onlyRecruitingSitesInCountry": {
            "title": "Only recruiting sites in country",
            "type": "boolean",
            "description": "When a country is set, keep only RECRUITING / NOT_YET_RECRUITING sites in that country in the site list.",
            "default": false
          },
          "includeContacts": {
            "title": "Include public contacts",
            "type": "boolean",
            "description": "Central contacts as published. ClinicalTrials.gov terms forbid using these e-mail addresses for marketing.",
            "default": false
          },
          "includeRawRecord": {
            "title": "Include raw API record",
            "type": "boolean",
            "description": "Adds the full protocolSection JSON (large).",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}