{
  "openapi": "3.0.1",
  "info": {
    "title": "ClinicalTrials.gov API v2 — Trials & Contacts",
    "description": "Official NIH ClinicalTrials.gov REST API v2 scraper & MCP tool. Free count mode, URL/NCT lookup, central & site contact emails/phones, sponsors, phases, eligibility & results. $5/1k, zero proxy.",
    "version": "1.0",
    "x-build-id": "WfKb5dmhzM4pGYpPG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yannabadie~clinical-trials-api-mcp/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yannabadie-clinical-trials-api-mcp",
        "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/yannabadie~clinical-trials-api-mcp/runs": {
      "post": {
        "operationId": "runs-sync-yannabadie-clinical-trials-api-mcp",
        "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/yannabadie~clinical-trials-api-mcp/run-sync": {
      "post": {
        "operationId": "run-sync-yannabadie-clinical-trials-api-mcp",
        "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": {
          "mode": {
            "title": "Operation Mode",
            "enum": [
              "search",
              "count",
              "lookup_ncts"
            ],
            "type": "string",
            "description": "Search studies ('search'), preview exact match count for FREE ('count' — 0 trial charges), or fetch specific NCT IDs ('lookup_ncts').",
            "default": "search"
          },
          "startUrl": {
            "title": "ClinicalTrials.gov Search or Study URL (optional)",
            "type": "string",
            "description": "Paste any https://clinicaltrials.gov/search?... URL or single study page (https://clinicaltrials.gov/study/NCT...) to auto-extract its filters or NCT ID.",
            "default": ""
          },
          "condition": {
            "title": "Condition or Disease",
            "type": "string",
            "description": "Disease or medical condition (e.g. 'diabetes', 'non-small cell lung cancer', 'alzheimer').",
            "default": ""
          },
          "intervention": {
            "title": "Intervention / Drug / Therapy",
            "type": "string",
            "description": "Drug name, biologic, device, or procedure (e.g. 'pembrolizumab', 'GLP-1', 'CRISPR').",
            "default": ""
          },
          "sponsor": {
            "title": "Lead Sponsor or Collaborator",
            "type": "string",
            "description": "Pharmaceutical company, university, or institution (e.g. 'Eli Lilly', 'Pfizer', 'INSERM').",
            "default": ""
          },
          "location": {
            "title": "Location (Country, State, or City)",
            "type": "string",
            "description": "Filter trials with study sites in this country, state, or city (e.g. 'France', 'United States', 'Boston').",
            "default": ""
          },
          "queryTerm": {
            "title": "Additional Keywords or Essie Query (optional)",
            "type": "string",
            "description": "Free-text keywords or ClinicalTrials.gov Essie expression matched across all study fields.",
            "default": ""
          },
          "nctIds": {
            "title": "NCT IDs (for lookup_ncts mode)",
            "type": "array",
            "description": "List of NCT identifiers (e.g. ['NCT07900633', 'NCT06694935']).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "overallStatus": {
            "title": "Recruitment Status",
            "type": "array",
            "description": "Filter by study recruitment status. Leave empty for all statuses.",
            "items": {
              "type": "string",
              "enum": [
                "RECRUITING",
                "NOT_YET_RECRUITING",
                "ACTIVE_NOT_RECRUITING",
                "ENROLLING_BY_INVITATION",
                "COMPLETED",
                "SUSPENDED",
                "TERMINATED",
                "WITHDRAWN"
              ]
            },
            "default": [
              "RECRUITING"
            ]
          },
          "phases": {
            "title": "Study Phases",
            "type": "array",
            "description": "Filter interventional studies by phase (e.g. ['PHASE2', 'PHASE3']). Leave empty for all phases.",
            "items": {
              "type": "string",
              "enum": [
                "EARLY_PHASE1",
                "PHASE1",
                "PHASE2",
                "PHASE3",
                "PHASE4",
                "NA"
              ]
            },
            "default": []
          },
          "studyType": {
            "title": "Study Type",
            "enum": [
              "",
              "INTERVENTIONAL",
              "OBSERVATIONAL",
              "EXPANDED_ACCESS"
            ],
            "type": "string",
            "description": "Restrict to Interventional, Observational, or Expanded Access studies.",
            "default": ""
          },
          "funderType": {
            "title": "Lead Sponsor / Funder Class",
            "enum": [
              "",
              "INDUSTRY",
              "NIH",
              "FED",
              "OTHER"
            ],
            "type": "string",
            "description": "Filter by funder organization type.",
            "default": ""
          },
          "hasResults": {
            "title": "Results Posted Filter",
            "enum": [
              "",
              "true",
              "false"
            ],
            "type": "string",
            "description": "Keep only trials with posted results, without posted results, or all.",
            "default": ""
          },
          "updatedSince": {
            "title": "Last Updated On or After (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional ISO date (YYYY-MM-DD) for incremental daily/weekly trial monitoring via AREA[LastUpdatePostDate].",
            "default": ""
          },
          "sort": {
            "title": "Sort Order",
            "enum": [
              "@relevance",
              "LastUpdatePostDate:desc",
              "StudyFirstPostDate:desc",
              "EnrollmentCount:desc"
            ],
            "type": "string",
            "description": "Sort results by relevance, newest updates, first posted date, or target enrollment.",
            "default": "LastUpdatePostDate:desc"
          },
          "maxResults": {
            "title": "Maximum Trials to Extract",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on output trials to control spend (1 to 10,000).",
            "default": 25
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}