{
  "openapi": "3.0.1",
  "info": {
    "title": "ClinicalTrials.gov Scraper",
    "description": "Scrape clinical-trial records from the official ClinicalTrials.gov v2 REST API. Query by condition, intervention, sponsor, status, phase or free text. One record per study — NCT id, title, status, phase, sponsor, conditions, interventions, enrollment, dates, locations + the raw study. Pay per study.",
    "version": "0.1",
    "x-build-id": "IhRwnK3JIb1hLdh2J"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamule~clinicaltrials-gov-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamule-clinicaltrials-gov-scraper",
        "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/datamule~clinicaltrials-gov-scraper/runs": {
      "post": {
        "operationId": "runs-sync-datamule-clinicaltrials-gov-scraper",
        "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/datamule~clinicaltrials-gov-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-datamule-clinicaltrials-gov-scraper",
        "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": {
          "query": {
            "title": "Search term (free text)",
            "type": "string",
            "description": "Free-text search across the whole study record (maps to the API's query.term). e.g. \"GLP-1\", \"long COVID\", \"CAR-T\". Combine with the field-specific filters below — the API ANDs them together. Leave everything empty to return the most recent studies."
          },
          "condition": {
            "title": "Condition / disease",
            "type": "string",
            "description": "Condition or disease being studied (query.cond). e.g. \"type 2 diabetes\", \"breast cancer\", \"alzheimer\"."
          },
          "intervention": {
            "title": "Intervention / treatment",
            "type": "string",
            "description": "Intervention, drug, device or treatment (query.intr). e.g. \"metformin\", \"semaglutide\", \"pacemaker\"."
          },
          "sponsor": {
            "title": "Sponsor / collaborator",
            "type": "string",
            "description": "Lead sponsor or collaborator organisation (query.spons). e.g. \"Pfizer\", \"Mayo Clinic\", \"National Cancer Institute\"."
          },
          "titles": {
            "title": "Words in title",
            "type": "string",
            "description": "Words that must appear in the brief or official study title (query.titles). e.g. \"migraine prevention\"."
          },
          "nctId": {
            "title": "NCT id",
            "type": "string",
            "description": "Look up a specific study by its ClinicalTrials.gov identifier or org study id (query.id). e.g. \"NCT03470961\"."
          },
          "status": {
            "title": "Recruitment status",
            "type": "array",
            "description": "Filter to one or more overall recruitment statuses (filter.overallStatus). Leave empty for any status.",
            "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",
                "Available (expanded access)",
                "No longer available",
                "Temporarily not available",
                "Approved for marketing",
                "Withheld"
              ]
            },
            "default": []
          },
          "phase": {
            "title": "Trial phase",
            "enum": [
              "",
              "EARLY_PHASE1",
              "PHASE1",
              "PHASE2",
              "PHASE3",
              "PHASE4"
            ],
            "type": "string",
            "description": "Filter to a single clinical-trial phase (aggFilters phase). Leave empty for any phase.",
            "default": ""
          },
          "studyType": {
            "title": "Study type",
            "enum": [
              "",
              "INTERVENTIONAL",
              "OBSERVATIONAL"
            ],
            "type": "string",
            "description": "Filter to interventional or observational studies (aggFilters studyType). Leave empty for any type.",
            "default": ""
          },
          "sort": {
            "title": "Sort",
            "type": "string",
            "description": "Sort results by a field. e.g. LastUpdatePostDate:desc (most recently updated first), EnrollmentCount:desc, StartDate:desc. Leave empty for the API's default relevance order."
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of studies to return. The actor paginates automatically at up to 1000 per request until this many are collected or the result set is exhausted.",
            "default": 100
          },
          "pageSize": {
            "title": "Page size",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Studies fetched per API request (1–1000). Larger pages = fewer requests. Usually leave at the default.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}