Skill Tracer
Skills › Scientific Agent Skills › database-lookup › cbioportal.md

cbioportal.md

202 lines · skills/database-lookup/references/cbioportal.md at 5f2bc03

Open on GitHub
1# cBioPortal API
2

cBioPortal API

Raw lines 1 to 2
3## Base URL
4```
5https://www.cbioportal.org/api
6```
7

Base URL

https://www.cbioportal.org/api
Raw lines 3 to 7
8## Auth
9No authentication for the public instance. Private/institutional instances (e.g. `genie.cbioportal.org`) require a data access token via `Authorization: Bearer <token>` header.

Auth

No authentication for the public instance. Private/institutional instances (e.g. genie.cbioportal.org) require a data access token via Authorization: Bearer <token> header.

Raw lines 8 to 10
11## Common Headers
12```
13Accept: application/json
14Content-Type: application/json
15```

Common Headers

Accept: application/json
Content-Type: application/json
Raw lines 11 to 16
17## Common Query Parameters
19Most list endpoints support these:
21| Parameter | Type | Description | Default |
22|---|---|---|---|
23| `projection` | string | Detail level: `ID`, `SUMMARY`, `DETAILED`, `META` | `SUMMARY` |
24| `pageNumber` | int | Zero-based page index | `0` |
25| `pageSize` | int | Results per page; explicitly request a bounded size | Route-dependent, often `10000000` |
26| `sortBy` | string | Property to sort by | varies |
27| `direction` | string | `ASC` or `DESC` | `ASC` |

Common Query Parameters

Most list endpoints support these:

ParameterTypeDescriptionDefault
projectionstringDetail level: ID, SUMMARY, DETAILED, METASUMMARY
pageNumberintZero-based page index0
pageSizeintResults per page; explicitly request a bounded sizeRoute-dependent, often 10000000
sortBystringProperty to sort byvaries
directionstringASC or DESCASC
Raw lines 17 to 28
29## Key Endpoints

Key Endpoints

Raw lines 29 to 30
31### Studies
33| Method | Endpoint | Description |
34|---|---|---|
35| GET | `/studies` | List all cancer studies |
36| GET | `/studies/{studyId}` | Get a single study |
37| POST | `/studies/fetch` | Fetch multiple studies by ID |
39Example:
40```
41GET https://www.cbioportal.org/api/studies?projection=SUMMARY&pageSize=10
42GET https://www.cbioportal.org/api/studies/brca_tcga
43```
45Response fields: `studyId`, `name`, `description`, `cancerTypeId`, `pmid`, `citation`, `allSampleCount`, `referenceGenome`, `publicStudy`, `importDate`

Studies

MethodEndpointDescription
GET/studiesList all cancer studies
GET/studies/{studyId}Get a single study
POST/studies/fetchFetch multiple studies by ID

Example:

GET https://www.cbioportal.org/api/studies?projection=SUMMARY&pageSize=10
GET https://www.cbioportal.org/api/studies/brca_tcga

Response fields: studyId, name, description, cancerTypeId, pmid, citation, allSampleCount, referenceGenome, publicStudy, importDate

Raw lines 31 to 46
47### Cancer Types
49| Method | Endpoint | Description |
50|---|---|---|
51| GET | `/cancer-types` | List all cancer types |
52| GET | `/cancer-types/{cancerTypeId}` | Get one cancer type |
54Response fields: `cancerTypeId`, `name`, `shortName`, `dedicatedColor`, `parent`

Cancer Types

MethodEndpointDescription
GET/cancer-typesList all cancer types
GET/cancer-types/{cancerTypeId}Get one cancer type

Response fields: cancerTypeId, name, shortName, dedicatedColor, parent

Raw lines 47 to 55
56### Genes
58| Method | Endpoint | Description |
59|---|---|---|
60| GET | `/genes` | List all genes (paginated) |
61| GET | `/genes/{geneId}` | Gene by Hugo symbol or Entrez ID |
62| GET | `/genes/{geneId}/aliases` | Gene aliases |
63| POST | `/genes/fetch` | Fetch multiple genes |
65Example:
66```
67GET https://www.cbioportal.org/api/genes/TP53
68```
69Response: `{"entrezGeneId": 7157, "hugoGeneSymbol": "TP53", "type": "protein-coding"}`

Genes

MethodEndpointDescription
GET/genesList all genes (paginated)
GET/genes/{geneId}Gene by Hugo symbol or Entrez ID
GET/genes/{geneId}/aliasesGene aliases
POST/genes/fetchFetch multiple genes

Example:

GET https://www.cbioportal.org/api/genes/TP53

Response: {"entrezGeneId": 7157, "hugoGeneSymbol": "TP53", "type": "protein-coding"}

Raw lines 56 to 70
71### Molecular Profiles
73| Method | Endpoint | Description |
74|---|---|---|
75| GET | `/molecular-profiles` | All profiles across all studies |
76| GET | `/studies/{studyId}/molecular-profiles` | Profiles in a study |
77| GET | `/molecular-profiles/{molecularProfileId}` | Single profile |
79Profile types (`molecularAlterationType`): `MUTATION_EXTENDED`, `COPY_NUMBER_ALTERATION`, `MRNA_EXPRESSION`, `PROTEIN_LEVEL`, `METHYLATION`
81Example:
82```
83GET https://www.cbioportal.org/api/studies/brca_tcga/molecular-profiles
84```

Molecular Profiles

MethodEndpointDescription
GET/molecular-profilesAll profiles across all studies
GET/studies/{studyId}/molecular-profilesProfiles in a study
GET/molecular-profiles/{molecularProfileId}Single profile

Profile types (molecularAlterationType): MUTATION_EXTENDED, COPY_NUMBER_ALTERATION, MRNA_EXPRESSION, PROTEIN_LEVEL, METHYLATION

Example:

GET https://www.cbioportal.org/api/studies/brca_tcga/molecular-profiles
Raw lines 71 to 85
86### Mutations
88| Method | Endpoint | Description |
89|---|---|---|
90| GET | `/molecular-profiles/{profileId}/mutations` | Mutations in a profile |
91| POST | `/molecular-profiles/{profileId}/mutations/fetch` | Filtered mutation query |
92| POST | `/mutations/fetch` | Multi-profile mutation fetch |
94Parameters for GET:
95| Parameter | Type | Description |
96|---|---|---|
97| `sampleListId` | string | Required: sample list to query (e.g. `brca_tcga_all`) |
98| `entrezGeneId` | int | Required: filter by gene |
99| `projection` | string | `SUMMARY`, `DETAILED`, `ID`, `META` |
101Example — TP53 mutations in TCGA breast cancer:
102```
103GET https://www.cbioportal.org/api/molecular-profiles/brca_tcga_mutations/mutations?sampleListId=brca_tcga_all&entrezGeneId=7157&projection=DETAILED
104```
106POST body for `/molecular-profiles/{profileId}/mutations/fetch` (multi-gene, single profile; `/mutations/fetch` uses a different multi-study schema):
107```json
109 "sampleListId": "brca_tcga_all",
110 "entrezGeneIds": [7157, 672]
112```
114Response fields: `entrezGeneId`, `sampleId`, `patientId`, `proteinChange`, `mutationType`, `mutationStatus`, `chr`, `startPosition`, `endPosition`, `referenceAllele`, `variantAllele`, `variantType`, `ncbiBuild`, `tumorAltCount`, `tumorRefCount`

Mutations

MethodEndpointDescription
GET/molecular-profiles/{profileId}/mutationsMutations in a profile
POST/molecular-profiles/{profileId}/mutations/fetchFiltered mutation query
POST/mutations/fetchMulti-profile mutation fetch

Parameters for GET:

ParameterTypeDescription
sampleListIdstringRequired: sample list to query (e.g. brca_tcga_all)
entrezGeneIdintRequired: filter by gene
projectionstringSUMMARY, DETAILED, ID, META

Example — TP53 mutations in TCGA breast cancer:

GET https://www.cbioportal.org/api/molecular-profiles/brca_tcga_mutations/mutations?sampleListId=brca_tcga_all&entrezGeneId=7157&projection=DETAILED

POST body for /molecular-profiles/{profileId}/mutations/fetch (multi-gene, single profile; /mutations/fetch uses a different multi-study schema):

{
  "sampleListId": "brca_tcga_all",
  "entrezGeneIds": [7157, 672]
}

Response fields: entrezGeneId, sampleId, patientId, proteinChange, mutationType, mutationStatus, chr, startPosition, endPosition, referenceAllele, variantAllele, variantType, ncbiBuild, tumorAltCount, tumorRefCount

Raw lines 86 to 115
116### Copy Number Alterations
118| Method | Endpoint | Description |
119|---|---|---|
120| GET | `/molecular-profiles/{profileId}/discrete-copy-number` | CNA data |
121| POST | `/molecular-profiles/{profileId}/discrete-copy-number/fetch` | Filtered CNA query |

Copy Number Alterations

MethodEndpointDescription
GET/molecular-profiles/{profileId}/discrete-copy-numberCNA data
POST/molecular-profiles/{profileId}/discrete-copy-number/fetchFiltered CNA query
Raw lines 116 to 122
123### Molecular Data (expression, methylation)
125| Method | Endpoint | Description |
126|---|---|---|
127| GET | `/molecular-profiles/{profileId}/molecular-data` | Expression/methylation data |
128| POST | `/molecular-data/fetch` | Multi-profile molecular data fetch |

Molecular Data (expression, methylation)

MethodEndpointDescription
GET/molecular-profiles/{profileId}/molecular-dataExpression/methylation data
POST/molecular-data/fetchMulti-profile molecular data fetch
Raw lines 123 to 129
130### Clinical Data
132| Method | Endpoint | Description |
133|---|---|---|
134| GET | `/studies/{studyId}/clinical-data` | Clinical data for a study |
135| POST | `/clinical-data/fetch` | Multi-study clinical data |
136| GET | `/studies/{studyId}/clinical-attributes` | Available clinical attributes |
138Parameters for GET:
139| Parameter | Type | Description |
140|---|---|---|
141| `clinicalDataType` | string | `PATIENT` or `SAMPLE` |
142| `attributeId` | string | e.g. `OS_STATUS`, `OS_MONTHS`, `CANCER_TYPE` |
144Example:
145```
146GET https://www.cbioportal.org/api/studies/brca_tcga/clinical-data?clinicalDataType=PATIENT&attributeId=OS_STATUS&projection=SUMMARY
147```

Clinical Data

MethodEndpointDescription
GET/studies/{studyId}/clinical-dataClinical data for a study
POST/clinical-data/fetchMulti-study clinical data
GET/studies/{studyId}/clinical-attributesAvailable clinical attributes

Parameters for GET:

ParameterTypeDescription
clinicalDataTypestringPATIENT or SAMPLE
attributeIdstringe.g. OS_STATUS, OS_MONTHS, CANCER_TYPE

Example:

GET https://www.cbioportal.org/api/studies/brca_tcga/clinical-data?clinicalDataType=PATIENT&attributeId=OS_STATUS&projection=SUMMARY
Raw lines 130 to 148
149### Patients & Samples
151| Method | Endpoint | Description |
152|---|---|---|
153| GET | `/studies/{studyId}/patients` | Patients in a study |
154| GET | `/studies/{studyId}/samples` | Samples in a study |
155| POST | `/patients/fetch` | Multi-study patient fetch |
156| POST | `/samples/fetch` | Multi-study sample fetch |

Patients & Samples

MethodEndpointDescription
GET/studies/{studyId}/patientsPatients in a study
GET/studies/{studyId}/samplesSamples in a study
POST/patients/fetchMulti-study patient fetch
POST/samples/fetchMulti-study sample fetch
Raw lines 149 to 157
158### Sample Lists
160| Method | Endpoint | Description |
161|---|---|---|
162| GET | `/studies/{studyId}/sample-lists` | Predefined sample groups |
163| GET | `/sample-lists/{sampleListId}` | Single sample list |

Sample Lists

MethodEndpointDescription
GET/studies/{studyId}/sample-listsPredefined sample groups
GET/sample-lists/{sampleListId}Single sample list
Raw lines 158 to 164
165### Gene Panels
167| Method | Endpoint | Description |
168|---|---|---|
169| GET | `/gene-panels` | All gene panels |
170| GET | `/gene-panels/{genePanelId}` | Panel details with gene list |
171| POST | `/gene-panel-data/fetch` | Which panels cover which samples |

Gene Panels

MethodEndpointDescription
GET/gene-panelsAll gene panels
GET/gene-panels/{genePanelId}Panel details with gene list
POST/gene-panel-data/fetchWhich panels cover which samples
Raw lines 165 to 172
173### API surface and versions
175Use the public OpenAPI schema at `https://www.cbioportal.org/api/v3/api-docs/public` for the selected instance. The current public schema does not expose `/treatments/patient`, `/treatments/sample`, or a global `/discrete-copy-number/fetch`; do not infer these routes from internal UI requests or older installations.

API surface and versions

Use the public OpenAPI schema at https://www.cbioportal.org/api/v3/api-docs/public for the selected instance. The current public schema does not expose /treatments/patient, /treatments/sample, or a global /discrete-copy-number/fetch; do not infer these routes from internal UI requests or older installations.

Raw lines 173 to 176
177### System
179| Method | Endpoint | Description |
180|---|---|---|
181| GET | `/health` | Server health check |
182| GET | `/info` | Portal version, DB schema version |

System

MethodEndpointDescription
GET/healthServer health check
GET/infoPortal version, DB schema version
Raw lines 177 to 183
184## Typical Workflow
1861. **Find studies**: `GET /studies` — browse available cancer studies, get `studyId` values
1872. **Get molecular profiles**: `GET /studies/{studyId}/molecular-profiles` — find profile IDs (e.g. `brca_tcga_mutations`, `brca_tcga_gistic`)
1883. **Get sample lists**: `GET /studies/{studyId}/sample-lists` — find sample list IDs (e.g. `brca_tcga_all`, `brca_tcga_sequenced`)
1894. **Query data**: Use the profile ID and sample list ID to fetch mutations, CNA, expression, or clinical data

Typical Workflow

  1. Find studies: GET /studies — browse available cancer studies, get studyId values
  2. Get molecular profiles: GET /studies/{studyId}/molecular-profiles — find profile IDs (e.g. brca_tcga_mutations, brca_tcga_gistic)
  3. Get sample lists: GET /studies/{studyId}/sample-lists — find sample list IDs (e.g. brca_tcga_all, brca_tcga_sequenced)
  4. Query data: Use the profile ID and sample list ID to fetch mutations, CNA, expression, or clinical data
Raw lines 184 to 190
191## Rate Limits
193No published rate limits. Be courteous — avoid hammering with many concurrent requests. For bulk data needs, cBioPortal offers downloadable datasets at https://docs.cbioportal.org/downloads/.

Rate Limits

No published rate limits. Be courteous — avoid hammering with many concurrent requests. For bulk data needs, cBioPortal offers downloadable datasets at https://docs.cbioportal.org/downloads/.

Raw lines 191 to 194
195## Tips
197- **Study IDs** follow a pattern: `{cancer_type}_{source}` (e.g. `brca_tcga`, `luad_tcga`, `prad_mskcc_2017`)
198- **Molecular profile IDs** extend the study ID: `{studyId}_mutations`, `{studyId}_gistic`, `{studyId}_rna_seq_v2_mrna`
199- Use `projection=DETAILED` to get the richest response including nested objects
200- POST `/fetch` endpoints are for batch queries across multiple studies, genes, or samples — they're the most flexible way to query
201- Gene lookup accepts both Hugo symbols (`TP53`) and Entrez IDs (`7157`)
202- The Swagger UI at https://www.cbioportal.org/api/swagger-ui/index.html documents every endpoint interactively

Tips

  • Study IDs follow a pattern: {cancer_type}_{source} (e.g. brca_tcga, luad_tcga, prad_mskcc_2017)
  • Molecular profile IDs extend the study ID: {studyId}_mutations, {studyId}_gistic, {studyId}_rna_seq_v2_mrna
  • Use projection=DETAILED to get the richest response including nested objects
  • POST /fetch endpoints are for batch queries across multiple studies, genes, or samples — they're the most flexible way to query
  • Gene lookup accepts both Hugo symbols (TP53) and Entrez IDs (7157)
  • The Swagger UI at https://www.cbioportal.org/api/swagger-ui/index.html documents every endpoint interactively
Raw lines 195 to 202