KonbiniAPI TikTok API

TikTok data endpoints

OpenAPI Specification

konbiniapi-tiktok-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Konbini Instagram TikTok API
  version: 1.0.0
  description: 'Social media API that normalizes Instagram and TikTok 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: TikTok
  description: TikTok data endpoints
paths:
  /v1/tiktok/users/{username}:
    get:
      operationId: tiktokGetUser
      tags:
      - TikTok
      summary: Get User Profile
      description: Returns profile information for a TikTok user including bio, follower counts, verification status, and profile picture. Look up any public TikTok account by username.
      parameters:
      - schema:
          type: string
          description: TikTok username (with or without @ symbol)
          example: khaby.lame
        required: true
        description: TikTok username (with or without @ symbol)
        name: username
        in: path
      responses:
        '200':
          description: Returns the user details
          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 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:
                        $ref: '#/components/schemas/TikTokImage'
                        description: User profile picture
                      image:
                        type: array
                        items:
                          $ref: '#/components/schemas/TikTokImage'
                        description: Profile pictures in multiple sizes
                    required:
                    - '@context'
                    - type
                    - id
                    - url
                    - entityId
                    - name
                    - preferredUsername
                    - isPrivate
                    - isVerified
                    - isLive
                    - followerCount
                    - followingCount
                    - likeCount
                    - mediaCount
                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
        '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
  /v1/tiktok/users/{username}/videos:
    get:
      operationId: tiktokGetUserVideos
      tags:
      - TikTok
      summary: Get User Videos
      description: Returns a paginated list of videos from a user's profile. Supports sorting by newest, popular, or oldest. Maximum 35 videos per page.
      parameters:
      - schema:
          type: string
          description: TikTok username (with or without @ symbol)
          example: khaby.lame
        required: true
        description: TikTok username (with or without @ symbol)
        name: username
        in: path
      - schema:
          type: integer
          minimum: 1
          maximum: 35
          default: 35
          description: 'Number of videos to fetch (maximum: 35)'
          example: 35
        required: false
        description: 'Number of videos to fetch (maximum: 35)'
        name: count
        in: query
      - schema:
          type: string
          default: '0'
          description: Pagination cursor
          example: '0'
        required: false
        description: Pagination cursor
        name: cursor
        in: query
      - schema:
          type: string
          enum:
          - newest
          - popular
          - oldest
          default: newest
          description: 'Sort order: newest (default), popular, or oldest'
          example: newest
        required: false
        description: 'Sort order: newest (default), popular, or oldest'
        name: order
        in: query
      responses:
        '200':
          description: Returns the user videos
          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/users/khaby.lame/videos
                      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/users/khaby.lame/videos?cursor=1772217402000&count=30
                      itemCount:
                        type: integer
                        description: Number of items returned in this page
                        example: 30
                      orderedItems:
                        type: array
                        items:
                          $ref: '#/components/schemas/TikTokVideo'
                        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
        '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
        

# --- truncated at 32 KB (328 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/konbiniapi/refs/heads/main/openapi/konbiniapi-tiktok-api-openapi.yml