# UCSC Genome API
> The UCSC Genome Browser as an API — reference genome data for hundreds of species, from the renowned UCSC Genome Browser at UC Santa Cruz. /v1/genomes lists the 220+ genome assemblies UCSC hosts, each with its assembly id (such as hg38 for human, mm39 for mouse, danRer11 for zebrafish), organism, description and data source. /v1/chromosomes?genome=hg38 returns an assembly's chromosomes and sequences with their sizes in base pairs, largest first. /v1/sequence?genome=hg38&chrom=chrM&start=0&end=100 retrieves the raw DNA sequence of any genomic region (0-based start, half-open end; regions are capped at 100,000 bases per call). Assembly ids come from /v1/genomes and chromosome names look like chr1, chrX or chrM. Ideal for bioinformatics pipelines, genome-visualisation and primer-design tools, region and sequence lookups, comparative genomics and teaching. Data from the UCSC Genome Browser (free for academic, non-profit and personal use). This is the genome browser's assemblies and raw reference sequence — distinct from gene-annotation and protein-sequence databases such as Ensembl, UniProt and ENA.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/ucsc-api/..."
```

## Pricing
- **Free** (Free) — 2,300 calls/Mo, 2 req/s
- **Starter** ($8/Mo) — 49,000 calls/Mo, 5 req/s
- **Pro** ($23/Mo) — 220,000 calls/Mo, 12 req/s
- **Mega** ($63/Mo) — 790,000 calls/Mo, 35 req/s

## Endpoints

### Genome

#### `GET /v1/chromosomes` — An assembly chromosomes & sizes

**Parameters:**
- `genome` (query, required, string) — Assembly id, e.g. hg38 Example: `hg38`
- `limit` (query, optional, string) — Max results (1-2000)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ucsc-api/v1/chromosomes?genome=hg38"
```

**Response:**
```json
{
    "data": {
        "count": 200,
        "total": 711,
        "genome": "hg38",
        "chromosomes": [
            {
                "name": "chr1",
                "size_bp": 248956422
            },
            {
                "name": "chr2",
                "size_bp": 242193529
            },
            {
                "name": "chr3",
                "size_bp": 198295559
            },
            {
                "name": "chr4",
                "size_bp": 190214555
            },
            {
                "name": "chr5",
                "size_bp": 181538259
            },
            {
                "name": "chr6",
                "size_bp": 170805979
            },
            {
                "name": "chr7",
                "size_bp": 159345973
            },
            {
                "name": "chrX",
                "size_bp": 156040895
            },
            {
                "name": "chr8",
                "size_bp": 145138636
            },
            {
                "name": "chr9",
                "size_bp": 138394717
            },
            {
                "name": "chr11",
                "size_bp": 135086622
            },
            {
                "name": "chr10",
                "size_bp": 133797422
            },
            {
                "name": "chr12",
                "size_bp": 133275309
            },
            {
                "name": "chr13",
                "size_bp": 114364328
            },
            {
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/genomes` — List genome assemblies

**Parameters:**
- `limit` (query, optional, string) — Max results (1-1000)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ucsc-api/v1/genomes"
```

**Response:**
```json
{
    "data": {
        "count": 220,
        "genomes": [
            {
                "id": "ailMel1",
                "source": "BGI-Shenzhen AilMel 1.0 Dec. 2009",
                "organism": "Panda",
                "common_name": "Ailuropoda melanoleuca",
                "description": "Dec. 2009 (BGI-Shenzhen 1.0/ailMel1)",
                "assembly_date": null
            },
            {
                "id": "allMis1",
                "source": "International Crocodilian Genomes Working Group",
                "organism": "American alligator",
                "common_name": "Alligator mississippiensis",
                "description": "Aug. 2012 (allMis0.2/allMis1)",
                "assembly_date": null
            },
            {
                "id": "anoCar1",
                "source": "Broad Institute AnoCar (1.0)",
                "organism": "Lizard",
                "common_name": "Anolis carolinensis",
                "description": "Feb. 2007 (Broad/anoCar1)",
                "assembly_date": null
            },
            {
                "id": "anoCar2",
                "source": "Broad Institute of MIT and Harvard AnoCar 2.0 (GCA_000090745.1)",
                "organism": "Lizard",
                "common_name": "Anolis carolinensis",
                "description": "May 2010 (Broad AnoCar2.0/anoCar2)",
                "assembly_date": null
            },
            {
                "id": "anoGam1",
                "source": "IAGEC v.MOZ2",
        
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/sequence` — DNA sequence of a region

**Parameters:**
- `genome` (query, required, string) — Assembly id, e.g. hg38 Example: `hg38`
- `chrom` (query, required, string) — Chromosome, e.g. chrM Example: `chrM`
- `start` (query, optional, string) — 0-based start Example: `0`
- `end` (query, required, string) — Half-open end (<= start+100000) Example: `100`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ucsc-api/v1/sequence?genome=hg38&chrom=chrM&start=0&end=100"
```

**Response:**
```json
{
    "data": {
        "dna": "GATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGTATTTTCGTCTGGGGGGTATGCACGCGATAGCATTGCGAGACGCTG",
        "end": 100,
        "chrom": "chrM",
        "start": 0,
        "genome": "hg38",
        "length": 100
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:32.297Z",
        "request_id": "c39822db-bf19-4916-acab-08924fe8d9d8"
    },
    "status": "ok",
    "message": "Sequence retrieved",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Usage notes

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ucsc-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Reference genome data from the UCSC Genome Browser. /v1/genomes = the 220+ genome assemblies UCSC hosts — each with its assembly id (e.g. hg38 human, mm39 mouse, danRer11 zebrafish), organism, description and source; /v1/chromosomes?genome=hg38 = an assembly's chromosomes/sequences and their sizes in base pairs, largest first; /v1/sequence?genome=hg38&chrom=chrM&start=0&end=100 = the raw DNA sequence of a genomic region (0-based start, half-open end, region capped at 100,000 bases). Assembly ids come from /v1/genomes; chromosome names look like chr1, chrX, chrM. Data from UCSC (free for academic/non-profit/personal use). Distinct from gene-annotation/sequence databases (Ensembl, UniProt, ENA) — this is the genome browser's assemblies and raw reference sequence. Ideal for bioinformatics, genome-visualisation tools, primer/region lookups and education.",
        "source": "UCSC Genome Browser API (api.genome.ucsc.edu)",
        "endpoints": [
            "/v1/genomes",
            "/v1/chromosomes",
            "/v1/sequence",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:32.384Z",
        "request_id": "f5f76bde-dde7-42b6-890d-b10960078299"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/ucsc-api
OpenAPI spec: https://www.oanor.com/api/ucsc-api/openapi.json
