API

Search

Search all episodes for a topic.

GET /api/search/{query}
{
  "query": "ai agents",
  "matches": [
    {
      "episode_id": "2025-05-01-tbpn",
      "title": "TBPN | May 1, 2025",
      "date": "2025-05-01",
      "start_time": "01:23:45",
      "end_time": "01:24:30",
      "clip_url": "https://www.youtube.com/watch?v=abc123&t=5025",
      "transcript_snippet": "...",
      "score": 0.82,
      "rank": 1,
      "confidence": "strong",
      "match_reason": "Discusses AI agent frameworks.",
      "match_type": "hybrid"
    }
  ]
}

Episode search

Search within one episode.

GET /api/episodes/{id}/search/{query}
{
  "query": "nvidia",
  "episodeId": "2025-05-01-tbpn",
  "matches": []
}

Guest search

Search what a guest said about a topic.

GET /api/guests/{guest}/search/{topic}
{
  "query": "openai",
  "guestName": "Sam Altman",
  "windowsSearched": 3,
  "matches": []
}

Guest lookup

Find guest names for autocomplete.

GET /api/guests/{guest}
{
  "guests": [
    {
      "id": "sam-altman",
      "person": "Sam Altman",
      "company": "OpenAI",
      "job_position": "CEO"
    }
  ]
}

List episodes

All ingested episodes.

GET /api/episodes
{
  "episodes": [
    {
      "id": "2025-05-01-tbpn",
      "title": "TBPN | May 1, 2025",
      "published_at": "2025-05-01",
      "youtube_video_id": "abc123",
      "duration_seconds": 10800
    }
  ]
}

Episode transcript

Full transcript as timestamped chunks.

GET /api/episodes/{id}/transcript
{
  "episode": {
    "id": "2025-05-01-tbpn",
    "title": "TBPN | May 1, 2025",
    "published_at": "2025-05-01",
    "youtube_video_id": "abc123",
    "duration_seconds": 10800,
    "source_url": "https://www.youtube.com/watch?v=abc123"
  },
  "chunk_count": 142,
  "chunks": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "start_seconds": 0,
      "end_seconds": 62,
      "start_time": "00:00:00",
      "end_time": "00:01:02",
      "text": "...",
      "speaker": null,
      "clip_url": "https://www.youtube.com/watch?v=abc123&t=0",
      "words_url": "/api/chunks/550e8400-e29b-41d4-a716-446655440000"
    }
  ]
}

Chunk words

Word-level timestamps for a chunk.

GET /api/chunks/{chunkId}
{
  "episode_id": "2025-05-01-tbpn",
  "chunk": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "start_seconds": 0,
    "end_seconds": 62,
    "start_time": "00:00:00",
    "end_time": "00:01:02",
    "text": "..."
  },
  "word_count": 48,
  "words": [
    {
      "word_index": 0,
      "word": "Welcome",
      "start_seconds": 0.12,
      "end_seconds": 0.48
    }
  ]
}

Episode chunk words

Word timestamps for a chunk in an episode.

GET /api/episodes/{id}/chunks/{chunkId}/words
{
  "episode_id": "2025-05-01-tbpn",
  "chunk": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "start_seconds": 0,
    "end_seconds": 62,
    "start_time": "00:00:00",
    "end_time": "00:01:02",
    "text": "..."
  },
  "word_count": 48,
  "words": []
}