Overview
API Documentation

ContentIndexer API

AI-powered video analysis. Submit a video, get back structured intelligence.

For AI assistants:llms.txt·llms-full.txt·openapi.yaml

Overview

ContentIndexer is an AI-powered video analysis API. Submit a video URL or file and get back structured data: faces detected, objects identified, shot cuts, transcription with speaker diarization, CLIP semantic embeddings, and more. Built for video editors, production companies, and developers building video intelligence into their apps.

Face detection
Bounding boxes, tracking across frames
Object detection
Labeled objects with confidence scores
Pose & hand tracking
Body keypoints via MediaPipe
Transcription
Word-level timestamps + speaker IDs
Shot detection
Scene cuts via FFmpeg
CLIP embeddings
512-dim semantic vectors per frame
Video editor export
OTIO, FCPXML, CSV timeline markers
Webhooks
Push notifications when jobs complete
Base URLhttps://api.contentindexer.com
FormatJSON
AuthBearer token

Quick Start

Get your first results in under 2 minutes.

1

Get an API key from the dashboard

Sign in to your dashboard and create an API key. Keys start with ci_.

# Your API key looks like this:
ci_abc123xyz456def789...
2

Submit a job

POST a YouTube link (or the content_id of an upload) with the extractors you want. Other links (a direct .mp4, Vimeo, Loom) return 400 with no credit used: upload the file first. workflow is a comma-separated list of extractor names.

curl -X POST "https://api.contentindexer.com/v1/jobs" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content_url": "https://www.youtube.com/watch?v=VIDEO_ID",
    "workflow": "ffprobe,mediapipe,transcription"
  }'
3

Poll for completion

Check the job status until it reaches completed or failed. Or use webhooks to avoid polling entirely.

curl "https://api.contentindexer.com/v1/jobs/{jobId}" \
  -H "Authorization: Bearer YOUR_API_KEY"
4

Fetch results

Retrieve structured data for any extractor that ran on the job.

curl "https://api.contentindexer.com/v1/results/{jobId}/mediapipe" \
  -H "Authorization: Bearer YOUR_API_KEY"

Authentication

All requests must include your API key in the Authorization header using the Bearer scheme.

Authorization: Bearer ci_abc123xyz456def789...

Auth Methods

RecommendedAPI Keys — server-to-server

Static keys prefixed with ci_. Manage them from your dashboard or via the API.

OAuth Bearer Tokens — user-facing apps

Short-lived JWTs issued after OAuth login. Use for apps where end-users authenticate directly.

Security best practices

  • Never commit API keys to version control
  • Store keys in environment variables or a secrets manager
  • Use separate keys for development and production
  • Rotate keys regularly and after any suspected exposure
  • Scope keys to the minimum permissions required

API Keys

Create and manage API keys programmatically. Keys are only displayed once at creation time — store them securely.

POST/v1/api-keysCreate a new API key
GET/v1/api-keysList all API keys
DELETE/v1/api-keys?keyId={id}Deactivate an API key

Create an API key

Request body: name (string, required) and expiresInDays (integer, optional).

curl -X POST "https://api.contentindexer.com/v1/api-keys" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Production Server", "expiresInDays": 365}'

Response

{
  "key": {
    "id":         "key_01HXG5K3...",
    "name":       "Production Server",
    "value":      "ci_abc123xyz456def789...",
    "created_at": "2025-06-01T12:00:00Z",
    "expires_at": "2026-06-01T12:00:00Z",
    "last_used":  null
  }
}
The value field is only returned once. Copy and store it immediately — subsequent requests will not show the key value.

Jobs

Jobs are the core unit of work. Submit a YouTube link, or the content_id of a file you uploaded, with a workflow (comma-separated extractor names), then poll or subscribe to webhooks for completion.

POST/v1/jobsSubmit a new job
GET/v1/jobsList jobs (limit, offset)
GET/v1/jobs/{jobId}Get job status and metadata

Job status values

pendingprocessingcompletedfailedcancelled

Job response shape

{
  "id":           "01HXFJKM4NPQRS7WABCDEF",
  "status":       "completed",
  "content_url":  "https://www.youtube.com/watch?v=VIDEO_ID",
  "workflow":     "ffprobe,mediapipe,transcription",
  "created_at":   "2025-06-01T12:00:00Z",
  "started_at":   "2025-06-01T12:00:03Z",
  "completed_at": "2025-06-01T12:02:47Z",
  "error":        null
}

Polling with backoff

For short videos (under 5 min), poll every 3–5 seconds. For longer videos use exponential backoff. Or use webhooks to eliminate polling entirely.

curl "https://api.contentindexer.com/v1/jobs/{jobId}" \
  -H "Authorization: Bearer YOUR_API_KEY"

Content

Add videos to ContentIndexer by uploading a file or referencing an external URL (including YouTube links). Referenced content is fetched and stored on our infrastructure.

POST/v1/content/uploadUpload a video file (multipart/form-data)
POST/v1/content/referenceReference a YouTube URL or external link
GET/v1/contentList your content (limit, offset)
DELETE/v1/content/{contentId}Delete content and associated data

Upload a file

curl -X POST "https://api.contentindexer.com/v1/content/upload" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@/path/to/video.mp4" \
  -F "name=My Wedding Video"

Reference a URL

curl -X POST "https://api.contentindexer.com/v1/content/reference" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url":  "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "name": "Reference Video"
  }'

Content response shape

{
  "id":          "cnt_01HXG5K3...",
  "name":        "My Wedding Video",
  "source_url":  "https://example.com/video.mp4",
  "duration_s":  247,
  "size_bytes":  104857600,
  "status":      "ready",
  "created_at":  "2025-06-01T12:00:00Z"
}

Extractors

Extractors are modular AI models that run as part of a job workflow. Mix and match the extractors you need — you're only billed for what you use.

GET/v1/extractorsList available extractors
POST/v1/jobs/estimateEstimate cost before submitting

Available extractors

NameDescriptionBilling
ffprobeVideo metadata — duration, fps, resolution, codecPer second
mediapipeFace, object, pose, and hand detection per framePer second
transcriptionSpeech-to-text with speaker diarization (AssemblyAI)Per second
clip_embeddings512-dim CLIP ViT-B/16 vectors for semantic searchPer second
ffmpeg_shot_detectionScene cut detection and shot boundary identificationPer second

What shot detection catches and misses, measured: why threshold shot detectors miss dissolves.

Estimate cost before submitting

curl -X POST "https://api.contentindexer.com/v1/jobs/estimate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "duration_seconds": 300,
    "detectors": ["face_detection", "transcription"]
  }'

# Response:
{
  "duration_seconds": 300,
  "detectors":        ["face_detection", "transcription"],
  "estimated_cost_usd": 0.078,
  "breakdown": {
    "face_detection": 0.024,
    "transcription":  0.054
  },
  "note": "Estimate assumes full-duration processing. Actual cost may vary slightly."
}

Results

Once a job is completed, fetch structured results for any extractor that ran.

GET/v1/results/{jobId}/{extractorName}Get results for a specific extractor

ffprobe response

{
  "duration_s": 247.3,
  "fps": 29.97,
  "width": 1920,
  "height": 1080,
  "codec": "h264",
  "bitrate_kbps": 8500,
  "audio_codec": "aac",
  "audio_channels": 2
}

transcription response

{
  "text": "Welcome everyone. Today we're here to celebrate...",
  "words": [
    {
      "text":       "Welcome",
      "start_ms":   1240,
      "end_ms":     1720,
      "speaker":    "A",
      "confidence": 0.98
    },
    {
      "text":       "everyone",
      "start_ms":   1780,
      "end_ms":     2100,
      "speaker":    "A",
      "confidence": 0.97
    }
  ],
  "speakers": ["A", "B"],
  "sentiment_by_sentence": [
    {
      "text":      "Welcome everyone.",
      "sentiment": "positive",
      "start_ms":  1240,
      "end_ms":    2500
    }
  ],
  "key_phrases": ["celebrate", "ceremony", "thank you"]
}

mediapipe response (excerpt)

{
  "frames": [
    {
      "timestamp_s": 0.2,
      "face_detection": [
        {
          "bbox":       { "x": 0.21, "y": 0.15, "w": 0.18, "h": 0.32 },
          "confidence": 0.94,
          "track_id":   1
        }
      ],
      "object_detection": [
        {
          "label":      "person",
          "confidence": 0.88,
          "bbox":       { "x": 0.1, "y": 0.0, "w": 0.4, "h": 0.9 }
        }
      ]
    }
  ]
}

Webhooks

Subscribe to events to receive push notifications instead of polling. ContentIndexer POSTs a signed JSON payload to your endpoint when events occur.

POST/v1/webhooks/subscriptionsCreate a subscription
GET/v1/webhooks/subscriptionsList subscriptions
DELETE/v1/webhooks/subscriptions/{id}Remove a subscription

Create a subscription

curl -X POST "https://api.contentindexer.com/v1/webhooks/subscriptions" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url":    "https://yourapp.com/webhooks/contentindexer",
    "events": ["job.completed", "job.failed"]
  }'

Available events

job.completedjob.failedjob.processingcredits.low

Webhook payload

{
  "event":     "job.completed",
  "job_id":    "01HXFJKM4NPQRS7WABCDEF",
  "status":    "completed",
  "timestamp": "2025-06-01T12:02:47Z",
  "data": {
    "workflow":   "ffprobe,mediapipe",
    "duration_s": 247
  }
}

Signature verification

Every webhook request includes an X-Signature header: an HMAC-SHA256 hex digest of the raw request body signed with your webhook secret. Always verify this in production.

import hmac, hashlib

def verify_signature(body: bytes, secret: str, signature: str) -> bool:
    expected = hmac.new(
        secret.encode('utf-8'),
        body,
        hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(expected, signature)

# In your webhook handler:
body = request.body          # raw bytes
sig  = request.headers['X-Signature']
if not verify_signature(body, WEBHOOK_SECRET, sig):
    return Response(status=401)
Webhooks are retried up to 5 times with exponential backoff if your endpoint returns a non-2xx status. Return 200 quickly — process events asynchronously to avoid timeouts.

Pricing & Credits

ContentIndexer uses a prepaid credits model. Purchase credits in advance — no subscriptions, no monthly minimums. Credits are charged per second of video processed per extractor.

Pay as you go
Purchase only what you need
Volume bonuses
Bonus credits on larger packages (e.g. 15% on $100)
Credits never expire
Use them on your schedule
GET/v1/credit-packagesList available packages
POST/v1/jobs/estimateEstimate job cost before submitting
GET/v1/user/billing-historyYour credit transaction history
GET/v1/user/billing-statsSummary stats (balance, usage)

Check your balance

curl "https://api.contentindexer.com/v1/user/billing-stats" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Response:
{
  "credits_balance":  1847,
  "credits_used":     3210,
  "credits_purchased": 5057,
  "jobs_completed":   42
}

Rate Limits

Rate limits protect the API from abuse and ensure fair access. When exceeded, the API returns 429 Too Many Requests with a Retry-After header.

LimitWindowScope
100 requests10 secondsPer IP address
1,000 requests1 hourPer user / API key

Retry with exponential backoff

async function withRetry(fn, maxAttempts = 5) {
  let delay = 1000;
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
    try {
      return await fn();
    } catch (err) {
      if (err.status !== 429 || attempt === maxAttempts) throw err;
      const retryAfter = err.headers?.['retry-after'];
      const wait = retryAfter ? parseInt(retryAfter) * 1000 : delay;
      console.log(`Rate limited. Waiting ${wait}ms (attempt ${attempt})`);
      await new Promise(r => setTimeout(r, wait));
      delay = Math.min(delay * 2, 60000); // cap at 60s
    }
  }
}
Response headers include X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset so you can proactively throttle your requests.

Error Handling

All errors follow RFC 7807 Problem Details format. Every error response includes a request_id you can share with support.

Error response shape

{
  "type":       "https://contentindexer.com/errors/unauthorized",
  "title":      "Unauthorized",
  "status":     401,
  "detail":     "Invalid or expired API key. Check your Authorization header.",
  "request_id": "req_01HXG5K3NPQRS7W"
}

HTTP status codes

CodeStatusWhen
200OKRequest succeeded
201CreatedResource created (e.g. job, API key)
400Bad RequestInvalid parameters or request body
401UnauthorizedMissing or invalid API key
403ForbiddenAuthenticated but insufficient permissions
404Not FoundResource does not exist
409ConflictResource already exists
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server-side failure
Always check the detail field for a human-readable explanation and the request_id when contacting support — it lets us trace your specific request in our logs.

Code Examples

Full end-to-end example: authenticate, submit a job, poll for completion, and fetch results.

# 1. Get your user profile
curl "https://api.contentindexer.com/v1/user/me" \
  -H "Authorization: Bearer YOUR_API_KEY"

# 2. Submit a job
JOB=$(curl -s -X POST "https://api.contentindexer.com/v1/jobs" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content_url":"https://www.youtube.com/watch?v=VIDEO_ID","workflow":"ffprobe,mediapipe"}')
JOB_ID=$(echo $JOB | jq -r '.id')

# 3. Poll until complete
while true; do
  STATUS=$(curl -s "https://api.contentindexer.com/v1/jobs/$JOB_ID" \
    -H "Authorization: Bearer YOUR_API_KEY" | jq -r '.status')
  echo "Status: $STATUS"
  [ "$STATUS" = "completed" ] && break
  [ "$STATUS" = "failed" ] && exit 1
  sleep 5
done

# 4. Fetch results
curl "https://api.contentindexer.com/v1/results/$JOB_ID/mediapipe" \
  -H "Authorization: Bearer YOUR_API_KEY" | jq

Export to video editor

Convert AI detections into timeline markers you can import into Final Cut Pro, DaVinci Resolve, or any OpenTimelineIO-compatible NLE.

# Generate OTIO export with all composite scene analysis
curl "https://api.contentindexer.com/v1/jobs/${JOB_ID}/export?format=otio&composite=all" \
  -H "Authorization: Bearer YOUR_API_KEY" | jq

# Response includes a presigned download URL:
{
  "format":     "otio",
  "export_url": "https://s3.amazonaws.com/...?X-Amz-Signature=...",
  "expires_at": "2025-06-01T13:02:47Z",
  "markers":    247
}

Upload and process in one flow

# 1. Upload file
CONTENT=$(curl -s -X POST "https://api.contentindexer.com/v1/content/upload" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@./footage.mp4")
CONTENT_ID=$(echo $CONTENT | jq -r '.id')

# 2. Submit job using content ID
JOB=$(curl -s -X POST "https://api.contentindexer.com/v1/jobs" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{"content_id": "$CONTENT_ID", "workflow": "ffprobe,mediapipe,ffmpeg_shot_detection"}")
echo "Job: $(echo $JOB | jq -r '.id')"

# 3. Wait for completion and export
JOB_ID=$(echo $JOB | jq -r '.id')
# ... poll as shown above, then:
curl "https://api.contentindexer.com/v1/jobs/$JOB_ID/export?format=fcpxml" \
  -H "Authorization: Bearer YOUR_API_KEY"