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

# Add filters to related niches search

> Add filters from a predefined list to your related niches search.



## OpenAPI

````yaml /api-v2/api-v2.yaml post /getRelatedNiches
openapi: 3.1.0
info:
  version: '2'
  title: CreatorDB Headless APIService
  description: >-
    Generated from swaggerComponentIndex.json by core-types-json-schema
    (https://github.com/grantila/core-types-json-schema). Use OpenAPI 3.1.0
    version with direct JSON Schema support
  termsOfService: https://www.creatordb.app
  contact:
    name: CreatorDB
    url: https://www.creatordb.app
    email: support@creatordb.app
  license:
    url: http://www.apache.org/licenses/LICENSE-2.0.html
    name: Apache 2.0
  x-id: indexForSwagger.yaml
servers:
  - url: https://dev.creatordb.app/v2
    description: CreatorDB API Endpoint - prod version
security: []
tags:
  - name: General Operations
    description: >-
      General-purpose endpoints such as API status, content retrieval, and
      cross-platform operations
  - name: YouTube
    description: >-
      YouTube creator data endpoints including basic metrics, historical data,
      and detailed analytics
  - name: Instagram
    description: >-
      Instagram creator data endpoints with metrics and advanced search
      capabilities
  - name: TikTok
    description: >-
      TikTok creator data endpoints with metrics and advanced search
      functionality
  - name: Threads
    description: Threads creator data endpoints with basic metrics and historical data
  - name: Facebook
    description: Facebook creator data endpoints with metrics and search capabilities
  - name: Topic
    description: Topic-based analysis and reporting endpoints for content categorization
  - name: Brand
    description: Brand analysis endpoints including sponsor search and brand reports
  - name: Niches
    description: Niche-related endpoints for content category analysis and related searches
paths:
  /getRelatedNiches:
    post:
      tags:
        - Niches
      summary: Add filters to related niches search
      description: Add filters from a predefined list to your related niches search.
      operationId: getRelatedNiches
      parameters:
        - name: apiId
          in: header
          description: ''
          required: true
          schema:
            type: string
            examples:
              - LE6DPZQkR3TQShxofXoD2j8qCBu1-f0jti665m1t50dwDD12W
      requestBody:
        description: >-
          platform support `youtube` only, and nicheIds is a list of nicheId,
          max 30 niches can be used.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RelatedNicheSearchParams'
            examples:
              default:
                value:
                  platform: youtube
                  nicheIds:
                    - id_youtuber_Entertainment
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/RelatedNiches'
                  quotaUsed:
                    type: number
                    description: API credits that were used to make this call.
                  quotaUsedTotal:
                    type: number
                    description: Total API credits used since the last billing cycle.
                  remainingPlanCredit:
                    type: number
                    description: >-
                      The number of remaining free API credits that come with
                      your subscription plan. These API credits are renewed
                      every billing cycle.
                  remainingPrepurchasedCredit:
                    type: number
                    description: >-
                      The number of remaining extra purchased API credits. These
                      API credits do not expire until used.
                  timestamp:
                    type: number
                    description: >-
                      Unix timestamp of the call request that the server
                      received.
                  error:
                    type: string
                    description: Errors that occurred during the API call.
                  success:
                    type: boolean
                    description: It is TRUE when the call is successful.
              examples:
                default:
                  value:
                    data:
                      platform: youtube
                      nicheIds:
                        - NICHES_0
                        - NICHES_1
                        - NICHES_2
                    quotaUsed: 1
                    quotaUsedTotal: 6025
                    remainingPlanCredit: 993975
                    remainingPrepurchasedCredit: 0
                    timestamp: 1755503517183
                    error: ''
                    success: true
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/RelatedNiches'
                  quotaUsed:
                    type: number
                    description: API credits that were used to make this call.
                  quotaUsedTotal:
                    type: number
                    description: Total API credits used since the last billing cycle.
                  remainingPlanCredit:
                    type: number
                    description: >-
                      The number of remaining free API credits that come with
                      your subscription plan. These API credits are renewed
                      every billing cycle.
                  remainingPrepurchasedCredit:
                    type: number
                    description: >-
                      The number of remaining extra purchased API credits. These
                      API credits do not expire until used.
                  timestamp:
                    type: number
                    description: >-
                      Unix timestamp of the call request that the server
                      received.
                  error:
                    type: string
                    description: Errors that occurred during the API call.
                  success:
                    type: boolean
                    description: It is TRUE when the call is successful.
              examples:
                default:
                  value:
                    data: null
                    quotaUsed: 0
                    quotaUsedTotal: 0
                    remainingPlanCredit: 0
                    remainingPrepurchasedCredit: 0
                    timestamp: 1755503514762
                    error: APIKeyOnlyForTesting
                    success: false
      servers:
        - url: https://dev.creatordb.app/v2
          description: CreatorDB API Endpoint - prod version
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |
            curl --request POST \
              --url https://dev.creatordb.app/v2/getRelatedNiches \
              --header 'Accept: application/json' \
              --header 'Content-Type: application/json' \
              --header 'apiId: LE6DPZQkR3TQShxofXoD2j8qCBu1-f0jti665m1t50dwDD12W' \
              --data '{
              "platform": "youtube",
              "nicheIds": [
                "id_youtuber_Entertainment"
              ]
            }'            
components:
  schemas:
    RelatedNicheSearchParams:
      type: object
      description: The search criteria for retrieving related niches.
      additionalProperties: false
      properties:
        nicheIds:
          type: array
          description: >-
            A list of niche IDs that represent the creator's interest that is
            explicitly used in searches to initiate the recommendation system.
            The niche IDs used here will only look up stored values in a
            database.
          items:
            type: string
        platform:
          $ref: '#/components/schemas/Platform'
          description: >-
            The social media platform where niche recommendations are being
            made, such as YouTube, Instagram, or TikTok.
      required:
        - nicheIds
        - platform
    RelatedNiches:
      type: object
      additionalProperties: false
      properties:
        platform:
          $ref: '#/components/schemas/Platform'
          description: >-
            The social media platform where niche recommendations are being
            made, such as YouTube, Instagram, or TikTok.
        nicheIds:
          type: array
          description: >-
            A list of niche IDs that represent a creator's interests. For
            example, gaming, AI, fitness, and others. The ID is used to generate
            real-time recommendations.
          items:
            type: string
      required:
        - platform
        - nicheIds
    Platform:
      type: string
      enum:
        - youtube
        - instagram
        - tiktok

````