{
  "openapi": "3.0.1",
  "info": {
    "title": "ClinicalTrials.gov Scraper & New Trials Monitor",
    "description": "Search and monitor ClinicalTrials.gov by condition, sponsor, phase, status and date range. Monitor mode returns only trials that are new or updated since your last run. Official API v2, no start fee.",
    "version": "0.1",
    "x-build-id": "lHFSX4h7LLfaVgRnt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/betteratoms~clinicaltrials-gov-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-betteratoms-clinicaltrials-gov-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/betteratoms~clinicaltrials-gov-monitor/runs": {
      "post": {
        "operationId": "runs-sync-betteratoms-clinicaltrials-gov-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/betteratoms~clinicaltrials-gov-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-betteratoms-clinicaltrials-gov-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "monitor"
            ],
            "type": "string",
            "description": "search returns every trial that matches (up to maxItems). monitor remembers what it returned for this stateKey and on later runs returns only trials that are new or have a newer 'last update posted' date.",
            "default": "search"
          },
          "conditions": {
            "title": "Conditions / diseases",
            "type": "array",
            "description": "e.g. obesity, type 2 diabetes, Alzheimer disease. Several values are combined with OR. ClinicalTrials.gov expands synonyms.",
            "items": {
              "type": "string"
            }
          },
          "sponsors": {
            "title": "Sponsors / collaborators",
            "type": "array",
            "description": "Lead sponsor or collaborator names, e.g. Pfizer, Novo Nordisk, National Cancer Institute. Several values are combined with OR.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Other keywords",
            "type": "array",
            "description": "Free-text terms matched anywhere in the record, e.g. a drug name such as semaglutide. Several values are combined with OR.",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "Locations",
            "type": "array",
            "description": "Trial site location terms, e.g. India, Germany, Boston. Several values are combined with OR.",
            "items": {
              "type": "string"
            }
          },
          "phases": {
            "title": "Phases",
            "type": "array",
            "description": "Leave empty for 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": "Leave empty for all statuses.",
            "items": {
              "type": "string",
              "enum": [
                "RECRUITING",
                "NOT_YET_RECRUITING",
                "ENROLLING_BY_INVITATION",
                "ACTIVE_NOT_RECRUITING",
                "COMPLETED",
                "SUSPENDED",
                "TERMINATED",
                "WITHDRAWN",
                "UNKNOWN",
                "AVAILABLE",
                "NO_LONGER_AVAILABLE",
                "TEMPORARILY_NOT_AVAILABLE",
                "APPROVED_FOR_MARKETING",
                "WITHHELD"
              ],
              "enumTitles": [
                "Recruiting",
                "Not yet recruiting",
                "Enrolling by invitation",
                "Active, not recruiting",
                "Completed",
                "Suspended",
                "Terminated",
                "Withdrawn",
                "Unknown status",
                "Expanded access: available",
                "Expanded access: no longer available",
                "Expanded access: temporarily not available",
                "Approved for marketing",
                "Withheld"
              ]
            }
          },
          "studyTypes": {
            "title": "Study types",
            "type": "array",
            "description": "Leave empty for all study types.",
            "items": {
              "type": "string",
              "enum": [
                "INTERVENTIONAL",
                "OBSERVATIONAL",
                "EXPANDED_ACCESS"
              ],
              "enumTitles": [
                "Interventional",
                "Observational",
                "Expanded access"
              ]
            }
          },
          "dateField": {
            "title": "Date range applies to",
            "enum": [
              "lastUpdatePostDate",
              "studyFirstPostDate",
              "startDate",
              "primaryCompletionDate",
              "completionDate"
            ],
            "type": "string",
            "description": "Which date the 'from' and 'to' fields filter on.",
            "default": "lastUpdatePostDate"
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Inclusive, YYYY-MM-DD. Leave empty for no lower bound."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Inclusive, YYYY-MM-DD. Leave empty for no upper bound."
          },
          "sort": {
            "title": "Sort (search mode)",
            "enum": [
              "LastUpdatePostDate:desc",
              "StudyFirstPostDate:desc",
              "StartDate:desc",
              "@relevance"
            ],
            "type": "string",
            "description": "Monitor mode always processes the oldest changes first, so nothing is skipped when maxItems stops a run early.",
            "default": "LastUpdatePostDate:desc"
          },
          "stateKey": {
            "title": "Monitor state key",
            "type": "string",
            "description": "Name for this saved search's memory. Use a different key for each search you monitor.",
            "default": "default"
          },
          "monitorInitialLookbackDays": {
            "title": "First monitor run: look back N days",
            "minimum": 1,
            "type": "integer",
            "description": "On the first monitor run for a stateKey, return trials updated in the last N days (up to maxItems) and remember them.",
            "default": 30
          },
          "summaryMaxChars": {
            "title": "Max brief summary length",
            "minimum": 0,
            "type": "integer",
            "description": "Truncate the brief summary to this many characters. 0 = no limit.",
            "default": 1000
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of trials to return. Each returned trial is one billable result.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}