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

# Search content

> General search that returns mixed results including videos and user profiles. Supports sorting and publish-time filters.



## OpenAPI

````yaml /openapi.json get /v1/tiktok/search
openapi: 3.1.0
info:
  title: KonbiniAPI
  version: 1.0.0
  description: >-
    Social media API that normalizes Instagram, TikTok, X, and Reddit data into
    a consistent ActivityStreams 2.0 format.


    Every authenticated response includes `X-Credits-Remaining` and
    `X-Credits-Used` headers. Each successful request costs 1 credit. Requests
    that fail with 400, 5xx, or upstream errors are refunded (X-Credits-Used:
    0).
  contact:
    name: KonbiniAPI
    email: hello@konbiniapi.com
    url: https://konbiniapi.com
servers:
  - url: https://api.konbiniapi.com
    description: Production
security:
  - apiKey: []
tags:
  - name: Instagram
    description: Instagram data endpoints
  - name: TikTok
    description: TikTok data endpoints
  - name: X
    description: X data endpoints
  - name: Reddit
    description: Reddit data endpoints
paths:
  /v1/tiktok/search:
    get:
      tags:
        - TikTok
      summary: Search content
      description: >-
        General search that returns mixed results including videos and user
        profiles. Supports sorting and publish-time filters.
      operationId: tiktokSearchContent
      parameters:
        - schema:
            type: string
            minLength: 1
            description: Search query
            example: khaby.lame
          required: true
          description: Search query
          name: query
          in: query
        - schema:
            type: string
            default: '0'
            description: Pagination cursor
            example: '0'
          required: false
          description: Pagination cursor
          name: cursor
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
            description: 'Number of items to fetch (maximum: 100, actual results may vary)'
            example: 50
          required: false
          description: 'Number of items to fetch (maximum: 100, actual results may vary)'
          name: count
          in: query
        - schema:
            type: string
            enum:
              - relevance
              - most-liked
              - date-posted
            default: relevance
            description: 'Sort order: relevance (default), most-liked, or date-posted'
            example: relevance
          required: false
          description: 'Sort order: relevance (default), most-liked, or date-posted'
          name: order
          in: query
        - schema:
            type: string
            enum:
              - all-time
              - yesterday
              - this-week
              - this-month
              - last-3-months
              - last-6-months
            default: all-time
            description: >-
              Filter by publish time: all-time (default), yesterday, this-week,
              this-month, last-3-months, or last-6-months
            example: all-time
          required: false
          description: >-
            Filter by publish time: all-time (default), yesterday, this-week,
            this-month, last-3-months, or last-6-months
          name: published
          in: query
      responses:
        '200':
          description: Returns the search results
          headers:
            X-Credits-Remaining:
              schema:
                type: integer
              description: Credits remaining after this request
            X-Credits-Used:
              schema:
                type: integer
              description: Credits consumed (1 if charged, 0 if refunded on error)
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      '@context':
                        type: array
                        prefixItems:
                          - type: string
                            enum:
                              - https://www.w3.org/ns/activitystreams#
                          - type: string
                            enum:
                              - https://konbiniapi.com/ns/social#
                        description: ActivityStreams JSON-LD context
                        example:
                          - https://www.w3.org/ns/activitystreams#
                          - https://konbiniapi.com/ns/social#
                      type:
                        type: string
                        description: ActivityStreams collection type
                        example: OrderedCollectionPage
                      partOf:
                        type: string
                        format: uri
                        description: URL of the full collection
                        example: https://api.konbiniapi.com/v1/tiktok/search
                      totalItems:
                        type:
                          - integer
                          - 'null'
                        description: Total number of items, null if unknown
                        example: 1309
                      cursor:
                        type:
                          - string
                          - 'null'
                        description: Current page cursor, null on first page
                        example: '0'
                      nextCursor:
                        type:
                          - string
                          - 'null'
                        description: Cursor for the next page, null on last page
                        example: '1772217402000'
                      next:
                        type:
                          - string
                          - 'null'
                        format: uri
                        description: URL for the next page, null on last page
                        example: >-
                          https://api.konbiniapi.com/v1/tiktok/search?query=khaby&cursor=1772217402000&count=30
                      itemCount:
                        type: integer
                        description: Number of items returned in this page
                        example: 30
                      orderedItems:
                        type: array
                        items:
                          oneOf:
                            - allOf:
                                - $ref: '#/components/schemas/TikTokVideo'
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - Video
                              description: Video post
                            - allOf:
                                - $ref: '#/components/schemas/TikTokEmbeddedUser'
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - Person
                              description: Compact user profile for embedded contexts
                            - allOf:
                                - $ref: '#/components/schemas/TikTokEmbeddedUser'
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - Organization
                              description: Compact user profile for embedded contexts
                        description: Items in this page
                    required:
                      - '@context'
                      - type
                      - partOf
                      - totalItems
                      - cursor
                      - nextCursor
                      - next
                      - itemCount
                      - orderedItems
                required:
                  - data
        '400':
          description: Bad Request — Invalid parameters
          headers:
            X-Credits-Remaining:
              schema:
                type: integer
              description: Credits remaining after this request
            X-Credits-Used:
              schema:
                type: integer
              description: Credits consumed (1 if charged, 0 if refunded on error)
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - validation_error
                          description: Machine-readable error code
                        message:
                          type: string
                          example: Validation error
                          description: Human-readable error message
                      required:
                        - code
                        - message
                    description: List of errors
                  data:
                    type: 'null'
                    description: Always null for error responses
                required:
                  - errors
                  - data
        '401':
          description: Unauthorized — Missing or invalid API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - missing_api_key
                            - invalid_api_key
                          description: Machine-readable error code
                        message:
                          type: string
                          example: Invalid API key
                          description: Human-readable error message
                      required:
                        - code
                        - message
                    description: List of errors
                  data:
                    type: 'null'
                    description: Always null for error responses
                required:
                  - errors
                  - data
        '402':
          description: Payment Required — Credits exhausted
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - credits_exhausted
                          description: Machine-readable error code
                        message:
                          type: string
                          example: >-
                            Credits exhausted. Upgrade your plan at
                            konbiniapi.com
                          description: Human-readable error message
                      required:
                        - code
                        - message
                    description: List of errors
                  data:
                    type: 'null'
                    description: Always null for error responses
                required:
                  - errors
                  - data
        '403':
          description: Forbidden — API key disabled or expired
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - api_key_disabled
                            - api_key_expired
                          description: Machine-readable error code
                        message:
                          type: string
                          example: API key is disabled
                          description: Human-readable error message
                      required:
                        - code
                        - message
                    description: List of errors
                  data:
                    type: 'null'
                    description: Always null for error responses
                required:
                  - errors
                  - data
        '404':
          description: Not Found
          headers:
            X-Credits-Remaining:
              schema:
                type: integer
              description: Credits remaining after this request
            X-Credits-Used:
              schema:
                type: integer
              description: Credits consumed (1 if charged, 0 if refunded on error)
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - not_found
                            - route_not_found
                          description: Machine-readable error code
                        message:
                          type: string
                          example: Not found
                          description: Human-readable error message
                      required:
                        - code
                        - message
                    description: List of errors
                  data:
                    type: 'null'
                    description: Always null for error responses
                required:
                  - errors
                  - data
        '413':
          description: Content Too Large — Request body exceeds 1 MB
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - validation_error
                          description: Machine-readable error code
                        message:
                          type: string
                          example: Request body too large
                          description: Human-readable error message
                      required:
                        - code
                        - message
                    description: List of errors
                  data:
                    type: 'null'
                    description: Always null for error responses
                required:
                  - errors
                  - data
        '500':
          description: Internal Server Error
          headers:
            X-Credits-Remaining:
              schema:
                type: integer
              description: Credits remaining after this request
            X-Credits-Used:
              schema:
                type: integer
              description: Credits consumed (1 if charged, 0 if refunded on error)
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - internal_error
                          description: Machine-readable error code
                        message:
                          type: string
                          example: Internal error
                          description: Human-readable error message
                      required:
                        - code
                        - message
                    description: List of errors
                  data:
                    type: 'null'
                    description: Always null for error responses
                required:
                  - errors
                  - data
        '502':
          description: Bad Gateway — Upstream platform error
          headers:
            X-Credits-Remaining:
              schema:
                type: integer
              description: Credits remaining after this request
            X-Credits-Used:
              schema:
                type: integer
              description: Credits consumed (1 if charged, 0 if refunded on error)
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - platform_error
                          description: Machine-readable error code
                        message:
                          type: string
                          example: Platform error
                          description: Human-readable error message
                      required:
                        - code
                        - message
                    description: List of errors
                  data:
                    type: 'null'
                    description: Always null for error responses
                required:
                  - errors
                  - data
        '503':
          description: Service Unavailable
          headers:
            X-Credits-Remaining:
              schema:
                type: integer
              description: Credits remaining after this request
            X-Credits-Used:
              schema:
                type: integer
              description: Credits consumed (1 if charged, 0 if refunded on error)
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - service_unavailable
                          description: Machine-readable error code
                        message:
                          type: string
                          example: Service unavailable
                          description: Human-readable error message
                      required:
                        - code
                        - message
                    description: List of errors
                  data:
                    type: 'null'
                    description: Always null for error responses
                required:
                  - errors
                  - data
        '504':
          description: Gateway Timeout — Upstream platform timed out
          headers:
            X-Credits-Remaining:
              schema:
                type: integer
              description: Credits remaining after this request
            X-Credits-Used:
              schema:
                type: integer
              description: Credits consumed (1 if charged, 0 if refunded on error)
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - platform_error
                          description: Machine-readable error code
                        message:
                          type: string
                          example: Platform error
                          description: Human-readable error message
                      required:
                        - code
                        - message
                    description: List of errors
                  data:
                    type: 'null'
                    description: Always null for error responses
                required:
                  - errors
                  - data
components:
  schemas:
    TikTokVideo:
      type: object
      properties:
        type:
          type: string
          description: ActivityStreams object type
          example: Video
        id:
          type: string
          format: uri
          description: Video permalink
          example: https://www.tiktok.com/@khaby.lame/video/7611615657754381599
        url:
          type: string
          format: uri
          description: Video URL
          example: https://www.tiktok.com/@khaby.lame/video/7611615657754381599
        entityId:
          type: string
          description: TikTok internal video ID
          example: '7611615657754381599'
        content:
          type: string
          description: Caption or description
          example: 'When you realize there is a simpler way #learnfromkhaby'
        published:
          type: string
          format: date-time
          description: Publication date in ISO 8601 format
          example: '2026-02-27T18:36:42.000Z'
        duration:
          type: number
          description: Duration in seconds
          example: 23
        viewCount:
          type: integer
          description: Number of views
          example: 42600000
        likeCount:
          type: integer
          description: Number of likes
          example: 2800000
        commentCount:
          type: integer
          description: Number of comments
          example: 29200
        repostCount:
          type: integer
          description: Number of reposts
          example: 0
        shareCount:
          type: integer
          description: Number of shares
          example: 157700
        saveCount:
          type: integer
          description: Number of saves
          example: 153238
        language:
          type: string
          description: Content language (BCP47 code)
          example: en
        isSponsored:
          type: boolean
          description: Whether the video is a promoted ad
          example: false
        location:
          type: object
          properties:
            type:
              type: string
              description: ActivityStreams object type
              example: Place
            id:
              type: string
              description: Location ID
              example: '213385402'
            name:
              type: string
              description: Location name or country code
              example: Los Angeles, California
            url:
              type: string
              format: uri
              description: Location page URL
            latitude:
              type: number
              description: Geographic latitude
              example: 34.0522
            longitude:
              type: number
              description: Geographic longitude
              example: -118.2437
          required:
            - type
            - name
          description: Location where the video was created
          example:
            type: Place
            name: US
        tag:
          type: array
          items:
            $ref: '#/components/schemas/TikTokTag'
          description: Hashtags and mentions
        attributedTo:
          $ref: '#/components/schemas/TikTokEmbeddedUser'
          description: Video creator
        attachment:
          type: array
          items:
            $ref: '#/components/schemas/TikTokVideoAttachment'
          description: Video files in multiple qualities
        image:
          type: array
          items:
            $ref: '#/components/schemas/TikTokImage'
          description: Video thumbnails
        preview:
          allOf:
            - $ref: '#/components/schemas/TikTokImage'
            - description: Animated preview thumbnail
        audio:
          $ref: '#/components/schemas/TikTokAudio'
          description: Video audio track
      required:
        - type
        - id
        - url
        - entityId
        - published
        - viewCount
        - likeCount
        - commentCount
        - repostCount
        - shareCount
        - saveCount
        - attributedTo
      description: Video post
    TikTokEmbeddedUser:
      type: object
      properties:
        type:
          type: string
          description: ActivityStreams object type
          example: Person
        id:
          type: string
          format: uri
          description: Profile URL
          example: https://www.tiktok.com/@khaby.lame
        url:
          type: string
          format: uri
          description: Profile URL
          example: https://www.tiktok.com/@khaby.lame
        entityId:
          type: string
          description: TikTok secUid
          example: >-
            MS4wLjABAAAAwAg0rSzO65WQfz4RzQgGv2Xdv108BgPXhRrrmNVIHQZ9PO8-flwwRtEppYTS0OjA
        name:
          type: string
          description: Display name
          example: Khabane Lame
        preferredUsername:
          type: string
          description: Username or handle
          example: khaby.lame
        summary:
          type: string
          description: Bio text
          example: Just a guy who reacts
        attachment:
          type: array
          items:
            $ref: '#/components/schemas/TikTokLink'
          description: External links in bio
        published:
          type: string
          format: date-time
          description: Account creation date in ISO 8601 format
          example: '2020-03-15T00:00:00.000Z'
        isPrivate:
          type: boolean
          description: Whether account is private
          example: false
        isVerified:
          type: boolean
          description: Whether account is verified
          example: true
        isLive:
          type: boolean
          description: Whether user is currently live streaming
          example: false
        hasLikes:
          type: boolean
          description: Whether user's liked videos are public
          example: true
        hasPlaylists:
          type: boolean
          description: Whether user has playlists
          example: true
        followerCount:
          type: integer
          description: Number of followers
          example: 160300000
        followingCount:
          type: integer
          description: Number of accounts followed
          example: 85
        language:
          type: string
          description: User language preference (BCP47 code)
          example: en
        likeCount:
          type: integer
          description: Total likes received across all content
          example: 2600000000
        likedCount:
          type: integer
          description: Number of videos the user has liked
          example: 5300
        mediaCount:
          type: integer
          description: Number of posts
          example: 1309
        icon:
          allOf:
            - $ref: '#/components/schemas/TikTokImage'
            - description: Author avatar
        image:
          type: array
          items:
            $ref: '#/components/schemas/TikTokImage'
          description: Profile pictures in multiple sizes
      required:
        - type
        - id
        - url
        - isPrivate
        - isVerified
      description: Compact user profile for embedded contexts
    TikTokTag:
      type: object
      properties:
        type:
          type: string
          description: ActivityStreams object type
          example: Tag
        name:
          type: string
          description: Tag name
          example: learnfromkhaby
        href:
          type: string
          format: uri
          description: Tag URL
          example: https://www.tiktok.com/tag/learnfromkhaby
        id:
          type: string
          format: uri
          description: Tag permalink
          example: https://www.tiktok.com/tag/learnfromkhaby
        entityId:
          type: string
          description: TikTok internal tag ID
          example: '1697657584273413'
      required:
        - type
        - name
      description: Hashtag or mention
    TikTokVideoAttachment:
      type: object
      properties:
        type:
          type: string
          description: ActivityStreams object type
          example: Video
        name:
          type: string
          description: Quality label (e.g. h264_540p_829898-0)
          example: normal_540_0
        url:
          type: array
          items:
            type: string
            format: uri
          description: Media download URLs
          example:
            - >-
              https://v19-webapp.tiktok.com/video/tos/us/tos-useast5-ve-0068c004/video.mp4
        headers:
          $ref: '#/components/schemas/TikTokVideoAttachmentHeaders'
          description: Authentication headers for video download
        mediaType:
          type: string
          description: MIME type
          example: video/mp4
        codec:
          type: string
          description: Video codec (e.g. h264, h265)
          example: h264
        width:
          type: integer
          description: Width in pixels
          example: 576
        height:
          type: integer
          description: Height in pixels
          example: 1024
        bitrate:
          type: integer
          description: Bitrate in bits per second
          example: 1101943
      required:
        - type
        - name
        - url
        - mediaType
        - codec
        - width
        - height
        - bitrate
      description: Video media file with download details
    TikTokImage:
      type: object
      properties:
        type:
          type: string
          description: ActivityStreams object type
          example: Image
        url:
          type: string
          format: uri
          description: Image URL
          example: https://p16-sign.tiktokcdn-us.com/tos-maliva-avt-0068/avatar.jpeg
        width:
          type: integer
          description: Width in pixels
          example: 576
        height:
          type: integer
          description: Height in pixels
          example: 1024
      required:
        - type
        - url
      description: Image resource with optional dimensions
    TikTokAudio:
      type: object
      properties:
        type:
          type: string
          description: ActivityStreams object type
          example: Audio
        id:
          type: string
          format: uri
          description: Audio permalink
          example: https://www.tiktok.com/music/original-sound-7611615657754381599
        url:
          type: string
          format: uri
          description: Audio playback URL
          example: https://sf16-ies-music.tiktokcdn.com/obj/tos-alisg-v/123456
        name:
          type: string
          description: Track name
          example: original sound
        duration:
          type: number
          description: Duration in seconds
          example: 23
        mediaType:
          type: string
          description: MIME type
          example: audio/mpeg
        attributedTo:
          anyOf:
            - $ref: '#/components/schemas/TikTokEmbeddedUser'
            - type: array
              items:
                $ref: '#/components/schemas/TikTokEmbeddedUser'
          description: Audio creator or artist
        icon:
          allOf:
            - $ref: '#/components/schemas/TikTokImage'
            - description: Thumbnail image
        image:
          type: array
          items:
            $ref: '#/components/schemas/TikTokImage'
          description: Cover images in multiple sizes
        entityId:
          type: string
          description: Audio ID
          example: '7493556331997071377'
        album:
          type: string
          description: Album name
          example: Greatest Hits
        isOriginal:
          type: boolean
          description: Whether audio is user-created vs a licensed track
          example: false
        isCopyrighted:
          type: boolean
          description: Whether audio has copyright restrictions
          example: false
        videoCount:
          type: integer
          description: Number of videos using this audio
          example: 500000
      required:
        - type
        - name
        - duration
      description: Audio or music track
    TikTokLink:
      type: object
      properties:
        type:
          type: string
          description: ActivityStreams object type
          example: Link
        href:
          type: string
          format: uri
          description: Link URL
          example: https://linktr.ee/khaby.lame
        rel:
          type: string
          description: Link relation hint
          example: preferred
      required:
        - type
        - href
      description: External link
    TikTokVideoAttachmentHeaders:
      type: object
      properties:
        Cookie:
          type: string
          description: Required cookie header for video download
          example: tt_chain_token=sTA6PK6OnvhW7YemGVwMig==
        Referer:
          type: string
          description: Required referer header for video download
          example: https://www.tiktok.com/
      required:
        - Cookie
        - Referer
      description: HTTP headers required for authenticated media download
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: |-
        Send your API key in the Authorization header as a Bearer token.
        Example: `Authorization: Bearer <your-api-key>`

````