# Star Trek API
> The Star Trek universe as an API, powered by the open STAPI database. Search characters by name (e.g. Picard) or pull full detail by uid — species, titles, occupations, the actors who played them and their Starfleet organizations. Look up the television series (e.g. Voyager → 7 seasons, episode count, production years and original broadcaster), and search the spacecraft of the franchise (e.g. Enterprise) for their registry, class, status and operator. Across The Original Series, The Next Generation, Deep Space Nine, Voyager and beyond. Ideal for fan sites, trivia and quiz games, wikis, Discord bots and any Star Trek app.

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

## Pricing
- **Free** (Free) — 10,300 calls/Mo, 2 req/s
- **Starter** ($3/Mo) — 149,000 calls/Mo, 8 req/s
- **Pro** ($10/Mo) — 665,000 calls/Mo, 20 req/s
- **Mega** ($32/Mo) — 2,760,000 calls/Mo, 50 req/s

## Endpoints

### Star Trek

#### `GET /v1/character` — A character by name or uid

**Parameters:**
- `name` (query, optional, string) — Name search, e.g. Picard Example: `Picard`
- `uid` (query, optional, string) — Character uid for detail
- `page` (query, optional, string) — Page (from 0) Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/startrek-api/v1/character?name=Picard&page=0"
```

**Response:**
```json
{
    "data": {
        "page": 0,
        "count": 16,
        "query": "Picard",
        "total": 16,
        "results": [
            {
                "uid": "CHMA0000015352",
                "name": "Elise Picard",
                "gender": null,
                "titles": [],
                "species": [],
                "height_cm": null,
                "weight_kg": null,
                "performers": [],
                "occupations": [],
                "organizations": [],
                "serial_number": null,
                "year_of_birth": null,
                "year_of_death": null
            },
            {
                "uid": "CHMA0000011750",
                "name": "Javier Maribona-Picard",
                "gender": "M",
                "titles": [],
                "species": [],
                "height_cm": null,
                "weight_kg": null,
                "performers": [],
                "occupations": [],
                "organizations": [],
                "serial_number": null,
                "year_of_birth": null,
                "year_of_death": null
            },
            {
                "uid": "CHMA0000289509",
                "name": "Jean-Luc Picard",
                "gender": "M",
                "titles": [],
                "species": [],
                "height_cm": null,
                "weight_kg": null,
                "performers": [],
                "occupations": [],
                "organizations": [],
          
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/series` — A series by title or uid

**Parameters:**
- `title` (query, optional, string) — Title search, e.g. Voyager Example: `Voyager`
- `uid` (query, optional, string) — Series uid
- `page` (query, optional, string) — Page Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/startrek-api/v1/series?title=Voyager&page=0"
```

**Response:**
```json
{
    "data": {
        "page": 0,
        "count": 1,
        "query": "Voyager",
        "total": 1,
        "results": [
            {
                "uid": "SEMA0000000029",
                "title": "Star Trek: Voyager",
                "years": "1994–2001",
                "seasons": 7,
                "episodes": 168,
                "abbreviation": "VOY",
                "original_broadcaster": "UPN"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:22.741Z",
        "request_id": "ffe8510d-18ba-4a8a-bf92-98857fa91588"
    },
    "status": "ok",
    "message": "Series retrieved",
    "success": true
}
```

#### `GET /v1/spacecraft` — A spacecraft by name or uid

**Parameters:**
- `name` (query, optional, string) — Name search, e.g. Enterprise Example: `Enterprise`
- `uid` (query, optional, string) — Spacecraft uid
- `page` (query, optional, string) — Page Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/startrek-api/v1/spacecraft?name=Enterprise&page=0"
```

**Response:**
```json
{
    "data": {
        "page": 0,
        "count": 23,
        "query": "Enterprise",
        "total": 23,
        "results": [
            {
                "uid": "SRMA0000001640",
                "name": "Enterprise",
                "class": "NX class",
                "owner": "United Earth",
                "status": "Preserved",
                "operator": "Military Assault Command Operations",
                "registry": "NX-01"
            },
            {
                "uid": "SRMA0000004190",
                "name": "Enterprise",
                "class": "Space shuttle orbiter",
                "owner": null,
                "status": "Retired",
                "operator": "National Aeronautics and Space Administration",
                "registry": "OV-101"
            },
            {
                "uid": "SRMA0000174858",
                "name": "Enterprise shuttle 1",
                "class": "Takayama type shuttlecraft",
                "owner": null,
                "status": "Destroyed",
                "operator": null,
                "registry": "1"
            },
            {
                "uid": "SRMA0000124678",
                "name": "Enterprise shuttle 2",
                "class": "Moore type shuttlecraft",
                "owner": null,
                "status": "Active",
                "operator": null,
                "registry": "2"
            },
            {
                "uid": "SRMA0000148790",
                "name": "Enterprise 
…(truncated, see openapi.json for full schema)
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "note": "The Star Trek universe. /v1/character = search by name (e.g. name=Picard) or full detail by uid (species, titles, performers, organizations); /v1/series = search by title (e.g. title=Voyager) — seasons, episodes, years, broadcaster; /v1/spacecraft = search by name (e.g. name=Enterprise) — registry, class, status, operator. Pass uid= for an exact record, name=/title= to search, page= to paginate.",
        "source": "STAPI (stapi.co)",
        "endpoints": [
            "/v1/character",
            "/v1/series",
            "/v1/spacecraft",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:23.468Z",
        "request_id": "6c144a2f-26d3-48e0-bf99-30fbef848659"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


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