{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Comments & Replies Scraper",
    "description": "Extract TikTok comments and replies from videos, photo posts and whole profiles. Get text, likes, reply counts, dates, mentions and commenter details (bio, verified badge) as structured JSON. Bulk URLs, live output, no account or cookies needed.",
    "version": "1.0",
    "x-build-id": "IDLmFScOrkC98btSy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/insights_data~tiktok-comments-replies-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-insights_data-tiktok-comments-replies-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/insights_data~tiktok-comments-replies-scraper/runs": {
      "post": {
        "operationId": "runs-sync-insights_data-tiktok-comments-replies-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/insights_data~tiktok-comments-replies-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-insights_data-tiktok-comments-replies-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": {
          "urls": {
            "title": "🔗 TikTok URLs",
            "type": "array",
            "description": "One URL per line, or use Bulk edit to paste a whole list. Accepted: video and photo URLs (https://www.tiktok.com/@user/video/123...), short share links (vm.tiktok.com / vt.tiktok.com), bare video IDs, and profile URLs or @usernames (comments are then taken from that profile's videos, see Profile options). Free plan users get up to 10 items per run; paid plans have no limit.",
            "items": {
              "type": "string"
            }
          },
          "commentsPerPost": {
            "title": "🔢 Maximum comments per post (replies included)",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of rows (top-level comments and replies together) taken from each post. Leave empty for no cap. To get N comments plus their replies, use the top-level limit below instead.",
            "default": 10
          },
          "topLevelCommentsPerPost": {
            "title": "🔢 Maximum top-level comments per post",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of top-level (non-reply) comments taken from each post. Replies come on top of this number."
          },
          "includeReplies": {
            "title": "✅ Include replies",
            "type": "boolean",
            "description": "Also collect the replies under each comment. Each reply is its own row with type \"reply\" and a link to its parent comment.",
            "default": true
          },
          "maxRepliesPerComment": {
            "title": "🔢 Maximum replies per comment",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of replies collected under each comment (0 = none). TikTok sometimes hides deleted or filtered replies, so a thread can return fewer replies than its counter shows.",
            "default": 2
          },
          "profiles": {
            "title": "👤 TikTok usernames",
            "type": "array",
            "description": "Alternatively, add one or more TikTok usernames (with or without @, or profile URLs) whose videos' comments you want to scrape. Enter them one by one or use Bulk edit. Important: don't forget to set Videos per profile below.",
            "items": {
              "type": "string"
            }
          },
          "resultsPerPage": {
            "title": "🔢 Videos per profile",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "How many videos to take from each username above (and from each profile URL in the TikTok URLs list).",
            "default": 1
          },
          "profileScrapeSections": {
            "title": "🎯 Profile sections",
            "minItems": 1,
            "type": "array",
            "description": "Which part of each profile to take videos from. Reposts are collected only when TikTok shows them to visitors; most profiles currently keep them hidden, and those are skipped with a note in the log.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "reposts"
              ],
              "enumTitles": [
                "Videos",
                "Reposts"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "profileSorting": {
            "title": "🔃 Profile video sorting",
            "enum": [
              "latest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "Latest = newest videos first, Popular = most viewed first, Oldest = oldest first. Date filters work with Latest and Oldest.",
            "default": "latest"
          },
          "oldestPostDateUnified": {
            "title": "📅 Videos published on or after",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$|^\\d{1,5}$",
            "type": "string",
            "description": "Optional. Pick a date, or a relative period such as 7 days, 2 weeks, 3 months or 1 year (1 day = today only, 2 days = yesterday and today)."
          },
          "newestPostDate": {
            "title": "📅 Videos published on or before",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
            "type": "string",
            "description": "Optional. Only videos uploaded on or before this date (YYYY-MM-DD)."
          },
          "excludePinnedPosts": {
            "title": "✅ Exclude pinned posts",
            "type": "boolean",
            "description": "Skip the videos a creator pinned to the top of their profile.",
            "default": false
          },
          "scrapeUserProfiles": {
            "title": "✅ Add commenter profile details",
            "type": "boolean",
            "description": "Fill each commenter's bio, verified badge and language. Adds a little time per unique commenter; turn off for the fastest runs.",
            "default": true
          },
          "customMapFunction": {
            "title": "🔧 Custom map function (Python)",
            "type": "string",
            "description": "Optional. A Python expression over `record`, e.g. {'id': record['cid'], 'likes': record['diggCount']}, or a full `def map_function(record): ...`. Return None to drop a row. Not meant for filtering."
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy configuration",
            "type": "object",
            "description": "Default: no proxy. If TikTok blocks the run, it switches to a datacenter proxy and then to a residential proxy automatically. Pick your own proxy here to start with it instead.",
            "default": {
              "useApifyProxy": 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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}