{
  "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": "AtMYWXfZw5aVYC8sv"
  },
  "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": "🎬 Videos and profiles",
            "type": "array",
            "description": "TikTok video or photo links, short links (vm.tiktok.com), video IDs, profile links or @usernames. One per line. A profile is expanded into its latest videos (see \"Profile videos\"). Each entry is collected on its own.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "💬 Max comments per video",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "How many rows to collect from each video, replies included. Use 0 for every comment the video gives. Profiles use this limit for each of their videos.",
            "default": 20
          },
          "maxRepliesPerComment": {
            "title": "↩️ Max replies per comment",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "How many replies to collect under each comment. Use 0 to collect comments only. TikTok does not always show every reply.",
            "default": 2
          },
          "scrapeUserProfiles": {
            "title": "🪪 Commenter details",
            "type": "boolean",
            "description": "Add each commenter's bio, verified badge, language and region. This looks up one extra page per commenter, so runs are slower and may use more proxy traffic. Off by default.",
            "default": false
          },
          "resultsPerPage": {
            "title": "🎞️ Videos per profile",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "How many videos to take from each profile you added. Does not apply to video links.",
            "default": 3
          },
          "profileScrapeSections": {
            "title": "📂 Which videos",
            "type": "array",
            "description": "Take the profile's own videos, the videos it reposted, or both.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "reposts"
              ],
              "enumTitles": [
                "Videos",
                "Reposts"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "profileSorting": {
            "title": "↕️ Profile video order",
            "enum": [
              "latest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "Which videos of the profile come first: newest, most popular or oldest.",
            "default": "latest"
          },
          "oldestPostDateUnified": {
            "title": "🗓️ Videos posted 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+d$",
            "type": "string",
            "description": "Skip profile videos older than this. Pick a date, or use a relative value such as 3 days, 1 week, 2 months or 1 year. Leave empty for no limit. Works with latest or oldest order."
          },
          "newestPostDate": {
            "title": "📆 Videos posted before",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$|^\\d+d$",
            "type": "string",
            "description": "Skip profile videos newer than this. Pick a date, or use a relative value such as 3 days or 2 weeks. Leave empty for no limit. Works with latest or oldest order."
          },
          "excludePinnedPosts": {
            "title": "📌 Skip pinned videos",
            "type": "boolean",
            "description": "Leave out the videos a profile has pinned to the top.",
            "default": false
          },
          "topLevelCommentsPerPost": {
            "title": "🔝 Max top-level comments per video",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Stop after this many top-level comments from each video; their replies come on top. Use 0 for no extra limit. \"Max comments per video\" counts replies too, so use this one to get N comments plus their replies.",
            "default": 0
          },
          "skipKnownCommentsFrom": {
            "title": "♻️ Skip comments from an earlier run",
            "type": "string",
            "description": "Pick the dataset of an earlier run. Comments already in it are skipped, so you only collect and pay for new comments."
          },
          "customMapFunction": {
            "title": "🧪 Custom map function (Python)",
            "type": "string",
            "description": "Optional. A Python expression over `record`, for example {'id': record['cid'], 'likes': record['diggCount']}, or a full `def map_function(record): ...`. Return None to drop a row. Rows that are dropped still count toward your limits."
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy",
            "type": "object",
            "description": "The run starts without a proxy and switches to a proxy by itself when TikTok limits requests. Choose a proxy here to start with it."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}