{
  "openapi": "3.0.1",
  "info": {
    "title": "ClinicalTrials.gov Protocol & Completion Date Diff Monitor",
    "description": "Track ClinicalTrials.gov API v2 updates, primary completion date delays, status terminations, enrollment shifts, endpoint edits, and sponsor/collaborator changes with zero API keys.",
    "version": "1.0",
    "x-build-id": "elibT524uSU0r9dLm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ademcakal_00~clinicaltrials-protocol-diff-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ademcakal_00-clinicaltrials-protocol-diff-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/ademcakal_00~clinicaltrials-protocol-diff-monitor/runs": {
      "post": {
        "operationId": "runs-sync-ademcakal_00-clinicaltrials-protocol-diff-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/ademcakal_00~clinicaltrials-protocol-diff-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-ademcakal_00-clinicaltrials-protocol-diff-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": {
          "mode": {
            "title": "Execution Mode",
            "enum": [
              "recent_updates",
              "nct_lookup"
            ],
            "type": "string",
            "description": "Choose 'recent_updates' to scan trials updated in the last N days (with optional filters & diffing), or 'nct_lookup' to inspect specific NCT IDs.",
            "default": "recent_updates"
          },
          "lookbackDays": {
            "title": "Lookback Days (recent_updates mode)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Number of days back from today (UTC) to query LastUpdatePostDate on ClinicalTrials.gov API v2.",
            "default": 7
          },
          "dateFrom": {
            "title": "Start Date Override (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional exact start date for LastUpdatePostDate range (overrides lookbackDays)."
          },
          "dateTo": {
            "title": "End Date Override (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional exact end date for LastUpdatePostDate range (defaults to today UTC)."
          },
          "sponsor": {
            "title": "Sponsor / Company Filter",
            "type": "string",
            "description": "Optional lead sponsor or collaborator search term (e.g. 'Pfizer', 'Moderna', 'Eli Lilly')."
          },
          "condition": {
            "title": "Condition / Disease Filter",
            "type": "string",
            "description": "Optional condition filter (e.g. 'Oncology', 'Alzheimer', 'Obesity')."
          },
          "phases": {
            "title": "Trial Phases",
            "type": "array",
            "description": "Optional phase filter (EARLY_PHASE1, PHASE1, PHASE2, PHASE3, PHASE4, NA). Leave empty for all phases.",
            "default": [
              "PHASE2",
              "PHASE3"
            ],
            "items": {
              "type": "string"
            }
          },
          "statuses": {
            "title": "Overall Statuses",
            "type": "array",
            "description": "Optional overallStatus filter (RECRUITING, ACTIVE_NOT_RECRUITING, COMPLETED, SUSPENDED, TERMINATED, WITHDRAWN).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "industryOnly": {
            "title": "Industry Sponsors Only",
            "type": "boolean",
            "description": "If true, keep only trials where leadSponsor.class === 'INDUSTRY' (biotech/pharma focus).",
            "default": false
          },
          "nctIds": {
            "title": "NCT IDs (nct_lookup mode)",
            "type": "array",
            "description": "List of exact NCT IDs to inspect (e.g. ['NCT04470427', 'NCT04368728']).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "previousSnapshots": {
            "title": "Previous Snapshots for Field-Level Diff (Optional)",
            "type": "array",
            "description": "Optional array of prior study snapshots (from a previous run of this Actor) to compute structured 6-field protocol diffs.",
            "default": []
          },
          "maxStudies": {
            "title": "Maximum Studies to Return",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Hard cap on studies fetched and returned in this run (1 to 2000).",
            "default": 25
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}