{
  "openapi": "3.0.1",
  "info": {
    "title": "ClinicalTrials.gov Change Monitor - Trial Diff Feed",
    "description": "Change-detection feed for ClinicalTrials.gov: new trials, status flips (Recruiting to Terminated), new sites and PIs, enrollment changes. The diff, not another snapshot.",
    "version": "0.1",
    "x-build-id": "e5nIBvs5aidbdn4Gq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/splendorous_astrolabe_xs9~clinicaltrials-change-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-splendorous_astrolabe_xs9-clinicaltrials-change-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/splendorous_astrolabe_xs9~clinicaltrials-change-monitor/runs": {
      "post": {
        "operationId": "runs-sync-splendorous_astrolabe_xs9-clinicaltrials-change-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/splendorous_astrolabe_xs9~clinicaltrials-change-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-splendorous_astrolabe_xs9-clinicaltrials-change-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 / therapeutic area",
            "type": "string",
            "description": "Condition or therapeutic-area search (ClinicalTrials.gov <code>query.cond</code> — full Essie syntax works, e.g. <code>oncology</code>, <code>non-small cell lung cancer</code>, <code>\"multiple myeloma\" OR \"plasma cell myeloma\"</code>). Set to an empty string to match any condition (combine with a sponsor filter, or expect a very large universe).",
            "default": "oncology"
          },
          "sponsor": {
            "title": "Lead sponsor",
            "type": "string",
            "description": "Restrict to studies whose <b>lead sponsor</b> name matches this text (e.g. <code>Merck Sharp &amp; Dohme</code>, <code>Pfizer</code>, <code>AstraZeneca</code>). Leave empty for all sponsors. Matches the lead sponsor only, not collaborators.",
            "default": ""
          },
          "phases": {
            "title": "Phases",
            "type": "array",
            "description": "Trial phases to include. Leave empty for all phases (includes phase-less observational/expanded-access studies).",
            "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": [
              "PHASE2",
              "PHASE3"
            ]
          },
          "statuses": {
            "title": "Overall statuses to track",
            "type": "array",
            "description": "Studies enter the tracked universe while in one of these statuses. Once tracked, a study that flips to <i>any other</i> status still gets reported as a <code>status_change</code> (that's the point) and then leaves the tracked set.",
            "items": {
              "type": "string",
              "enum": [
                "RECRUITING",
                "NOT_YET_RECRUITING",
                "ENROLLING_BY_INVITATION",
                "ACTIVE_NOT_RECRUITING",
                "SUSPENDED",
                "TERMINATED",
                "COMPLETED",
                "WITHDRAWN"
              ],
              "enumTitles": [
                "Recruiting",
                "Not yet recruiting",
                "Enrolling by invitation",
                "Active, not recruiting",
                "Suspended",
                "Terminated",
                "Completed",
                "Withdrawn"
              ]
            },
            "default": [
              "RECRUITING"
            ]
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Keep only studies with at least one site in one of these countries, exactly as ClinicalTrials.gov names them (e.g. <code>United States</code>, <code>Germany</code>, <code>Japan</code>). Leave empty for worldwide.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "delta",
              "snapshot"
            ],
            "type": "string",
            "description": "<b>delta</b> (default) compares against this actor's previous run (persisted in a named key-value store) and pushes only changes: <code>new_trial</code>, <code>status_change</code>, <code>enrollment_change</code>, <code>sites_added</code>. The first delta run seeds the baseline and emits every matching study as <code>change: \"baseline\"</code>. <b>snapshot</b> pushes every matching study every run and touches no state.",
            "default": "delta"
          },
          "daysBack": {
            "title": "Baseline window (days)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "For the <b>first</b> delta run (the baseline) and for <b>snapshot</b> mode: only include studies whose ClinicalTrials.gov record was updated within this many days. Bounds the size (and cost) of the baseline; the tracked universe then grows organically as more studies get touched. Subsequent delta runs ignore this and use the time since the previous run instead. Set high (e.g. 3650) to baseline the entire matching universe at once.",
            "default": 7
          },
          "maxStudies": {
            "title": "Max studies per fetch",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Safety cap on studies fetched from the API per run.",
            "default": 2000
          },
          "stateKey": {
            "title": "Delta state key",
            "type": "string",
            "description": "Advanced: name of the record inside the <code>clinicaltrials-change-monitor-state</code> key-value store used for delta comparison. Use a different key per watchlist/schedule so they don't cross-contaminate. If you change the filters for an existing key, the actor detects it and safely re-baselines.",
            "default": "default"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}