API Info

Overview

OncoKB™ data can be accessed through the OncoKB™ REST API. The full interactive API reference is available on the Swagger page.

Authentication

Send your OncoKB™ API token in the Authorization request header:

Authorization: Bearer [your token]

Your token is available in Account Settings after your account is approved. If you do not see a token, then follow instructions on the page to request API access.

See the Data Access page for account and license information.

Instances

Instance
Authentication
Use case

https://www.oncokb.org

Required

Production use and the complete OncoKB™ data

https://public.api.oncokb.org

Not required

Public API access across all genes, excluding therapeutic data

https://demo.oncokb.org

Not required

Trial and integration testing with full data for BRAF, TP53, and ROS1

All instances use the latest OncoKB™ data version. See OncoKB News for data release notes.

Endpoint Quick Reference

lightbulb

Somatic Annotation

Method
Endpoint
Primary input

GET / POST

/api/v1/annotate/mutations/byProteinChange

Gene and protein change

GET / POST

/api/v1/annotate/mutations/byGenomicChange

TCGA MAF-style genomic location

GET / POST

/api/v1/annotate/mutations/byHGVSg

HGVS genomic expression

GET / POST

/api/v1/annotate/copyNumberAlterations

Gene and copy number alteration type

GET / POST

/api/v1/annotate/structuralVariants

Use this endpoint for fusion annotation when you have a gene pair, or for other structural variant annotations.

Germline Annotation

Method
Endpoint
Primary input

GET / POST

/api/v1/annotate/germline/mutations/byGenomicChange

TCGA MAF-style genomic location

GET / POST

/api/v1/annotate/germline/mutations/byHGVSg

HGVS genomic expression

GET / POST

/api/v1/annotate/germline/mutations/byHGVSc

HGVS coding DNA expression

Common Parameters

The same parameter names are used across many annotation endpoints. Endpoint-specific tables below this section show which parameters are accepted and whether they are required for that endpoint.

Parameter
Description

referenceGenome

Reference genome build. Supported values are GRCh37 and GRCh38. Default: GRCh37.

tumorType

See OncoTree for available tumor types. The field supports OncoTree code, OncoTree name (subtype), and OncoTree main type. Example values include MEL or Melanoma

hugoSymbol

HUGO gene symbol. When an endpoint accepts gene identifiers, provide either hugoSymbol or entrezGeneId. If both are provided, then entrezGeneId takes priority. Example: BRAF.

entrezGeneId

Entrez gene ID. Use this instead of hugoSymbol when you prefer a numeric gene identifier. Example: 673 for BRAF.

consequence

Sequence ontology consequence. Example: missense_variant

genomicLocation

TCGA MAF-style genomic location in chromosome,start,end,ref,var format. Example: 7,140453136,140453136,A,T.

hgvsg

HGVS genomic expression. Example: 7:g.140453136A>T.

hgvsc

HGVS coding DNA expression. Example: EGFR:c.2369C>T.

Somatic Annotation Endpoints

Annotate Mutations by Protein Change

GET https://www.oncokb.org/api/v1/annotate/mutations/byProteinChange

Use this endpoint when you have a gene and protein-level alteration, including atypical alterations.

Parameter
Required
Type
Description

hugoSymbol

Conditional

string

Required if entrezGeneId is not provided. Example: BRAF.

entrezGeneId

Conditional

integer

Required if hugoSymbol is not provided. Example: 673.

alteration

No

string

Protein change, supported atypical alteration, or umbrella term. Example: V600E, Truncating Mutations, TMB-H

referenceGenome

No

string

Supported values are GRCh37 and GRCh38. Default: GRCh37.

consequence

No

string

Sequence ontology consequence. Example: missense_variant.

proteinStart

No

integer

Protein start position. Example: 600.

proteinEnd

No

integer

Protein end position. Example: 600.

tumorType

No

string

See Common Parameters. Example: Melanoma.

Demo:

Batch request:

Atypical Alterations

Use the somatic protein change endpoint for atypical alterations. Examples of atypical alterations, but not limited to:

Examples:

Annotate Mutations by Genomic Change

GET https://www.oncokb.org/api/v1/annotate/mutations/byGenomicChange

Use this endpoint when you have chromosome, start, end, reference allele, and variant allele.

Parameter
Required
Type
Description

genomicLocation

Yes

string

TCGA MAF-style genomic location in chromosome,start,end,ref,var format. Example: 7,140453136,140453136,A,T.

referenceGenome

No

string

Supported values are GRCh37 and GRCh38. Default: GRCh37.

tumorType

No

string

Batch request:

Annotate Mutations by HGVSg

GET https://www.oncokb.org/api/v1/annotate/mutations/byHGVSg

Use this endpoint when you have an HGVS genomic expression.

Parameter
Required
Type
Description

hgvsg

Yes

string

HGVS genomic expression. Example: 7:g.140453136A>T.

referenceGenome

No

string

Supported values are GRCh37 and GRCh38. Default: GRCh37.

tumorType

No

string

Batch request:

Annotate Copy Number Alterations

GET https://www.oncokb.org/api/v1/annotate/copyNumberAlterations

Parameter
Required
Type
Description

hugoSymbol

Conditional

string

Required if entrezGeneId is not provided. Example: BRAF.

entrezGeneId

Conditional

integer

Required if hugoSymbol is not provided. Example: 673.

copyNameAlterationType

Yes

string

One of AMPLIFICATION, DELETION, GAIN, LOSS.

referenceGenome

No

string

Supported values are GRCh37 and GRCh38. Default: GRCh37.

tumorType

No

string

Batch request:

Annotate Structural Variants

GET https://www.oncokb.org/api/v1/annotate/structuralVariants

Use this endpoint for fusion annotation when you have a gene pair, or for other structural variant annotations.

Parameter
Required
Type
Description

hugoSymbolA

No

string

First gene symbol

entrezGeneIdA

No

integer

First Entrez gene ID. Not required when hugoSymbolA is passed

hugoSymbolB

No

string

Second gene symbol. For intragenic events, this field can be omitted or set to the same as hugoSymbolA. For fusions, specify the gene partner here.

entrezGeneIdB

No

integer

Second Entrez gene ID. Not required when hugoSymbolB is passed

structuralVariantType

Yes

string

One of DELETION, TRANSLOCATION, DUPLICATION, INSERTION, INVERSION, FUSION, UNKNOWN.

isFunctionalFusion

Yes

boolean

Whether the event is a functional fusion. Set to true when annotating fusions.

referenceGenome

No

string

Supported values are GRCh37 and GRCh38. Default: GRCh37.

tumorType

No

string

Batch request:

Germline Annotation Endpoints

Annotate Germline Mutations by Genomic Change

GET https://www.oncokb.org/api/v1/annotate/germline/mutations/byGenomicChange

Parameter
Required
Type
Description

genomicLocation

Yes

string

TCGA MAF-style genomic location in chromosome,start,end,ref,var format. Example: 7,140453136,140453136,A,T.

referenceGenome

No

string

Supported values are GRCh37 and GRCh38. Default: GRCh37.

tumorType

No

string

Batch request:

Annotate Germline Mutations by HGVSg

GET https://www.oncokb.org/api/v1/annotate/germline/mutations/byHGVSg

Parameter
Required
Type
Description

hgvsg

Yes

string

HGVS genomic expression. Example: 7:g.140453136A>T.

referenceGenome

No

string

Supported values are GRCh37 and GRCh38. Default: GRCh37.

tumorType

No

string

Batch request:

Annotate Germline Mutations by HGVSc

GET https://www.oncokb.org/api/v1/annotate/germline/mutations/byHGVSc

Parameter
Required
Type
Description

hgvsc

Yes

string

HGVS coding DNA expression. Example: EGFR:c.2369C>T.

referenceGenome

No

string

Supported values are GRCh37 and GRCh38. Default: GRCh37.

tumorType

No

string

Batch request:

Annotate Germline Mutations by HGVSp (Protein Change)

Common Use Cases

Use case
Example request

Missense mutation in an oncogene

https://demo.oncokb.org/api/v1/annotate/mutations/byProteinChange?hugoSymbol=BRAF&alteration=V600E&tumorType=Melanoma

Missense mutation in a tumor suppressor

https://demo.oncokb.org/api/v1/annotate/mutations/byProteinChange?hugoSymbol=TP53&alteration=R273C&tumorType=Colon%20Adenocarcinoma

In-frame deletion

https://demo.oncokb.org/api/v1/annotate/mutations/byProteinChange?hugoSymbol=BRAF&alteration=N486_P490del&tumorType=Histiocytosis

Fusion

https://demo.oncokb.org/api/v1/annotate/structuralVariants?hugoSymbolA=CD74&hugoSymbolB=ROS1&structuralVariantType=FUSION&isFunctionalFusion=true&tumorType=Lung%20Adenocarcinoma

Important Notes

  • For CDKN2A isoforms, use the following values for the hugoSymbol parameter:

    When no isoform suffix is provided, CDKN2A defaults to p16.

Notes and Changelog

  • The evidenceType parameter is deprecated and not recommended for use. It was marked deprecated as of OncoKB software version v3.24.0 (December 19, 2024) and may be removed in a future release.

Annotating MAF/VCF

For MAF files, use the OncoKB Annotator. The OncoKB Annotator is a Python command-line script that wraps the OncoKB REST API and streamlines annotation of MAF files. It handles reading input variants, calling the appropriate OncoKB annotation endpoints, and writing annotated MAF output.

Since OncoKB Annotator only supports MAF files, one option is to use genome-nexus/vcf2maf-lite.

Last updated