{
  "openapi": "3.0.1",
  "info": {
    "title": "Clinical Trial Protocol Amendments — ClinicalTrials.gov Diff",
    "description": "Track what actually changed between ClinicalTrials.gov record versions: primary endpoints re-specified, enrollment cut, eligibility widened, completion dates slipped, trials terminated. Structured before/after diffs with day shifts, percent changes and a critical/major/minor rating.",
    "version": "0.0",
    "x-build-id": "na29set4yqqqGhyFL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/malekh~clinical-trial-protocol-amendments/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-malekh-clinical-trial-protocol-amendments",
        "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/malekh~clinical-trial-protocol-amendments/runs": {
      "post": {
        "operationId": "runs-sync-malekh-clinical-trial-protocol-amendments",
        "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/malekh~clinical-trial-protocol-amendments/run-sync": {
      "post": {
        "operationId": "run-sync-malekh-clinical-trial-protocol-amendments",
        "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": {
          "nctIds": {
            "title": "Studies to scan",
            "type": "array",
            "description": "The trials to diff, by NCT identifier. Case does not matter — \"nct01439386\" normalises. To carry your own identifier into the output, pass objects instead of strings: {\"recordId\": \"COMP-1\", \"nctId\": \"NCT02576574\"}; recordId is echoed on every row, including errors. Leave empty and use the search fields below to build the list instead — you can also combine the two, and duplicates are removed."
          },
          "since": {
            "title": "Only amendments on or after",
            "type": "string",
            "description": "Ignore protocol changes older than this date (YYYY-MM-DD; a bare year or year-month is accepted). This is the main cost control on an actively-amended trial — a study registered in 2010 can carry 60 versions. Leave empty to diff the study's entire version history."
          },
          "minSignificance": {
            "title": "Minimum significance",
            "enum": [
              "minor",
              "major",
              "critical"
            ],
            "type": "string",
            "description": "How large a change has to be before it is reported. \"critical\" is reserved for changes that undermine comparability — primary outcome measures re-specified, the trial terminated or withdrawn. \"major\" adds enrollment and eligibility changes and completion-date slips. \"minor\" adds everything else, including contact and administrative edits.",
            "default": "major"
          },
          "includeMinorChanges": {
            "title": "Include minor changes",
            "type": "boolean",
            "description": "Shortcut that forces the minimum significance down to \"minor\", overriding the setting above. Useful when you want the full audit trail rather than a competitive-intelligence view.",
            "default": false
          },
          "searchCondition": {
            "title": "Search: condition",
            "type": "string",
            "description": "Build the study list by condition or disease, e.g. \"non-small cell lung cancer\". Combines with the sponsor, term and status filters; the matched NCT ids are added to anything given above, up to the maximum-studies cap."
          },
          "searchSponsor": {
            "title": "Search: sponsor",
            "type": "string",
            "description": "Build the study list by lead sponsor or collaborator, e.g. \"Pfizer\". This is the usual way to watch a competitor's whole trial portfolio for protocol changes."
          },
          "searchQuery": {
            "title": "Search: free-text term",
            "type": "string",
            "description": "Free-text search across the study record, passed through to the ClinicalTrials.gov v2 API as query.term. Use for anything the condition and sponsor fields do not cover — an intervention name, a device, a mechanism."
          },
          "searchStatus": {
            "title": "Search: overall status",
            "type": "array",
            "description": "Restrict the search to these recruitment statuses, e.g. RECRUITING, ACTIVE_NOT_RECRUITING, TERMINATED. Applies only to studies found by search, not to NCT ids you supplied directly.",
            "items": {
              "type": "string"
            }
          },
          "maxStudies": {
            "title": "Maximum studies",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Safety cap on how many studies are scanned, counting both the ids you supplied and anything the search adds, so a broad sponsor search cannot run up an unexpected bill. You are charged per study scanned.",
            "default": 25
          },
          "maxAmendmentsPerStudy": {
            "title": "Maximum amendments per study",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Caps how many amendments are reported for any one study, so a single heavily-revised trial cannot dominate the results. Amendments are reported newest first, so the cap drops the oldest.",
            "default": 20
          },
          "maxVersionFetches": {
            "title": "Version-fetch budget",
            "minimum": 1,
            "maximum": 4000,
            "type": "integer",
            "description": "Hard ceiling on total historical-version fetches across the whole run — the real compute cost here, since each amendment needs the record on both sides of it. Raise it if you are scanning many long-running trials and see the budget reported as exhausted; the default comfortably covers 25 studies.",
            "default": 600
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}