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

# TikTok Search API

> One page of keyword search results.



## OpenAPI

````yaml openapi.json GET /v1/tiktok/search
openapi: 3.0.0
info:
  title: ScoutLayer API
  version: 1.0.0
  description: Competitor data. One API.
servers:
  - url: https://api.scoutlayer.io
    description: Production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
paths:
  /v1/tiktok/search:
    get:
      tags:
        - tiktok
        - search
        - videos
      summary: Search TikTok videos by keyword
      description: One page of keyword search results.
      parameters:
        - schema:
            type: string
            minLength: 1
            example: shopify apps
          required: true
          name: query
          in: query
        - schema:
            type: string
            enum:
              - relevance
              - latest
              - most-liked
          required: false
          name: sort
          in: query
        - schema:
            type: string
            enum:
              - day
              - week
              - month
              - 3months
              - 6months
          required: false
          name: publishedWithin
          in: query
        - schema:
            type: string
            example: US
          required: false
          name: region
          in: query
        - schema:
            type: string
          required: false
          name: cursor
          in: query
      responses:
        '200':
          description: Search TikTok videos by keyword
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TikTokVideoList'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Insufficient credits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: This endpoint is declared but not yet implemented — never charged
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: The orchestrator failed or was unreachable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  schemas:
    TikTokVideoList:
      type: object
      properties:
        videos:
          type: array
          items:
            $ref: '#/components/schemas/TikTokVideo'
        nextCursor:
          type: string
          nullable: true
          description: >-
            Opaque pagination cursor — pass as ?cursor= for the next page; null
            on the last page
        hasMore:
          type: boolean
      required:
        - videos
        - nextCursor
        - hasMore
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: NOT_FOUND
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
    TikTokVideo:
      type: object
      properties:
        videoId:
          type: string
        description:
          type: string
        url:
          type: string
        createdAt:
          type: string
        region:
          type: string
        coverUrl:
          type: string
          description: CDN URL — signed, expires after a few hours
        durationMs:
          type: integer
        isAd:
          type: boolean
        hashtags:
          type: array
          items:
            type: string
        metrics:
          $ref: '#/components/schemas/Metrics'
        author:
          $ref: '#/components/schemas/Author'
        music:
          type: object
          properties:
            title:
              type: string
              nullable: true
            authorName:
              type: string
              nullable: true
          required:
            - title
            - authorName
      required:
        - videoId
        - description
        - url
        - createdAt
        - region
        - coverUrl
        - durationMs
        - isAd
        - hashtags
        - metrics
        - author
        - music
    Metrics:
      type: object
      properties:
        views:
          type: integer
          nullable: true
        likes:
          type: integer
          nullable: true
        comments:
          type: integer
          nullable: true
        shares:
          type: integer
          nullable: true
        saves:
          type: integer
          nullable: true
      required:
        - views
        - likes
        - comments
        - shares
        - saves
    Author:
      type: object
      properties:
        handle:
          type: string
        name:
          type: string
        avatarUrl:
          type: string
          nullable: true
          description: CDN URL — may be time-limited by the source platform
        isVerified:
          type: boolean
      required:
        - handle
        - name
        - avatarUrl
        - isVerified
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key passed as the X-API-Key request header. Recommended for
        server-to-server calls.
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key (or OAuth token) passed as a Bearer token in the Authorization
        header.

````