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

# Niche Videos

> Get trending videos for a specific content niche

## Overview

This endpoint returns trending videos within a specific content niche. Use this to discover viral content in your target category.

### Path Parameters

<ParamField path="nicheId" type="string" required>
  The niche identifier (e.g., "fitness", "cooking", "gaming")
</ParamField>

### Query Parameters

<ParamField query="platform" type="string">
  Filter by platform:

  * `tiktok`: TikTok videos only
  * `youtube`: YouTube videos only
  * Omit to get videos from all platforms
</ParamField>

<ParamField query="limit" type="number" default="20">
  Number of videos to return (1-50)
</ParamField>

<ParamField query="offset" type="number" default="0">
  Pagination offset
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="data">
    <ResponseField name="niche" type="object">
      Niche information including id, label, emoji, and description
    </ResponseField>

    <ResponseField name="videos" type="array">
      Array of video objects with creator info, stats, and metadata
    </ResponseField>

    <ResponseField name="total" type="number">
      Total videos in this niche
    </ResponseField>

    <ResponseField name="limit" type="number">
      Current limit applied
    </ResponseField>

    <ResponseField name="offset" type="number">
      Current offset applied
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.hooked.so/v1/niche/fitness/videos?platform=tiktok&limit=10" \
    -H "x-api-key: your_api_key_here"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.hooked.so/v1/niche/fitness/videos?platform=tiktok&limit=10', {
    headers: {
      'x-api-key': 'your_api_key_here'
    }
  });

  const data = await response.json();
  console.log(data.data.videos);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.hooked.so/v1/niche/fitness/videos',
      params={'platform': 'tiktok', 'limit': 10},
      headers={'x-api-key': 'your_api_key_here'}
  )

  videos = response.json()['data']['videos']
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "niche": {
        "id": "fitness",
        "label": "Fitness",
        "emoji": "💪",
        "description": "Workout routines, fitness tips, and gym content"
      },
      "videos": [
        {
          "id": "clx123abc",
          "externalId": "7234567890123456789",
          "platform": "tiktok",
          "title": "5 minute ab workout #fitness",
          "thumbnailUrl": "https://cdn.tiktok.com/thumb.jpg",
          "videoUrl": "https://www.tiktok.com/@creator/video/7234567890123456789",
          "creator": {
            "username": "fitnessguru",
            "displayName": "Fitness Guru",
            "avatarUrl": "https://cdn.tiktok.com/avatar.jpg",
            "followers": 1500000,
            "isVerified": true
          },
          "stats": {
            "views": 2300000,
            "likes": 456000,
            "comments": 8900,
            "shares": 23000
          },
          "viralScore": 88.5,
          "engagementRate": 21.2,
          "hashtags": ["fitness", "abs", "workout"],
          "publishedAt": "2024-01-15T10:30:00Z"
        }
      ],
      "total": 85,
      "limit": 10,
      "offset": 0
    }
  }
  ```
</ResponseExample>

<Note>
  If the niche ID is invalid, a 404 error will be returned. Use the [List Niches](/api-reference/niche/list) endpoint to get valid niche IDs.
</Note>


## OpenAPI

````yaml GET /v1/niche/{nicheId}/videos
openapi: 3.0.0
info:
  title: Hooked API
  version: 1.0.0
  description: AI Video Generation API
servers:
  - url: https://api.hooked.so
security:
  - ApiKeyAuth: []
paths:
  /v1/niche/{nicheId}/videos:
    get:
      tags:
        - Niches
      summary: Niche Videos
      description: Get trending videos for a specific content niche
      operationId: getNicheVideos
      parameters:
        - name: nicheId
          in: path
          required: true
          schema:
            type: string
        - name: platform
          in: query
          schema:
            type: string
            enum:
              - tiktok
              - youtube
        - name: limit
          in: query
          schema:
            type: integer
            default: 20
        - name: offset
          in: query
          schema:
            type: integer
            default: 0
      responses:
        '200':
          description: Success
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````