# Baby Names API
> US given-name popularity from 1880 to 2008 as an API — the top 1,000 names per year for each sex (SSA-derived dataset, 6,782 names). Pull a name's full popularity trend (e.g. Emma → girls: rank #1 in 2008, peaked again in 1881), get the top names for any year (e.g. 1990 → Jessica, Ashley, Brittany), or search names by prefix/substring. Each data point carries the year, the share of births (percent and per-million) and the rank. Ideal for name-trend visualisations, baby-name apps, nostalgia/genealogy tools and data journalism.

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

## Pricing
- **Free** (Free) — 6,000 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 70,000 calls/Mo, 8 req/s
- **Pro** ($12/Mo) — 350,000 calls/Mo, 20 req/s
- **Mega** ($30/Mo) — 1,600,000 calls/Mo, 50 req/s

## Endpoints

### Baby Names

#### `GET /v1/name` — A name's popularity profile + yearly trend

**Parameters:**
- `name` (query, required, string) — Given name, e.g. Emma Example: `Emma`
- `sex` (query, optional, string) — boy | girl (omit for both)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/babynames-api/v1/name?name=Emma"
```

**Response:**
```json
{
    "data": {
        "name": "Emma",
        "results": [
            {
                "sex": "boy",
                "name": "Emma",
                "peak": {
                    "rank": 466,
                    "year": 1890,
                    "percent": 0.000134
                },
                "latest": {
                    "rank": 738,
                    "year": 1910,
                    "percent": 8.2e-5
                },
                "series": [
                    {
                        "rank": 613,
                        "year": 1880,
                        "percent": 8.4e-5,
                        "per_million": 84
                    },
                    {
                        "rank": 618,
                        "year": 1881,
                        "percent": 8.3e-5,
                        "per_million": 83
                    },
                    {
                        "rank": 778,
                        "year": 1882,
                        "percent": 5.7e-5,
                        "per_million": 57
                    },
                    {
                        "rank": 750,
                        "year": 1883,
                        "percent": 6.2e-5,
                        "per_million": 62
                    },
                    {
                        "rank": 675,
                        "year": 1884,
                        "percent": 7.3e-5,
                        "per_million": 73
                    },
      
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/search` — Search names by prefix/substring

**Parameters:**
- `q` (query, required, string) — Name fragment, e.g. emm Example: `emm`
- `sex` (query, optional, string) — boy | girl
- `limit` (query, optional, string) — Results per page (1-100, default 20) Example: `20`
- `offset` (query, optional, string) — Pagination offset Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/babynames-api/v1/search?q=emm&limit=20&offset=0"
```

**Response:**
```json
{
    "data": {
        "sex": null,
        "count": 19,
        "limit": 20,
        "query": "emm",
        "total": 19,
        "offset": 0,
        "results": [
            {
                "sex": "girl",
                "name": "Emma",
                "peak_year": 1881,
                "peak_percent": 0.020574,
                "years_in_top1000": 129
            },
            {
                "sex": "boy",
                "name": "Emmanuel",
                "peak_year": 2008,
                "peak_percent": 0.001311,
                "years_in_top1000": 64
            },
            {
                "sex": "boy",
                "name": "Emmett",
                "peak_year": 1895,
                "peak_percent": 0.00109,
                "years_in_top1000": 129
            },
            {
                "sex": "boy",
                "name": "Emmet",
                "peak_year": 1880,
                "peak_percent": 0.000287,
                "years_in_top1000": 52
            },
            {
                "sex": "girl",
                "name": "Emmalee",
                "peak_year": 2005,
                "peak_percent": 0.000216,
                "years_in_top1000": 10
            },
            {
                "sex": "girl",
                "name": "Emmie",
                "peak_year": 1896,
                "peak_percent": 0.00019,
                "years_in_top1000": 53
            },
            {
                "sex": "boy",
                "name": "Emmitt",

…(truncated, see openapi.json for full schema)
```

#### `GET /v1/year` — Top names for a year

**Parameters:**
- `year` (query, required, string) — Year 1880-2008, e.g. 2000 Example: `2000`
- `sex` (query, optional, string) — boy | girl (omit for both)
- `limit` (query, optional, string) — Top N (1-100, default 20) Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/babynames-api/v1/year?year=2000&limit=20"
```

**Response:**
```json
{
    "data": {
        "boy": [
            {
                "name": "Jacob",
                "rank": 1,
                "percent": 0.016514,
                "per_million": 16514
            },
            {
                "name": "Michael",
                "rank": 2,
                "percent": 0.015346,
                "per_million": 15346
            },
            {
                "name": "Matthew",
                "rank": 3,
                "percent": 0.013695,
                "per_million": 13695
            },
            {
                "name": "Joshua",
                "rank": 4,
                "percent": 0.013194,
                "per_million": 13194
            },
            {
                "name": "Christopher",
                "rank": 5,
                "percent": 0.01199,
                "per_million": 11990
            },
            {
                "name": "Nicholas",
                "rank": 6,
                "percent": 0.011815,
                "per_million": 11815
            },
            {
                "name": "Andrew",
                "rank": 7,
                "percent": 0.011324,
                "per_million": 11324
            },
            {
                "name": "Joseph",
                "rank": 8,
                "percent": 0.01093,
                "per_million": 10930
            },
            {
                "name": "Daniel",
                "rank": 9,
                "percent": 0.010681,
                "per_million": 10681

…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Year range & totals

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

**Response:**
```json
{
    "data": {
        "note": "Top 1000 names per year per sex, 1880-2008. percent = fraction of births that year; per_million = percent×1,000,000.",
        "years": 129,
        "fields": [
            "name",
            "sex",
            "year",
            "percent",
            "per_million",
            "rank"
        ],
        "source": "US given-name popularity (SSA-derived, hadley/data-baby-names)",
        "last_year": 2008,
        "first_year": 1880,
        "unique_names": 6782,
        "per_year_per_sex": 1000
    },
    "meta": {
        "timestamp": "2026-05-31T05:48:03.208Z",
        "request_id": "6f6d6353-24d6-43ec-8997-362a5720e4da"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


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