openapi: 3.0.0
info:
  title: Kick Video API
  description: |
    Get a Kick VOD's or clip's public details from its link or id. A VOD carries its title, length, views, start, end and expiry times, language, caption languages, category, visibility, live and mature flags and thumbnail. A clip carries its title, length, views, when the clipped moment aired and when the clip was made, category, visibility, mature flag, thumbnail, who clipped it, and the VOD it was cut from with its offset.

    **Cross-linking**: `kick_channel` returns the `live.id` of a stream on air, which is also its VOD id here. `video.vod.id` is the clip's VOD, to pass here as `video_id` with `channel.username` as `username`.
  version: 1.0.0
servers:
  - url: https://www.searchapi.io/api/v1
paths:
  /search:
    get:
      summary: Kick Video Search
      security:
        - ApiKeyAuth: []
        - ApiKeyQuery: []
      parameters:
        - name: engine
          in: query
          required: true
          description: Search engine identifier
          schema:
            type: string
            enum: ["kick_video"]
            default: "kick_video"
        - name: url
          in: query
          required: false
          description: Link to a Kick VOD or clip, as kick.com/username/videos/id, kick.com/username/clips/clip_id or kick.com/username?clip=clip_id. Required unless video_id with username, or clip_id, is given.
          schema:
            type: string
            maxLength: 2048
        - name: video_id
          in: query
          required: false
          description: Kick VOD id, the UUID in kick.com/username/videos/id. Requires username.
          schema:
            type: string
            pattern: '^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$'
        - name: username
          in: query
          required: false
          description: Kick username of the channel the VOD belongs to, as in kick.com/username. Required with video_id and not accepted with url or clip_id.
          schema:
            type: string
            pattern: '^@?[A-Za-z0-9_ -]{1,25}$'
        - name: clip_id
          in: query
          required: false
          description: Kick clip id, as in kick.com/username/clips/clip_id. Used alone.
          schema:
            type: string
            pattern: '^[Cc][Ll][Ii][Pp]_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$'
        - name: zero_retention
          in: query
          required: false
          description: Set to true to disable logging and persistent storage for this request. Enterprise plans only.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
        '400':
          description: Validation Error. There is an issue with query parameters, such as missing required parameters or invalid values.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication Error. The API key is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden. Zero data retention is not available to the account, or the account requires `zero_retention=true`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate Limit Exceeded. The number of allowed requests has been exceeded. Consider upgrading your plan or waiting for the limit to reset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server Error. Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Timeout. We could not retrieve results in 90 seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Use Bearer authentication. Format: "Bearer YOUR_API_KEY"'
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: Pass API key as query parameter
  schemas:
    SearchResponse:
      type: object
      required: [search_metadata, search_parameters]
      properties:
        search_metadata:
          $ref: '#/components/schemas/SearchMetadata'
        search_parameters:
          $ref: '#/components/schemas/SearchParameters'
        video:
          $ref: '#/components/schemas/Video'
        channel:
          $ref: '#/components/schemas/Channel'
        error:
          type: string
          description: Error message for a VOD, clip or channel Kick does not have.

    SearchMetadata:
      type: object
      required: [status, created_at]
      properties:
        id:
          type: string
          description: Unique identifier for the search request
        status:
          type: string
          description: Status of the search request
        created_at:
          type: string
          format: date-time
          description: Timestamp when the search was created
        request_time_taken:
          type: number
          description: Time taken to make the request in seconds
        parsing_time_taken:
          type: number
          description: Time taken to parse the results in seconds
        total_time_taken:
          type: number
          description: Total time taken for the search in seconds
        request_url:
          type: string
          description: Kick URL for this search
        html_url:
          type: string
          description: URL to view HTML results
        json_url:
          type: string
          description: URL to view JSON results

    SearchParameters:
      type: object
      properties:
        engine:
          type: string
          description: Search engine identifier
        url:
          type: string
          description: Kick VOD or clip link
        video_id:
          type: string
          description: Kick VOD id
        username:
          type: string
          description: Kick username in Kick's lower-case form
        clip_id:
          type: string
          description: Kick clip id
        zero_retention:
          type: boolean
          description: Whether zero data retention was requested

    Video:
      type: object
      required: [type, id, link]
      properties:
        type:
          type: string
          enum: [vod, clip]
          description: Whether the result is a VOD or a clip.
        id:
          type: string
          description: Kick VOD or clip ID.
        link:
          type: string
          description: URL of the VOD or clip page.
        title:
          type: string
          description: Title of the VOD or clip.
        length_seconds:
          type: integer
          description: Length in seconds.
        views:
          type: integer
          description: Number of views.
        started_at:
          type: string
          format: date-time
          description: When the stream started for a VOD, or when the clipped moment aired for a clip.
        ended_at:
          type: string
          format: date-time
          description: When the stream of a VOD ended.
        created_at:
          type: string
          format: date-time
          description: When the clip was made.
        expires_at:
          type: string
          format: date-time
          description: When Kick removes the VOD.
        language:
          type: string
          description: Language code of the VOD.
        caption_languages:
          type: array
          description: Language codes of the VOD's captions.
          items:
            type: string
        category:
          $ref: '#/components/schemas/Category'
        visibility:
          type: string
          description: Who can watch the VOD or clip, such as public.
        is_live:
          type: boolean
          description: Whether the VOD's stream is still live.
        is_mature:
          type: boolean
          description: Whether the VOD or clip is marked for mature audiences.
        thumbnail:
          type: string
          description: URL of the thumbnail.
        clipped_by:
          $ref: '#/components/schemas/ClippedBy'
        vod:
          $ref: '#/components/schemas/ClipVod'

    Category:
      type: object
      properties:
        id:
          type: integer
          description: Kick category ID.
        name:
          type: string
          description: Category name.
        slug:
          type: string
          description: Category handle as in kick.com/category/slug.

    ClippedBy:
      type: object
      properties:
        id:
          type: integer
          description: Kick user ID of the person who made the clip.
        username:
          type: string
          description: Handle of the person who made the clip, as in kick.com/username.
        name:
          type: string
          description: Display name of the person who made the clip.

    ClipVod:
      type: object
      required: [id, link, offset_seconds]
      properties:
        id:
          type: string
          description: Kick VOD ID of the recording the clip was cut from.
        link:
          type: string
          description: URL of the VOD page.
        offset_seconds:
          type: integer
          description: Seconds into the VOD where the clip starts.

    Channel:
      type: object
      required: [id, username, link]
      properties:
        id:
          type: integer
          description: Kick channel ID.
        username:
          type: string
          description: Channel handle as in kick.com/username.
        name:
          type: string
          description: Display name of the channel owner.
        link:
          type: string
          description: URL of the channel page.

    ErrorResponse:
      type: object
      required: [error]
      properties:
        error:
          type: string
          description: Error message describing what went wrong
