# DNA Sequence API
> DNA/RNA sequence-analysis maths as an API, computed locally and deterministically. The analyze endpoint reports the length and base composition of a sequence, the GC and AT content, the complement, the reverse and the reverse complement (the opposite strand read 5'→3'), and the approximate single-stranded molecular weight. The translate endpoint transcribes DNA to mRNA (T→U) and translates it to protein with the standard genetic code in reading frame 1, 2 or 3, giving the one-letter amino-acid sequence, the protein length and the number of stop codons. The melting endpoint estimates a primer's melting temperature with the Wallace rule, 4·(G+C) + 2·(A+T), for short oligos and a salt-adjusted basic formula for longer ones. Sequences are case- and whitespace-insensitive and accept A, C, G, T for DNA or U for RNA. Everything is computed locally and deterministically, so it is instant and private. Ideal for bioinformatics, molecular-biology, genomics and lab app developers, primer-design and sequence-inspection tools, and biology education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is sequence analysis; for genome assembly data use a genomes API.

## 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/dna-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 25,000 calls/Mo, 5 req/s
- **Pro** ($15/Mo) — 150,000 calls/Mo, 15 req/s
- **Mega** ($45/Mo) — 750,000 calls/Mo, 40 req/s

## Endpoints

### DNA

#### `GET /v1/analyze` — Sequence analysis

**Parameters:**
- `sequence` (query, required, string) — DNA/RNA sequence Example: `ATGCATGC`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/dna-api/v1/analyze?sequence=ATGCATGC"
```

**Response:**
```json
{
    "data": {
        "note": "GC content = (G+C)/length. Reverse complement reads the opposite strand 5'→3'. Molecular weight is the approximate single-stranded value.",
        "inputs": {
            "type": "DNA",
            "length": 8
        },
        "length": 8,
        "reverse": "CGTACGTA",
        "complement": "TACGTACG",
        "base_counts": {
            "A": 2,
            "C": 2,
            "G": 2,
            "T": 2,
            "U": 0
        },
        "at_content_percent": 50,
        "gc_content_percent": 50,
        "reverse_complement": "GCATGCAT",
        "molecular_weight_g_mol": 2409.64
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:02.860Z",
        "request_id": "cbde2b1c-019b-4cd9-9053-f45b712e2402"
    },
    "status": "ok",
    "message": "Sequence analysis",
    "success": true
}
```

#### `GET /v1/melting` — Melting temperature

**Parameters:**
- `sequence` (query, required, string) — Primer sequence Example: `ATGCATGCATGCATGCATGC`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/dna-api/v1/melting?sequence=ATGCATGCATGCATGCATGC"
```

**Response:**
```json
{
    "data": {
        "note": "Wallace rule Tm = 4·(G+C) + 2·(A+T) suits primers under ~14 bases; for longer oligos the salt-adjusted basic formula 64.9 + 41·(GC−16.4)/length is better.",
        "inputs": {
            "length": 20
        },
        "tm_basic_c": 51.78,
        "recommended": "tm_basic_c",
        "tm_wallace_c": 60,
        "gc_content_percent": 50
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:02.930Z",
        "request_id": "93f3859d-b1f0-4eb7-8a42-b9130769f468"
    },
    "status": "ok",
    "message": "Melting temp",
    "success": true
}
```

#### `GET /v1/translate` — Transcribe & translate

**Parameters:**
- `sequence` (query, required, string) — DNA/RNA sequence Example: `ATGGCCTAA`
- `frame` (query, optional, string) — Reading frame 1, 2 or 3 Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/dna-api/v1/translate?sequence=ATGGCCTAA&frame=1"
```

**Response:**
```json
{
    "data": {
        "mrna": "AUGGCCUAA",
        "note": "Standard genetic code. mRNA is the DNA with T→U; the protein uses one-letter amino acids, * marks a stop codon.",
        "inputs": {
            "type": "DNA",
            "frame": 1,
            "length": 9
        },
        "protein": "MA*",
        "stop_codons": 1,
        "protein_length": 2,
        "codons_translated": 3
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:03.000Z",
        "request_id": "7700532c-f894-43dc-9b65-290f39dd0bda"
    },
    "status": "ok",
    "message": "Translate",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

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

**Response:**
```json
{
    "data": {
        "notes": "Sequence uses A, C, G, T (DNA) or U (RNA); case- and whitespace-insensitive. Translation uses the standard genetic code; * marks a stop codon.",
        "service": "dna-api",
        "formulae": {
            "tm_basic": "64.9 + 41·(GC − 16.4) / length",
            "gc_content": "(G+C) / length",
            "tm_wallace": "4·(G+C) + 2·(A+T)"
        },
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/analyze": "Length, base counts, GC content, complement, reverse complement and molecular weight.",
            "GET /v1/melting": "Primer melting temperature (Wallace rule and salt-adjusted basic formula).",
            "GET /v1/translate": "Transcribe DNA→mRNA and translate to protein in frame 1, 2 or 3."
        },
        "description": "DNA/RNA sequence analysis: base composition, GC content and reverse complement; transcription and translation to protein in any reading frame; and primer melting temperature."
    },
    "meta": {
        "timestamp": "2026-06-05T03:09:03.063Z",
        "request_id": "e81535bf-df4c-4a7b-811e-316764607220"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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