{
  "openapi": "3.0.1",
  "info": {
    "title": "Clinical Trials Monitor - New Trials & Status Change Alerts",
    "description": "Change feed for ClinicalTrials.gov. Watch conditions, sponsors and keywords and get one record per NEW trial registration and per STATUS CHANGE (Not yet recruiting → Recruiting → Completed) on the trials you already watch, with the previous status on the record.",
    "version": "0.1",
    "x-build-id": "bVdpDLT4fQYxqs0lU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datadeltas~clinical-trials-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datadeltas-clinical-trials-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/datadeltas~clinical-trials-monitor/runs": {
      "post": {
        "operationId": "runs-sync-datadeltas-clinical-trials-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/datadeltas~clinical-trials-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-datadeltas-clinical-trials-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": {
          "conditions": {
            "title": "Conditions / diseases",
            "type": "array",
            "description": "Conditions to watch, e.g. 'melanoma', 'type 2 diabetes'. Each becomes its own registry search of the condition field. Combined with sponsors and keywords as OR - a trial matching any watch is in scope.",
            "items": {
              "type": "string"
            }
          },
          "sponsors": {
            "title": "Sponsors",
            "type": "array",
            "description": "Sponsor names to watch, e.g. 'Pfizer', 'Memorial Sloan Kettering'. Matches lead and collaborating sponsors. Each name becomes its own registry search.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Free-text terms searched across the whole study record (intervention names, drug codes, mechanisms), e.g. 'CAR-T', 'GLP-1'. Broader than the condition search. Each term becomes its own registry search.",
            "items": {
              "type": "string"
            }
          },
          "phases": {
            "title": "Phases",
            "type": "array",
            "description": "Only emit NEW trials in these phases. Leave empty for all. Note that observational and expanded-access studies state no phase and are excluded whenever this filter is set (add 'NA' to include studies explicitly recorded as not applicable).",
            "items": {
              "type": "string",
              "enum": [
                "NA",
                "EARLY_PHASE1",
                "PHASE1",
                "PHASE2",
                "PHASE3",
                "PHASE4"
              ],
              "enumTitles": [
                "Not applicable (NA)",
                "Early Phase 1",
                "Phase 1",
                "Phase 2",
                "Phase 3",
                "Phase 4"
              ]
            },
            "default": []
          },
          "overallStatuses": {
            "title": "Recruitment statuses",
            "type": "array",
            "description": "Only emit NEW trials currently in these statuses. Leave empty for all. Status CHANGES are always reported for every watched trial regardless of this filter - a trial moving out of your chosen status is exactly the news you want.",
            "items": {
              "type": "string",
              "enum": [
                "NOT_YET_RECRUITING",
                "RECRUITING",
                "ENROLLING_BY_INVITATION",
                "ACTIVE_NOT_RECRUITING",
                "SUSPENDED",
                "TERMINATED",
                "COMPLETED",
                "WITHDRAWN",
                "AVAILABLE",
                "NO_LONGER_AVAILABLE",
                "TEMPORARILY_NOT_AVAILABLE",
                "APPROVED_FOR_MARKETING",
                "WITHHELD",
                "UNKNOWN"
              ],
              "enumTitles": [
                "Not yet recruiting",
                "Recruiting",
                "Enrolling by invitation",
                "Active, not recruiting",
                "Suspended",
                "Terminated",
                "Completed",
                "Withdrawn",
                "Available (expanded access)",
                "No longer available",
                "Temporarily not available",
                "Approved for marketing",
                "Withheld",
                "Unknown"
              ]
            },
            "default": []
          },
          "trackStatusChanges": {
            "title": "Track status changes",
            "type": "boolean",
            "description": "Also emit a record whenever a trial this monitor has already reported changes recruitment status (e.g. Recruiting to Completed), carrying the previous value in 'oldStatus'. Turn off to receive new registrations only.",
            "default": true
          },
          "sinceDays": {
            "title": "Backfill window (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "How many days of newly registered trials to scan, by first-posted date. On the first run this is your backfill; afterwards only trials never reported before are emitted.",
            "default": 14
          },
          "maxItems": {
            "title": "Max records per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Cap on records emitted in one run (cost control), split evenly between the two event types so neither can starve the other; whichever half is quiet lends its unused share to the other. Nothing over the cap is lost: unreported new trials and held-back status changes both stay pending in state and emit on the next run.",
            "default": 500
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store holding the reported trial ids and their last known statuses. Change it to reset the monitor and re-emit the backfill.",
            "default": "clinical-trials-monitor-state"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}