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

# Search viral library

> Semantic search across all analyzed videos using natural language queries. Search by hooks, content themes, performance traits, or any aspect of the video analysis. Powered by vector embeddings for intelligent matching.



## OpenAPI

````yaml /openapi.json get /viral-library/search
openapi: 3.0.0
info:
  title: RawUGC API
  version: 1.0.0
  description: >-
    Generate AI videos, images, and music, and schedule social media posts
    programmatically.
  contact:
    name: API Support
    email: support@rawugc.com
    url: https://docs.rawugc.com
  license:
    name: Proprietary
servers:
  - url: https://rawugc.com/api/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Tasks
    description: >-
      Deprecated. Use typed resource endpoints instead: GET /videos/{videoId},
      GET /images/{imageId}, GET /music/{musicId}.
  - name: Image Generation
    description: >-
      Generate and edit AI images using Nano Banana models. Supports
      text-to-image generation (6 credits) and image-to-image editing (2
      credits).
  - name: Video Generation
    description: Generate and manage AI videos using Sora 2, Kling, and Veo 3 models
  - name: Personas
    description: Manage target audience personas for content plans
  - name: Messaging
    description: Manage brand/positioning messaging for content plans
  - name: Products
    description: Manage products for video generation
  - name: Styles
    description: Manage video creative styles and templates
  - name: Characters
    description: List available AI characters for video generation
  - name: Video Editing
    description: Post-process videos with captions, overlays, and effects
  - name: Upload
    description: Upload video and image files for use in generation requests
  - name: Social Scheduling
    description: Schedule and manage social media posts to TikTok, Instagram, and YouTube
  - name: Social Accounts
    description: Manage connected social media accounts
  - name: Music Generation
    description: >-
      Generate AI music tracks using Suno models with customizable genre, mood,
      and style
  - name: Viral Library
    description: >-
      Browse and search analyzed TikTok videos across the platform. Includes
      AI-powered analysis with hooks, keyframes, performance insights, and
      semantic search via natural language queries.
  - name: Research
    description: >-
      Scrape TikTok videos, analyze any video, and generate content plans. Tools
      for competitive research and content strategy.
paths:
  /viral-library/search:
    get:
      tags:
        - Viral Library
      summary: Search viral library
      description: >-
        Semantic search across all analyzed videos using natural language
        queries. Search by hooks, content themes, performance traits, or any
        aspect of the video analysis. Powered by vector embeddings for
        intelligent matching.
      operationId: searchViralLibrary
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
          description: >-
            Natural language search query (e.g., 'before after transformation',
            'pattern interrupt hooks', 'skincare product demos')
        - name: limit
          in: query
          schema:
            type: integer
            default: 20
            minimum: 1
            maximum: 50
          description: Maximum number of results to return
      responses:
        '200':
          description: Search results ranked by relevance
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/ViralLibrarySearchResult'
                  query:
                    type: string
                    description: The search query that was executed
                  total:
                    type: integer
                    description: Number of results returned
        '400':
          description: Missing required query parameter 'q'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    ViralLibrarySearchResult:
      type: object
      description: A search result containing a video and its relevance score
      properties:
        video:
          $ref: '#/components/schemas/ViralLibraryVideo'
        score:
          type: number
          description: Relevance score (0-1, higher is more relevant)
    ApiError:
      type: object
      properties:
        type:
          type: string
          format: uri
          description: >-
            URI reference identifying the problem type (e.g.,
            https://api.rawugc.com/errors/validation_error)
        title:
          type: string
          description: Short, human-readable summary of the problem
        status:
          type: number
          description: HTTP status code
        detail:
          type: string
          description: Human-readable explanation of the problem
        instance:
          type: string
          format: uri
          description: URI reference identifying this specific occurrence
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Field-specific validation errors
    ViralLibraryVideo:
      type: object
      description: A viral video with its metadata and optional AI analysis
      properties:
        id:
          type: string
          description: Unique video identifier
        tiktokId:
          type: string
          description: Original TikTok video ID
        tiktokUrl:
          type: string
          format: uri
          description: URL to the original TikTok video
        username:
          type: string
          description: TikTok creator username
        description:
          type: string
          description: Video caption/description
        stats:
          type: object
          properties:
            views:
              type: number
            likes:
              type: number
            comments:
              type: number
            shares:
              type: number
            saves:
              type: number
          description: Engagement metrics
        hashtags:
          type: array
          items:
            type: string
          description: Hashtags used in the video
        soundName:
          type: string
          description: Name of the sound/music used
        duration:
          type: number
          description: Video duration in seconds
        thumbnailUrl:
          type: string
          format: uri
          description: Thumbnail image URL
        playUrl:
          type: string
          format: uri
          description: Direct video playback URL
        analysis:
          nullable: true
          description: AI analysis data (null if not yet analyzed)
          allOf:
            - $ref: '#/components/schemas/VideoAnalysis'
    VideoAnalysis:
      type: object
      description: >-
        AI-generated analysis of a viral video including hooks, keyframes, and
        performance insights
      properties:
        hook:
          type: string
          description: The opening hook text/technique used in the video
        summary:
          type: string
          description: Brief summary of the video content and approach
        whyItPerformed:
          type: array
          items:
            type: string
          description: Reasons why this video performed well
        attributesToCopy:
          type: array
          items:
            type: string
          description: Specific attributes worth replicating in your own content
        hooksToTest:
          type: array
          items:
            type: string
          description: Alternative hooks inspired by this video to test
        keyframes:
          type: array
          description: Per-second keyframe analysis with typed categories
          items:
            type: object
            properties:
              timestamp:
                type: number
                description: Timestamp in seconds
              type:
                type: string
                description: Keyframe category (hook, transition, product_shot, cta, etc.)
              description:
                type: string
                description: What happens at this keyframe
              visual:
                type: string
                description: Visual description
              audio:
                type: string
                description: Audio/sound description
              text:
                type: string
                description: On-screen text if any
        durationSeconds:
          type: number
          description: Video duration in seconds
        tags:
          type: array
          items:
            type: string
          description: AI-generated content tags
        analyzedAt:
          type: number
          description: Timestamp when analysis was performed (ms since epoch)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Use your API key from the RawUGC dashboard. Include as: Authorization:
        Bearer YOUR_API_KEY

````