{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Comments Scraper: Top Comments By Language",
    "description": "TikTok Comments Scraper — Scrape TikTok video comments and filter top comments by language. Extract comment text, authors, likes, replies, timestamps, and language data to analyze audience sentiment, engagement, trends, and multilingual communities.",
    "version": "0.1",
    "x-build-id": "cuLyHIZvcbZODg4BB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapio~tiktok-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapio-tiktok-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/scrapio~tiktok-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapio-tiktok-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/scrapio~tiktok-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapio-tiktok-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": {
          "videoUrls": {
            "title": "🎬 TikTok video URLs",
            "type": "array",
            "description": "Video URLs to read comments from. Full URLs, vm./vt. short links and bare video IDs all work. Example: https://www.tiktok.com/@mrbeast/video/7578547467189374239",
            "items": {
              "type": "string"
            }
          },
          "maxCommentsPerVideo": {
            "title": "💬 Comments to keep per video",
            "minimum": 1,
            "type": "integer",
            "description": "How many comment rows to keep from each video, AFTER the language filter is applied. TikTok serves roughly 47 comments per page, so large numbers mean more pages. Default is 10.",
            "default": 10
          },
          "maxRepliesPerComment": {
            "title": "↩️ Replies to fetch per comment",
            "minimum": 0,
            "type": "integer",
            "description": "Replies are attached to each comment in the `replies` array. Unlike the original actor this is a real limit, not a 20-reply ceiling — reply threads are paginated until your number is reached. Set 0 to skip replies. Default is 3.",
            "default": 3
          },
          "deepReplyPaging": {
            "title": "🔁 Page reply threads past the first page",
            "type": "boolean",
            "description": "On: a reply thread is paged (20 per page) until 'Replies to fetch per comment' is met. Off: only the first page of replies is read, capping every thread at 20. Default is on.",
            "default": true
          },
          "languages": {
            "title": "🗣️ Languages to keep",
            "uniqueItems": true,
            "type": "array",
            "description": "Leave empty to keep every language. 'Undetermined (un)' is TikTok's own bucket for comments it could not classify (emoji-only, very short text) and is roughly 6% of a typical comment section — it is a real value, not an error.",
            "items": {
              "type": "string",
              "enum": [
                "en",
                "es",
                "pt",
                "fr",
                "de",
                "it",
                "nl",
                "pl",
                "ro",
                "sv",
                "uk",
                "ru",
                "tr",
                "ar",
                "fa",
                "ur",
                "hi",
                "bn",
                "ta",
                "te",
                "mr",
                "id",
                "ms",
                "fil",
                "th",
                "vi",
                "ja",
                "ko",
                "zh",
                "mk",
                "mn",
                "sw",
                "un"
              ],
              "enumTitles": [
                "English (en)",
                "Spanish (es)",
                "Portuguese (pt)",
                "French (fr)",
                "German (de)",
                "Italian (it)",
                "Dutch (nl)",
                "Polish (pl)",
                "Romanian (ro)",
                "Swedish (sv)",
                "Ukrainian (uk)",
                "Russian (ru)",
                "Turkish (tr)",
                "Arabic (ar)",
                "Persian (fa)",
                "Urdu (ur)",
                "Hindi (hi)",
                "Bengali (bn)",
                "Tamil (ta)",
                "Telugu (te)",
                "Marathi (mr)",
                "Indonesian (id)",
                "Malay (ms)",
                "Filipino (fil)",
                "Thai (th)",
                "Vietnamese (vi)",
                "Japanese (ja)",
                "Korean (ko)",
                "Chinese (zh)",
                "Macedonian (mk)",
                "Mongolian (mn)",
                "Swahili (sw)",
                "Undetermined (un)"
              ]
            }
          },
          "extraLanguageCodes": {
            "title": "➕ Extra language codes",
            "type": "array",
            "description": "Any language code not in the list above, e.g. `ceb`, `ht`, `zh-hant`. Added to your selection. Codes are matched exactly against TikTok's own value, lower-cased.",
            "items": {
              "type": "string"
            }
          },
          "languageFilterMode": {
            "title": "🔍 Filter mode",
            "enum": [
              "include",
              "exclude"
            ],
            "type": "string",
            "description": "Include = keep only the selected languages. Exclude = keep everything except them (useful for stripping English out of a global comment section). Ignored when no language is selected.",
            "default": "include"
          },
          "maxCommentsScanned": {
            "title": "🔭 Comment scan budget per video",
            "minimum": 0,
            "type": "integer",
            "description": "How many comments may be read while looking for matches. Only matters when a language filter is on: a rare language needs a wide scan. 0 = auto (20× your keep limit, minimum 500). Default is 0.",
            "default": 0
          },
          "languageBreakdownOutput": {
            "title": "📤 Where to write the breakdown",
            "enum": [
              "both",
              "main",
              "separate",
              "off"
            ],
            "type": "string",
            "description": "Breakdown rows carry `type: language_summary` so they are easy to tell apart from comment rows. Default writes them to both the main dataset and a separate `language-breakdown` dataset.",
            "default": "both"
          },
          "languageBreakdownScope": {
            "title": "🧮 Breakdown grouping",
            "enum": [
              "perVideo",
              "perRun",
              "both"
            ],
            "type": "string",
            "description": "Per video = one set of language rows for each video. Whole run = one set covering every video together. Default is per video.",
            "default": "perVideo"
          },
          "creatorProfiles": {
            "title": "👤 TikTok usernames",
            "type": "array",
            "description": "Usernames without the @, e.g. mrbeast. Leave empty when you are supplying video URLs.",
            "items": {
              "type": "string"
            }
          },
          "videosPerCreator": {
            "title": "📺 Videos per creator",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "How many videos to pull comments from for each username. Default is 10.",
            "default": 10
          },
          "creatorSections": {
            "title": "📂 Profile tabs to read",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "Videos = the creator's own posts. Reposts = videos they reposted, when that tab is public.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "reposts"
              ],
              "enumTitles": [
                "Videos",
                "Reposts"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "creatorVideoOrder": {
            "title": "🔃 Video order",
            "enum": [
              "latest",
              "oldest",
              "popular"
            ],
            "type": "string",
            "description": "Newest first, oldest first, or most-liked first. Date filters apply to Newest and Oldest only. Default is newest first.",
            "default": "latest"
          },
          "videosPublishedAfter": {
            "title": "📅 Videos published after",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Optional. Absolute date (2026-01-31) or relative (3 months, 2 weeks)."
          },
          "videosPublishedBefore": {
            "title": "📅 Videos published before",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Optional. Absolute date (2026-06-30) or relative (7 days, 1 month)."
          },
          "skipPinnedVideos": {
            "title": "📌 Skip pinned videos",
            "type": "boolean",
            "description": "Pinned videos sit at the top of a profile and are often old. Tick to leave them out.",
            "default": false
          },
          "aiEnhancement": {
            "title": "🤖 Translate and analyse comments with AI",
            "type": "boolean",
            "description": "Adds `aiTextEnglish`, `aiSentiment`, `aiTopic` and `aiStatus` to each comment row. Requires an API key from one of the providers below. Default is off.",
            "default": false
          },
          "aiModel": {
            "title": "🧠 AI model / provider",
            "enum": [
              "claude-haiku-4-5",
              "claude-sonnet-5",
              "claude-opus-4-8",
              "gpt-4o-mini",
              "gpt-4o",
              "gpt-4.1-mini",
              "o3-mini",
              "gemini-2.0-flash-lite",
              "gemini-2.0-flash",
              "gemini-2.5-flash",
              "grok-3-mini",
              "deepseek-chat",
              "sonar",
              "mistral-small-latest"
            ],
            "type": "string",
            "description": "Provider is auto-detected from the name: claude-*=Anthropic, gpt-*/o1/o3=OpenAI, gemini-*=Google, grok-*=xAI, deepseek-*=DeepSeek, sonar*=Perplexity, mistral-*=Mistral. The cheap models are plenty for translation and sentiment.",
            "default": "claude-haiku-4-5"
          },
          "aiApiKey": {
            "title": "🔑 AI provider API key",
            "type": "string",
            "description": "Only needed when AI enrichment is on. Falls back to the matching environment variable if left empty: ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_API_KEY, XAI_API_KEY, DEEPSEEK_API_KEY, PERPLEXITY_API_KEY, MISTRAL_API_KEY."
          },
          "postURLs": {
            "title": "🔗 postURLs (same as TikTok video URLs)",
            "type": "array",
            "description": "Legacy alias for 'TikTok video URLs'.",
            "items": {
              "type": "string"
            }
          },
          "commentsPerPost": {
            "title": "💬 commentsPerPost (same as Comments to keep per video)",
            "minimum": 1,
            "type": "integer",
            "description": "Legacy alias for 'Comments to keep per video'."
          },
          "profiles": {
            "title": "👤 profiles (same as TikTok usernames)",
            "type": "array",
            "description": "Legacy alias for 'TikTok usernames'.",
            "items": {
              "type": "string"
            }
          },
          "resultsPerPage": {
            "title": "📺 resultsPerPage (same as Videos per creator)",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Legacy alias for 'Videos per creator'."
          },
          "profileScrapeSections": {
            "title": "📂 profileScrapeSections (same as Profile tabs to read)",
            "uniqueItems": true,
            "type": "array",
            "description": "Legacy alias for 'Profile tabs to read'.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "reposts"
              ],
              "enumTitles": [
                "Videos",
                "Reposts"
              ]
            }
          },
          "profileSorting": {
            "title": "🔃 profileSorting (same as Video order)",
            "enum": [
              "latest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "Legacy alias for 'Video order'."
          },
          "oldestPostDateUnified": {
            "title": "📅 oldestPostDateUnified (same as Videos published after)",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Legacy alias for 'Videos published after'."
          },
          "newestPostDate": {
            "title": "📅 newestPostDate (same as Videos published before)",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Legacy alias for 'Videos published before'."
          },
          "excludePinnedPosts": {
            "title": "📌 excludePinnedPosts (same as Skip pinned videos)",
            "type": "boolean",
            "description": "Legacy alias for 'Skip pinned videos'."
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy configuration",
            "type": "object",
            "description": "Choose which proxies to use."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}