{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Comments Scraper - Replies & Authors",
    "description": "Scrape public TikTok video comments with replies, authors, likes, timestamps, pinned status, language, and source video URL. Provider-backed, no login or cookies required. MCP-ready and priced at $0.001 per top-level comment.",
    "version": "1.2",
    "x-build-id": "nhYH6fH8QyTfnt7hr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~tiktok-video-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-tiktok-video-comments-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/khadinakbar~tiktok-video-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-tiktok-video-comments-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/khadinakbar~tiktok-video-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-tiktok-video-comments-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "postURLs": {
            "title": "TikTok video URLs",
            "type": "array",
            "description": "Use this when you have public TikTok video links and need comment text, authors, likes, timestamps, and replies. Accepts full video URLs such as https://www.tiktok.com/@stoolpresidente/video/7623818255903329566. Add one or many URLs. Not for profile, hashtag, or shop review scraping.",
            "items": {
              "type": "string"
            }
          },
          "maxCommentsPerPost": {
            "title": "Max comments per video",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum top-level comments to save and charge for per video. Defaults to 100, ranges 0-100000. Set 0 to continue until TikTok/provider pagination ends or maxPagesPerPost is reached. Replies are nested under each charged top-level comment.",
            "default": 100
          },
          "maxTotalComments": {
            "title": "Max total comments",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Hard run-wide cap across all input videos. Defaults to 10000, ranges 1-500000. Use this to control total spend when you pass many URLs or set maxCommentsPerPost to 0.",
            "default": 10000
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Fetch nested replies under each top-level comment. Defaults to true so sentiment and conversation context stay attached to the parent comment. Disable for faster, cheaper provider usage when you only need top-level comments.",
            "default": true
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum nested replies to attach to each top-level comment. Defaults to 20, ranges 0-10000. Set 0 to collect all available replies up to maxReplyPagesPerComment. Replies are not billed as separate top-level comments.",
            "default": 20
          },
          "maxPagesPerPost": {
            "title": "Max comment pages per video",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Safety cap for top-level comment pagination per video. Defaults to 25, ranges 1-500. Raise only when you expect large comment sections and have set a spend cap with maxTotalComments.",
            "default": 25
          },
          "maxReplyPagesPerComment": {
            "title": "Max reply pages per comment",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Safety cap for reply pagination under one comment. Defaults to 10, ranges 1-100. This prevents a single viral thread from consuming the whole run when maxRepliesPerComment is 0.",
            "default": 10
          },
          "providerOrder": {
            "title": "Data provider",
            "enum": [
              "scrapecreators-first",
              "sociavault-first",
              "scrapecreators-only",
              "sociavault-only"
            ],
            "type": "string",
            "description": "Choose the managed public-data provider order. Defaults to ScrapeCreators first, then SociaVault fallback. Use provider-only options for diagnostics. This is not a TikTok login, cookie, or proxy setting.",
            "default": "scrapecreators-first"
          },
          "trim": {
            "title": "Trim provider response",
            "type": "boolean",
            "description": "Ask providers for a smaller response where supported. Defaults to false because full responses include stable comment IDs needed for reply threads. Set true only for top-level-only runs where you want smaller provider payloads.",
            "default": false
          },
          "includeRawData": {
            "title": "Include raw provider data",
            "type": "boolean",
            "description": "Attach the raw provider comment and reply payloads to output rows for debugging. Defaults to false because raw TikTok payloads are large and harder for AI agents to read.",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}