{
  "openapi": "3.0.1",
  "info": {
    "title": "ClinicalTrials.gov Scraper – Condition, Phase & Site Mode",
    "description": "Scrape ClinicalTrials.gov's official NIH API: condition, intervention, sponsor, location, status, type and phase filters. Optional one-row-per-site mode for site-selection. No contact PII shipped, ever. $0.0015/result, no start fee.",
    "version": "0.1",
    "x-build-id": "IVFDgA8r4kqULzPEz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fetchsmith~clinicaltrials-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fetchsmith-clinicaltrials-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/fetchsmith~clinicaltrials-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fetchsmith-clinicaltrials-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/fetchsmith~clinicaltrials-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fetchsmith-clinicaltrials-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": {
          "nctIds": {
            "title": "Specific NCT IDs (direct lookup)",
            "type": "string",
            "description": "One or more ClinicalTrials.gov study IDs (e.g. \"NCT04368728, NCT03854955\" — comma, space or newline separated). When set, this is an EXCLUSIVE lookup mode: every other filter below (conditions, status, phase, etc.) is ignored, so a mixed batch of trials on unrelated topics still all come back. Malformed or nonexistent ids are dropped individually with a named warning instead of failing the whole run."
          },
          "conditions": {
            "title": "Conditions / diseases",
            "type": "string",
            "description": "Condition or disease terms, e.g. \"breast cancer\". Maps to query.cond. Leave empty with a search query or overallStatus filter, or every study since 1999 matches.",
            "default": "cancer"
          },
          "interventions": {
            "title": "Interventions / treatments",
            "type": "string",
            "description": "Drug, device or procedure name, e.g. \"pembrolizumab\". Maps to query.intr."
          },
          "sponsors": {
            "title": "Sponsor / collaborator name",
            "type": "string",
            "description": "Lead sponsor or collaborator organization name. Maps to query.spons."
          },
          "locations": {
            "title": "Location (city, state or country)",
            "type": "string",
            "description": "Facility location text, e.g. \"Boston, Massachusetts\". Maps to query.locn."
          },
          "searchQuery": {
            "title": "Free-text search",
            "type": "string",
            "description": "General search term across titles, outcomes and eligibility text. Maps to query.term."
          },
          "overallStatus": {
            "title": "Recruitment status",
            "uniqueItems": true,
            "type": "array",
            "description": "Filter by recruitment status. Leave empty for all statuses.",
            "items": {
              "type": "string",
              "enum": [
                "RECRUITING",
                "NOT_YET_RECRUITING",
                "ENROLLING_BY_INVITATION",
                "ACTIVE_NOT_RECRUITING",
                "COMPLETED",
                "TERMINATED",
                "WITHDRAWN",
                "SUSPENDED",
                "UNKNOWN",
                "WITHHELD",
                "AVAILABLE",
                "NO_LONGER_AVAILABLE",
                "APPROVED_FOR_MARKETING",
                "TEMPORARILY_NOT_AVAILABLE"
              ]
            }
          },
          "studyTypes": {
            "title": "Study type",
            "uniqueItems": true,
            "type": "array",
            "description": "Interventional, observational or expanded-access. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "INTERVENTIONAL",
                "OBSERVATIONAL",
                "EXPANDED_ACCESS"
              ]
            }
          },
          "phases": {
            "title": "Phase",
            "uniqueItems": true,
            "type": "array",
            "description": "Trial phase. Only meaningful for interventional studies; ~19% of all studies have no phase at all (observational studies, device trials). Leave empty for all.",
            "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"
              ]
            }
          },
          "hasResultsOnly": {
            "title": "Only studies with posted results",
            "type": "boolean",
            "description": "Restrict to studies that have posted a results section on ClinicalTrials.gov.",
            "default": false
          },
          "rowsPerStudy": {
            "title": "Row mode",
            "enum": [
              "study",
              "site"
            ],
            "type": "string",
            "description": "\"study\" = one row per trial (default). \"site\" = one row per trial site/facility — what site-selection and patient-recruitment buyers need. A single study averages 5 sites (max seen: 110), so site mode returns roughly 5x more billable rows for the same query.",
            "default": "study"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop after this many rows (studies, or sites if rowsPerStudy=\"site\"). Token-based paging has no offset wall.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}