> ## Documentation Index
> Fetch the complete documentation index at: https://docs.narrative.video/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Sports video analysis and highlight generation with async task processing

## Sports API

The Sports API provides AI-powered tools for analyzing broadcast sports video, extracting play-by-play metadata, and generating highlight reels. Long-running operations use an async task pattern for reliable processing.

### Key Features

* **Metadata Extraction** - Extract play-by-play events with precise timestamps
* **Highlight Generation** - Create AI-curated highlight reels from full games
* **Async Processing** - Task-based API for long-running operations

### Base URL

```
https://api.usenarrative.ai
```

### Async Task Pattern

Long-running operations use an async pattern:

```
┌──────────────────┐     ┌──────────────────┐     ┌──────────────────┐
│  POST /endpoint  │ ──▶ │  Poll GET /{id}  │ ──▶ │  Get Result      │
│  Returns task_id │     │  Check status    │     │  When complete   │
└──────────────────┘     └──────────────────┘     └──────────────────┘
```

### Task Statuses

| Status       | Description                         |
| ------------ | ----------------------------------- |
| `pending`    | Task created, waiting to start      |
| `processing` | Task is running                     |
| `completed`  | Task finished, result available     |
| `failed`     | Task failed, error details provided |

### Quick Start

```bash theme={null}
# 1. Start highlight generation (async)
curl -X POST https://api.usenarrative.ai/api/v1/sports/highlights \
  -F "video=@football_game.mp4" \
  -F "duration=600" \
  -F "editorial_instructions=Focus on touchdowns and big plays"
# Returns: { "task_id": "task_abc123", "status": "pending" }

# 2. Poll for completion
curl https://api.usenarrative.ai/api/v1/sports/highlights/task_abc123
# Returns: { "status": "processing", "progress": 45 }
# ... wait and poll again ...
# Returns: { "status": "completed", "result": { "video_url": "..." } }
```

<Card title="OpenAPI Specification" icon="file-code" href="/api-reference/sports-openapi.json">
  View the full OpenAPI specification
</Card>
