ucsc-genome.md
135 lines · skills/database-lookup/references/ucsc-genome.md at 5f2bc03
UCSC Genome Browser REST API Reference
Raw lines 1 to 2Overview
Provides programmatic access to genome annotations, gene tracks, sequence data, and other resources from the UCSC Genome Browser database.
Raw lines 3 to 6Key Endpoints
Raw lines 16 to 17List available genomes
GET /list/ucscGenomesReturns all genome assemblies (hg38, mm39, etc.) with descriptions.
Raw lines 18 to 23List tracks for a genome
GET /list/tracks?genome=hg38Returns all annotation tracks available for the specified assembly.
Raw lines 24 to 29List chromosomes/contigs
GET /list/chromosomes?genome=hg38Optional: add &track=<trackName> to limit to chroms with data in that track.
List tables in a track
GET /list/schema?genome=hg38&track=knownGeneReturns table schema including field names, types, and SQL create statement.
Raw lines 36 to 41Get track data (annotations)
GET /getData/track?genome=hg38&track=knownGene&chrom=chr1&start=11873&end=14409Parameters:
genome-- assembly name (required)track-- track name (required)chrom-- chromosome (optional, limits to one chrom)start,end-- 0-based half-open coordinates (optional, requires chrom)maxItemsOutput-- limit number of items returned (default and maximum 1,000,000; still request a smaller bounded result)
Get sequence
GET /getData/sequence?genome=hg38&chrom=chr1&start=11873&end=11893Returns DNA sequence for the specified region. Coordinates are 0-based half-open.
Raw lines 53 to 58Search for a term
GET /search?search=BRCA1&genome=hg38Returns matching positions across tracks (gene names, accessions, etc.).
Raw lines 59 to 64Get hub genome data
GET /list/hubGenomes?hubUrl=<hubURL>Lists genomes available in a track hub.
Raw lines 65 to 70Example calls
Raw lines 71 to 72Get RefSeq gene annotations in a region
GET https://api.genome.ucsc.edu/getData/track?genome=hg38&track=ncbiRefSeq&chrom=chr17&start=43044295&end=43125483Raw lines 73 to 77Get DNA sequence
GET https://api.genome.ucsc.edu/getData/sequence?genome=hg38&chrom=chr7&start=117119148&end=117119178Raw lines 78 to 82Response example (sequence)
{
"genome": "hg38",
"chrom": "chr7",
"start": 117119148,
"end": 117119178,
"dna": "atgcagatatcagcgatgcagatcgatcg..."
}Raw lines 83 to 93Response example (track data)
{
"genome": "hg38",
"track": "ncbiRefSeq",
"chrom": "chr17",
"start": 43044295,
"end": 43125483,
"ncbiRefSeq": [
{
"chrom": "chr17",
"chromStart": 43044295,
"chromEnd": 43125483,
"name": "NM_007294.4",
"strand": "-",
"name2": "BRCA1",
"exonCount": 23,
"exonStarts": "43044295,43047642,...",
"exonEnds": "43045802,43047703,..."
}
]
}Raw lines 94 to 117Coordinate system
All coordinates are 0-based, half-open (standard BED format). This means start is inclusive and end is exclusive.
Rate Limits
- No published hard rate limits
- The API is intended for moderate programmatic use; bulk downloads should use the MySQL public server (genome-mysql.soe.ucsc.edu) or BigBed/BigWig file downloads
- Requests returning very large result sets may be truncated via
maxItemsOutput
Common genome values
hg38-- Human GRCh38 (current)hg19-- Human GRCh37mm39-- Mouse GRCm39mm10-- Mouse GRCm38dm6-- DrosophiladanRer11-- ZebrafishsacCer3-- Yeast