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

# Search RTStream

> Search indexed content within a real-time stream

Search for specific content within a real-time stream's scene index using semantic search.

<Note>
  * `query` and `scene_index_id` are required
  * `result_threshold` limits the number of results (default: 10)
  * `score_threshold` filters by minimum relevance score
  * Enable `rerank` for improved result ordering
  * Use `stitch` to merge adjacent matching segments (default: true)
</Note>

<CardGroup cols={2}>
  <Card title="Create Scene Index" icon="plus" href="/api-reference/rtstream/scene-indexing/create_rtstream_scene_index">
    Set up scene indexing first
  </Card>

  <Card title="Event Detection" icon="bell" href="/pages/act/live-action/event-detection-patterns">
    Build event detection patterns
  </Card>
</CardGroup>


## OpenAPI

````yaml POST /rtstream/{stream_id}/search
openapi: 3.0.3
info:
  title: VideoDB Server API
  description: >
    VideoDB Server API for video, audio, and image processing with AI
    capabilities.

    This API provides comprehensive video management, search, indexing, and
    AI-powered features.
  version: 1.0.0
  contact:
    name: VideoDB Support
    url: https://videodb.io
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.videodb.io
    description: Production server
  - url: https://staging-api.videodb.io
    description: Staging server
security:
  - ApiKeyAuth: []
tags:
  - name: Authentication
    description: User authentication and API key management
  - name: Collections
    description: Collection management operations
  - name: Videos
    description: Video upload, processing, and management
  - name: Audio
    description: Audio management operations
  - name: Images
    description: Image management operations
  - name: Search
    description: Content search and indexing
  - name: AI Generation
    description: AI-powered content generation
  - name: Billing
    description: Billing and usage management
  - name: RTStream
    description: Real-time streaming operations
  - name: Utilities
    description: Utility endpoints
  - name: Meeting
    description: Meeting recording and management
  - name: Capture
    description: Capture session management for recording streams
  - name: Editor
    description: Timeline editor operations
  - name: Transcode
    description: Media transcoding operations
  - name: Assets
    description: Cross-collection asset listing
paths:
  /rtstream/{stream_id}/search:
    post:
      tags:
        - RTStream
      summary: Search RTStream scene index
      parameters:
        - name: stream_id
          in: path
          required: true
          schema:
            type: string
            example: rts-12345
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - query
                - scene_index_id
              properties:
                query:
                  type: string
                  example: person walking
                scene_index_id:
                  type: string
                  example: scene-idx-12345
                result_threshold:
                  type: integer
                  default: 10
                  example: 10
                score_threshold:
                  type: number
                  example: 0.5
                dynamic_score_percentage:
                  type: integer
                  default: 20
                  example: 20
                stitch:
                  type: boolean
                  default: true
                  example: true
                filter:
                  type: array
                  items:
                    type: object
                rerank:
                  type: boolean
                  default: false
                  example: false
                rerank_params:
                  type: object
      responses:
        '200':
          description: Search results
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      results:
                        type: array
                        items:
                          type: object
                          properties:
                            start:
                              type: number
                              example: 1700000000
                            end:
                              type: number
                              example: 1700000010
                            text:
                              type: string
                              example: matching scene text
                            score:
                              type: number
                              example: 0.95
                            scene_index_id:
                              type: string
                              example: scene-idx-12345
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-access-token
      description: API key for authentication (sk-xxx format)

````