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

# Validate Stream

> Validate a stream URL and return rich metadata.

Returns detailed information about the stream including platform,
title, channel, thumbnail, and viewer count.

Checks whether a stream URL is valid and currently live, and returns stream metadata plus a parsed playback URL when available.

Use this before starting expensive monitoring jobs when you want early feedback on bad URLs.

## Typical flow

1. Validate with `POST /streams/validate`.
2. Use `parsed_url` from the response for frontend playback/preview if needed.
3. Start [Check Once](/api-reference/check-once), [Live Monitor](/api-reference/live-monitor), or [Live Digest](/api-reference/live-digest).

## Notes

* Main monitoring endpoints can still validate internally.
* Explicit validation is useful for better UX and pre-flight checks.

## Related

* Delivery and modes: [Monitoring Modes and Delivery Patterns](/core-concepts/how-trio-works)
* Tuning tradeoffs: [Tune Monitoring for Latency, Accuracy, and Cost](/guides/configuring-live-digest)


## OpenAPI

````yaml POST /streams/validate
openapi: 3.1.0
info:
  title: Trio API
  description: Reality as an API - Monitor YouTube Live streams with vision models
  version: 1.0.0
servers:
  - url: https://trio.machinefi.com/api
security: []
paths:
  /streams/validate:
    post:
      tags:
        - Utilities
      summary: Validate Stream
      description: |-
        Validate a stream URL and return rich metadata.

        Returns detailed information about the stream including platform,
        title, channel, thumbnail, and viewer count.
      operationId: validate_stream_streams_validate_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateStreamRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateStreamResponse'
        '400':
          description: Invalid request or malformed JSON
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            text/plain:
              example: Invalid HTTP request received.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ValidateStreamRequest:
      properties:
        stream_url:
          type: string
          maxLength: 500
          minLength: 1
          title: Stream Url
          description: Stream URL to validate
      type: object
      required:
        - stream_url
      title: ValidateStreamRequest
      description: Request for stream validation.
    ValidateStreamResponse:
      properties:
        is_live:
          type: boolean
          title: Is Live
        platform:
          anyOf:
            - type: string
            - type: 'null'
          title: Platform
        stream_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Stream Id
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        channel:
          anyOf:
            - type: string
            - type: 'null'
          title: Channel
        thumbnail_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Thumbnail Url
        viewer_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Viewer Count
        parsed_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Parsed Url
        error_hint:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Hint
      type: object
      required:
        - is_live
      title: ValidateStreamResponse
      description: Rich response for stream validation.
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
        - error
      title: ErrorResponse
      description: Wrapper for error responses.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ErrorDetail:
      properties:
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
        remediation:
          type: string
          title: Remediation
      type: object
      required:
        - code
        - message
        - remediation
      title: ErrorDetail
      description: Standardized error response for better DX.
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````