{
  "openapi": "3.0.1",
  "info": {
    "title": "cBioPortal Cancer Genomics Extractor",
    "description": "Point at ANY cBioPortal instance (the MSKCC flagship, BCGSC, GENIE, institutional mirrors) and pull cancer-genomics metadata: studies, the OncoTree cancer-type taxonomy, molecular profiles, and genes. One actor, the whole cBioPortal REST API, every row lossless.",
    "version": "0.1",
    "x-build-id": "NZrMpDu1g5P2hcd2q"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamule~cbioportal-cancer-genomics-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamule-cbioportal-cancer-genomics-extractor",
        "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~cbioportal-cancer-genomics-extractor/runs": {
      "post": {
        "operationId": "runs-sync-datamule-cbioportal-cancer-genomics-extractor",
        "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~cbioportal-cancer-genomics-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-datamule-cbioportal-cancer-genomics-extractor",
        "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": {
          "server": {
            "title": "cBioPortal base URL",
            "type": "string",
            "description": "The base URL of ANY cBioPortal instance. ONE actor speaks to all of them — the MSKCC public flagship (https://www.cbioportal.org), the BC Genome Sciences Centre mirror (https://cbioportal.bcgsc.ca), GENIE, and dozens of institutional deployments, because every install exposes the identical Swagger-generated REST API. You can pass the bare host, an https URL, a proxied path prefix, or a URL ending in /api — the actor normalises it. Required unless you use \"Servers\" below."
          },
          "servers": {
            "title": "Servers (query several instances at once)",
            "type": "array",
            "description": "Optional: run the SAME mode across multiple cBioPortal instances at once (the flagship plus institutional mirrors, say). Each output row is tagged with its _server. Use this OR the single \"cBioPortal base URL\" above (at least one is required). A server that is unreachable, auth-gated (401/403), or returns a non-JSON body is skipped with a warning and the batch continues; if EVERY server is skipped the run fails fast.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "What to extract",
            "enum": [
              "studies",
              "cancerTypes",
              "study-detail",
              "molecular-profiles",
              "genes"
            ],
            "type": "string",
            "description": "Which cBioPortal collection to pull. 'studies' = one row per cancer study (the default). 'cancerTypes' = the portal's cancer-type / OncoTree taxonomy. 'study-detail' = the DETAILED record (all per-datatype sample counts) for the one study named in 'Study ID'. 'molecular-profiles' = molecular profiles, either portal-wide or (if 'Study ID' is set) for one study. 'genes' = the portal's gene table (Entrez ID + HUGO symbol).",
            "default": "studies"
          },
          "studyId": {
            "title": "Study ID",
            "type": "string",
            "description": "A cBioPortal study identifier, e.g. 'acbc_mskcc_2015' or 'brca_tcga_pan_can_atlas_2018'. REQUIRED for mode 'study-detail'. OPTIONAL for mode 'molecular-profiles' — when set, only that study's profiles are returned; when empty, the portal-wide profile list is returned. Ignored for the other modes."
          },
          "pageSize": {
            "title": "Page size",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "How many records to request per API page (default 500). cBioPortal honours pageSize everywhere; the actor paginates defensively and de-duplicates, so this mainly tunes request size. Larger pages = fewer round-trips."
          },
          "maxRecords": {
            "title": "Max records (global cap)",
            "minimum": 1,
            "type": "integer",
            "description": "A GLOBAL cap on the number of rows emitted across ALL servers (each row is one billable event). Reached mid-collection, the run stops deterministically. Leave empty to emit the entire collection from every reachable server. Useful to keep a first test run cheap."
          },
          "userAgent": {
            "title": "User-Agent override",
            "type": "string",
            "description": "Optional override for the request User-Agent. A descriptive User-Agent is sent by default — some data centres throttle or reject a blank / generic UA. Only override if a specific instance asks you to identify differently."
          },
          "timeoutSecs": {
            "title": "Read timeout (seconds)",
            "minimum": 1,
            "maximum": 900,
            "type": "integer",
            "description": "How long to wait for the server to answer each request (default 120). Large gene / study lists can be slow; servers also enforce their own timeouts."
          },
          "bearer": {
            "title": "Bearer token",
            "type": "string",
            "description": "Optional bearer token for an auth-gated cBioPortal deployment (sent as Authorization: Bearer ***). NOT required for the public flagship or BCGSC. Never logged."
          },
          "extraHeaders": {
            "title": "Extra request headers",
            "type": "object",
            "description": "Optional extra HTTP headers as a JSON object, e.g. {\"X-Api-Key\": \"...\"} for a gateway-fronted instance. Not required for public servers. Header values are never logged."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}