Skill Tracer
Skills › Scientific Agent Skills › database-lookup › ucsc-genome.md

ucsc-genome.md

135 lines · skills/database-lookup/references/ucsc-genome.md at 5f2bc03

Open on GitHub
1# UCSC Genome Browser REST API Reference
2

UCSC Genome Browser REST API Reference

Raw lines 1 to 2
3## Overview
4Provides programmatic access to genome annotations, gene tracks, sequence data,
5and other resources from the UCSC Genome Browser database.
6

Overview

Provides programmatic access to genome annotations, gene tracks, sequence data, and other resources from the UCSC Genome Browser database.

Raw lines 3 to 6
7## Base URL
8`https://api.genome.ucsc.edu`
9

Base URL

https://api.genome.ucsc.edu

Raw lines 7 to 9
10## Auth
11None required (public, unauthenticated).

Auth

None required (public, unauthenticated).

Raw lines 10 to 12
13## Response Format
14JSON for all endpoints.

Response Format

JSON for all endpoints.

Raw lines 13 to 15
16## Key Endpoints

Key Endpoints

Raw lines 16 to 17
18### List available genomes
19```
20GET /list/ucscGenomes
21```
22Returns all genome assemblies (hg38, mm39, etc.) with descriptions.

List available genomes

GET /list/ucscGenomes

Returns all genome assemblies (hg38, mm39, etc.) with descriptions.

Raw lines 18 to 23
24### List tracks for a genome
25```
26GET /list/tracks?genome=hg38
27```
28Returns all annotation tracks available for the specified assembly.

List tracks for a genome

GET /list/tracks?genome=hg38

Returns all annotation tracks available for the specified assembly.

Raw lines 24 to 29
30### List chromosomes/contigs
31```
32GET /list/chromosomes?genome=hg38
33```
34Optional: add `&track=<trackName>` to limit to chroms with data in that track.

List chromosomes/contigs

GET /list/chromosomes?genome=hg38

Optional: add &track=<trackName> to limit to chroms with data in that track.

Raw lines 30 to 35
36### List tables in a track
37```
38GET /list/schema?genome=hg38&track=knownGene
39```
40Returns table schema including field names, types, and SQL create statement.

List tables in a track

GET /list/schema?genome=hg38&track=knownGene

Returns table schema including field names, types, and SQL create statement.

Raw lines 36 to 41
42### Get track data (annotations)
43```
44GET /getData/track?genome=hg38&track=knownGene&chrom=chr1&start=11873&end=14409
45```
46Parameters:
47- `genome` -- assembly name (required)
48- `track` -- track name (required)
49- `chrom` -- chromosome (optional, limits to one chrom)
50- `start`, `end` -- 0-based half-open coordinates (optional, requires chrom)
51- `maxItemsOutput` -- limit number of items returned (default and maximum 1,000,000; still request a smaller bounded result)

Get track data (annotations)

GET /getData/track?genome=hg38&track=knownGene&chrom=chr1&start=11873&end=14409

Parameters:

  • 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)
Raw lines 42 to 52
53### Get sequence
54```
55GET /getData/sequence?genome=hg38&chrom=chr1&start=11873&end=11893
56```
57Returns DNA sequence for the specified region. Coordinates are 0-based half-open.

Get sequence

GET /getData/sequence?genome=hg38&chrom=chr1&start=11873&end=11893

Returns DNA sequence for the specified region. Coordinates are 0-based half-open.

Raw lines 53 to 58
59### Search for a term
60```
61GET /search?search=BRCA1&genome=hg38
62```
63Returns matching positions across tracks (gene names, accessions, etc.).

Search for a term

GET /search?search=BRCA1&genome=hg38

Returns matching positions across tracks (gene names, accessions, etc.).

Raw lines 59 to 64
65### Get hub genome data
66```
67GET /list/hubGenomes?hubUrl=<hubURL>
68```
69Lists genomes available in a track hub.

Get hub genome data

GET /list/hubGenomes?hubUrl=<hubURL>

Lists genomes available in a track hub.

Raw lines 65 to 70
71## Example calls

Example calls

Raw lines 71 to 72
73### Get RefSeq gene annotations in a region
74```
75GET https://api.genome.ucsc.edu/getData/track?genome=hg38&track=ncbiRefSeq&chrom=chr17&start=43044295&end=43125483
76```

Get RefSeq gene annotations in a region

GET https://api.genome.ucsc.edu/getData/track?genome=hg38&track=ncbiRefSeq&chrom=chr17&start=43044295&end=43125483
Raw lines 73 to 77
78### Get DNA sequence
79```
80GET https://api.genome.ucsc.edu/getData/sequence?genome=hg38&chrom=chr7&start=117119148&end=117119178
81```

Get DNA sequence

GET https://api.genome.ucsc.edu/getData/sequence?genome=hg38&chrom=chr7&start=117119148&end=117119178
Raw lines 78 to 82
83### Response example (sequence)
84```json
86 "genome": "hg38",
87 "chrom": "chr7",
88 "start": 117119148,
89 "end": 117119178,
90 "dna": "atgcagatatcagcgatgcagatcgatcg..."
92```

Response example (sequence)

{
  "genome": "hg38",
  "chrom": "chr7",
  "start": 117119148,
  "end": 117119178,
  "dna": "atgcagatatcagcgatgcagatcgatcg..."
}
Raw lines 83 to 93
94### Response example (track data)
95```json
97 "genome": "hg38",
98 "track": "ncbiRefSeq",
99 "chrom": "chr17",
100 "start": 43044295,
101 "end": 43125483,
102 "ncbiRefSeq": [
103 {
104 "chrom": "chr17",
105 "chromStart": 43044295,
106 "chromEnd": 43125483,
107 "name": "NM_007294.4",
108 "strand": "-",
109 "name2": "BRCA1",
110 "exonCount": 23,
111 "exonStarts": "43044295,43047642,...",
112 "exonEnds": "43045802,43047703,..."
113 }
114 ]
116```

Response 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 117
118## Coordinate system
119All coordinates are **0-based, half-open** (standard BED format). This means
120`start` is inclusive and `end` is exclusive.

Coordinate system

All coordinates are 0-based, half-open (standard BED format). This means start is inclusive and end is exclusive.

Raw lines 118 to 121
122## Rate Limits
123- No published hard rate limits
124- The API is intended for moderate programmatic use; bulk downloads should use
125 the MySQL public server (genome-mysql.soe.ucsc.edu) or BigBed/BigWig file downloads
126- Requests returning very large result sets may be truncated via `maxItemsOutput`

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
Raw lines 122 to 127
128## Common genome values
129- `hg38` -- Human GRCh38 (current)
130- `hg19` -- Human GRCh37
131- `mm39` -- Mouse GRCm39
132- `mm10` -- Mouse GRCm38
133- `dm6` -- Drosophila
134- `danRer11` -- Zebrafish
135- `sacCer3` -- Yeast

Common genome values

  • hg38 -- Human GRCh38 (current)
  • hg19 -- Human GRCh37
  • mm39 -- Mouse GRCm39
  • mm10 -- Mouse GRCm38
  • dm6 -- Drosophila
  • danRer11 -- Zebrafish
  • sacCer3 -- Yeast
Raw lines 128 to 135