# GWAS Catalog API
> Human genetic trait associations as an API — powered by the NHGRI-EBI GWAS Catalog, the curated reference of published genome-wide association studies. It answers the core question of statistical genetics: which genetic variants (SNPs) are associated with which traits and diseases, and how strongly. Look up a SNP to get its functional class, genomic location and mapped genes; pull every trait association reported for it — the trait, p-value, effect size (odds ratio or beta), risk allele and frequency, and author-reported genes; and read the study behind the evidence — trait, sample sizes, ancestries, genotyping technology and the publication (PubMed id, authors, journal, date). From type 2 diabetes and Crohn disease to systemic lupus erythematosus and hundreds of thousands of associations, it is ideal for genomics, bioinformatics, statistical-genetics and biomedical research tools. A published genetic-association evidence base — distinct from population allele frequencies (gnomAD), clinical variant interpretation (ClinVar) and genome annotation (Ensembl). Open data from the NHGRI-EBI GWAS Catalog (EMBL-EBI).

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

## Pricing
- **Free** (Free) — 2,400 calls/Mo, 2 req/s
- **Starter** ($7/Mo) — 55,000 calls/Mo, 8 req/s
- **Pro** ($24/Mo) — 260,000 calls/Mo, 20 req/s
- **Mega** ($62/Mo) — 920,000 calls/Mo, 50 req/s

## Endpoints

### GWAS

#### `GET /v1/associations` — Trait associations reported for a SNP

**Parameters:**
- `id` (query, optional, string) — A SNP rsID Example: `rs7329174`
- `limit` (query, optional, string) — Max results (1-100, default 25)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/gwas-api/v1/associations?id=rs7329174"
```

**Response:**
```json
{
    "data": {
        "count": 6,
        "rs_id": "rs7329174",
        "total": 6,
        "associations": [
            {
                "beta": null,
                "traits": [
                    "systemic lupus erythematosus"
                ],
                "p_value": 1.0e-8,
                "odds_ratio": 1.26,
                "risk_alleles": [
                    "rs7329174-G"
                ],
                "reported_genes": [
                    "ELF1"
                ],
                "risk_frequency": "0.22"
            },
            {
                "beta": null,
                "traits": [
                    "Crohn disease"
                ],
                "p_value": 8.0e-9,
                "odds_ratio": 1.27,
                "risk_alleles": [
                    "rs7329174-G"
                ],
                "reported_genes": [
                    "WBP4",
                    "ELF1",
                    "microRNA2276",
                    "SLC25A15"
                ],
                "risk_frequency": null
            },
            {
                "beta": null,
                "traits": [
                    "systemic lupus erythematosus"
                ],
                "p_value": 6.0e-6,
                "odds_ratio": 1.45,
                "risk_alleles": [
                    "rs7329174-G"
                ],
                "reported_genes": [
                    "ELF1"
                ],
                "risk_frequency": "0.21"
          
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/snp` — A SNP: function, location, mapped genes

**Parameters:**
- `id` (query, optional, string) — A SNP rsID Example: `rs7329174`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/gwas-api/v1/snp?id=rs7329174"
```

**Response:**
```json
{
    "data": {
        "snp": {
            "url": "https://www.ebi.ac.uk/gwas/variants/rs7329174",
            "rs_id": "rs7329174",
            "merged": 0,
            "locations": [
                {
                    "region": "13q14.11",
                    "position": 40983974,
                    "chromosome": "13"
                }
            ],
            "last_update": "2025-10-05",
            "mapped_genes": [
                "ELF1",
                "SUGT1P3",
                "RGS17P1",
                "WBP4",
                "TRE-TTC1-2",
                "TPTE2P5"
            ],
            "functional_class": "intron_variant",
            "association_count": 6
        }
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:13.593Z",
        "request_id": "939f2814-e5c5-41cd-b827-b8599d1518c5"
    },
    "status": "ok",
    "message": "SNP retrieved",
    "success": true
}
```

#### `GET /v1/study` — A GWAS study: trait, samples, publication

**Parameters:**
- `id` (query, optional, string) — A GWAS study accession (from /v1/associations) Example: `GCST000028`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/gwas-api/v1/study?id=GCST000028"
```

**Response:**
```json
{
    "data": {
        "study": {
            "url": "https://www.ebi.ac.uk/gwas/studies/GCST000028",
            "trait": "Type 2 diabetes",
            "accession": "GCST000028",
            "snp_count": 386731,
            "ancestries": [
                "European"
            ],
            "publication": {
                "date": "2007-04-26",
                "title": "Genome-wide association analysis identifies loci for type 2 diabetes and triglyceride levels.",
                "author": "Saxena R",
                "journal": "Science",
                "pubmed_id": "17463246"
            },
            "full_pvalue_set": true,
            "initial_sample_size": "1,464 European ancestry cases, 1,467 European ancestry controls",
            "genotyping_technologies": [
                "Genome-wide genotyping array"
            ],
            "replication_sample_size": "5,065 European ancestry cases, 5,785 European ancestry controls, at least 18,129 cases and controls."
        }
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:13.752Z",
        "request_id": "9a0ecd20-1d05-4076-b770-35f2f03edcaf"
    },
    "status": "ok",
    "message": "Study retrieved",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Endpoint catalogue & notes

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

**Response:**
```json
{
    "data": {
        "note": "The GWAS Catalog is the NHGRI-EBI curated collection of published human genome-wide association studies — which genetic variants are statistically associated with which traits and diseases. /v1/snp?id=rs7329174 = a SNP's annotation: functional class, genomic location(s) (chromosome, position), mapped genes and how many associations reference it; /v1/associations?id=rs7329174 = every trait association reported for that SNP — the trait(s), p-value, effect size (odds ratio or beta), risk allele and frequency and author-reported genes; /v1/study?id=GCST000028 = a study's metadata: trait, sample sizes, SNP count, ancestries, genotyping technologies and the publication (PubMed id, author, title, journal, date). rsIDs look like rs7329174; study accessions like GCST000028 (get one from /v1/associations). Data from the NHGRI-EBI GWAS Catalog (EMBL-EBI, public). A published genetic-association evidence base — distinct from population allele frequencies (gnomAD), clinical variant interpretation (ClinVar) and genome annotation (Ensembl). Ideal for genomics, bioinformatics, statistical-genetics and research tooling.",
        "source": "NHGRI-EBI GWAS Catalog (ebi.ac.uk/gwas)",
        "endpoints": [
            "/v1/snp",
            "/v1/associations",
            "/v1/study",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:13.809Z",
        "request_id": "e21ca895-f312-4e8b-8083-e69dc5521035"
    },
   
…(truncated, see openapi.json for full schema)
```


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