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

# Search

> Search for video segments matching a text query, image file, or image URL.

At least one of `query`, `image`, or `image_url` is required. Supports two search modes:
- **image_first** (default): prioritises visual similarity, blends in text signals when present.
- **fusion**: combines visual and text rankings using Reciprocal Rank Fusion.

Results are grouped by video and include timestamped segment clips with presigned URLs
(valid ~1 hour) and transcription snippets where available.



## OpenAPI

````yaml /openapi.json post /v1/search
openapi: 3.1.0
info:
  title: Pureframe API
  version: v1
  description: >-
    The Pureframe API lets you upload videos, index them for semantic search,
    and retrieve timestamped clips matching text queries or reference images.
    All endpoints require a Bearer API key (`Authorization: Bearer pf_...`).
  contact:
    url: https://pureframe.ai
    email: hello@pureframe.ai
  x-logo:
    url: https://pureframe.ai/logo.png
servers:
  - url: https://api.pureframe.ai
    description: Production
security: []
tags: []
paths:
  /v1/search:
    post:
      tags:
        - Search
      summary: Search
      description: >-
        Search for video segments matching a text query, image file, or image
        URL.


        At least one of `query`, `image`, or `image_url` is required. Supports
        two search modes:

        - **image_first** (default): prioritises visual similarity, blends in
        text signals when present.

        - **fusion**: combines visual and text rankings using Reciprocal Rank
        Fusion.


        Results are grouped by video and include timestamped segment clips with
        presigned URLs

        (valid ~1 hour) and transcription snippets where available.
      operationId: search_v1_search_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_search_v1_search_post'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_list_SearchResult__'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    Body_search_v1_search_post:
      properties:
        query:
          anyOf:
            - type: string
            - type: 'null'
          title: Query
        image:
          anyOf:
            - type: string
              contentMediaType: application/octet-stream
            - type: 'null'
          title: Image
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
        collection_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Collection Id
        modes:
          items:
            type: string
          type: array
          title: Modes
          default:
            - video
            - transcript
            - scene
        natural_language:
          type: boolean
          title: Natural Language
          default: false
        labels:
          items:
            type: string
          type: array
          title: Labels
          default: []
        page:
          type: integer
          title: Page
          default: 1
        per_page:
          type: integer
          title: Per Page
          default: 10
        include_hidden:
          type: boolean
          title: Include Hidden
          default: false
      type: object
      title: Body_search_v1_search_post
    ApiResponse_list_SearchResult__:
      properties:
        data:
          items:
            $ref: '#/components/schemas/SearchResult'
          type: array
          title: Data
        meta:
          $ref: '#/components/schemas/Meta'
      type: object
      required:
        - data
        - meta
      title: ApiResponse[list[SearchResult]]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SearchResult:
      properties:
        video_id:
          type: string
          title: Video Id
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
        collection_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Collection Id
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        segments:
          items:
            $ref: '#/components/schemas/SearchSegment'
          type: array
          title: Segments
      type: object
      required:
        - video_id
        - segments
      title: SearchResult
    Meta:
      properties:
        request_id:
          type: string
          title: Request Id
        took_ms:
          type: number
          title: Took Ms
        total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total
        page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page
        per_page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Per Page
        facets:
          anyOf:
            - additionalProperties:
                additionalProperties:
                  type: integer
                type: object
              type: object
            - type: 'null'
          title: Facets
      type: object
      required:
        - request_id
        - took_ms
      title: Meta
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    SearchSegment:
      properties:
        timestamp_start:
          type: number
          title: Timestamp Start
        timestamp_end:
          type: number
          title: Timestamp End
        score:
          type: number
          title: Score
        type:
          type: string
          title: Type
        text_content:
          anyOf:
            - type: string
            - type: 'null'
          title: Text Content
        bbox:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Bbox
        video_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Video Url
        thumbnail_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Thumbnail Url
        hidden:
          type: boolean
          title: Hidden
          default: false
        rank:
          type: integer
          title: Rank
        raw_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Raw Score
        threshold_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Threshold Key
      type: object
      required:
        - timestamp_start
        - timestamp_end
        - score
        - type
        - rank
      title: SearchSegment
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````