# Dinosaurs API
> Explore 4,100+ dinosaur genera from the Paleobiology Database. For each dinosaur get the geologic period it lived in (Triassic, Jurassic or Cretaceous), its age range in millions of years, the stratigraphic intervals and who first named it. Look one up by name, search the catalogue, filter by period, or get a random dinosaur — perfect for education apps, games, quizzes and museum tooling.

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

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 3 req/s
- **Starter** ($5/Mo) — 45,000 calls/Mo, 8 req/s
- **Pro** ($13/Mo) — 260,000 calls/Mo, 20 req/s
- **Mega** ($33/Mo) — 1,300,000 calls/Mo, 40 req/s

## Endpoints

### Dinosaurs

#### `GET /v1/dinosaur` — A single dinosaur by name or id

**Parameters:**
- `name` (query, optional, string) — Genus name, e.g. Tyrannosaurus Example: `Tyrannosaurus`
- `id` (query, optional, string) — Dataset id (alternative to name)

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

**Response:**
```json
{
    "data": {
        "id": 2771,
        "name": "Tyrannosaurus",
        "lived": {
            "max_ma": 83.6,
            "min_ma": 66,
            "late_interval": "Maastrichtian",
            "early_interval": "Campanian"
        },
        "period": "Cretaceous",
        "named_by": "Osborn 1905"
    },
    "meta": {
        "timestamp": "2026-05-31T02:02:07.181Z",
        "request_id": "98ec3ec4-684f-4432-9574-d4b8f6a220f5"
    },
    "status": "ok",
    "message": "Dinosaur retrieved",
    "success": true
}
```

#### `GET /v1/random` — A random dinosaur (optionally by period)

**Parameters:**
- `period` (query, optional, string) — Triassic, Jurassic or Cretaceous

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

**Response:**
```json
{
    "data": {
        "id": 437,
        "name": "Boreonykus",
        "lived": {
            "max_ma": 83.6,
            "min_ma": 72.2,
            "late_interval": null,
            "early_interval": "Campanian"
        },
        "period": "Cretaceous",
        "named_by": "Bell and Currie 2016"
    },
    "meta": {
        "timestamp": "2026-05-31T02:02:07.254Z",
        "request_id": "6f838ec3-9a29-4dc9-ae29-c23c7c3ddbfa"
    },
    "status": "ok",
    "message": "Random dinosaur",
    "success": true
}
```

#### `GET /v1/search` — Search dinosaurs by name, filter by period

**Parameters:**
- `q` (query, optional, string) — Name (substring) Example: `saurus`
- `period` (query, optional, string) — Triassic, Jurassic or Cretaceous Example: `Cretaceous`
- `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/dinosaurs-api/v1/search?q=saurus&period=Cretaceous&limit=20&offset=0"
```

**Response:**
```json
{
    "data": {
        "count": 20,
        "limit": 20,
        "total": 404,
        "offset": 0,
        "filters": {
            "q": "saurus",
            "period": "Cretaceous"
        },
        "results": [
            {
                "id": 65,
                "name": "Wakinosaurus",
                "lived": {
                    "max_ma": 125.77,
                    "min_ma": 121.4,
                    "late_interval": null,
                    "early_interval": "Barremian"
                },
                "period": "Cretaceous",
                "named_by": "Okazaki 1992"
            },
            {
                "id": 142,
                "name": "Arkansaurus",
                "lived": {
                    "max_ma": 113.2,
                    "min_ma": 100.5,
                    "late_interval": null,
                    "early_interval": "Albian"
                },
                "period": "Cretaceous",
                "named_by": "Hunt and Quinn 2018"
            },
            {
                "id": 147,
                "name": "Paraxenisaurus",
                "lived": {
                    "max_ma": 83.6,
                    "min_ma": 72.2,
                    "late_interval": null,
                    "early_interval": "Campanian"
                },
                "period": "Cretaceous",
                "named_by": "Serrano-Brañas et al. 2020"
            },
            {
                "id": 154,
                "name": "Coelosaurus",
          
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Totals, periods & source

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

**Response:**
```json
{
    "data": {
        "note": "max_ma/min_ma are millions of years ago; period derived from age midpoint.",
        "total": 4188,
        "fields": [
            "id",
            "name",
            "period",
            "named_by",
            "early_interval",
            "late_interval",
            "max_ma",
            "min_ma"
        ],
        "source": "Paleobiology Database (Dinosauria genera)",
        "periods": [
            {
                "count": 148,
                "period": "Triassic"
            },
            {
                "count": 445,
                "period": "Jurassic"
            },
            {
                "count": 1536,
                "period": "Cretaceous"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-05-31T02:02:07.402Z",
        "request_id": "54760101-5e55-41e7-b7a0-218c6ec285b3"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


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