{
  "openapi": "3.0.1",
  "info": {
    "title": "Tiktok Comment Scraper",
    "description": "TikTok Comment Scraper extracts comments from TikTok videos, including text, author details, likes, reply counts, mentions, hashtags, and timestamps. Ideal for audience research, sentiment analysis, moderation, trend tracking, and AI-powered comment insights.",
    "version": "0.1",
    "x-build-id": "2uKREUNhBvrxqKgFg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/coregent~tiktok-comment-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-coregent-tiktok-comment-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/coregent~tiktok-comment-scraper/runs": {
      "post": {
        "operationId": "runs-sync-coregent-tiktok-comment-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/coregent~tiktok-comment-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-coregent-tiktok-comment-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": "Video URLs or IDs",
            "type": "array",
            "description": "List of TikTok video URLs — or bare numeric video IDs — to scrape comments from. Example URL: https://www.tiktok.com/@creator/video/7234567890123456789 · Example ID: 7234567890123456789",
            "items": {
              "type": "string"
            },
            "default": [
              "https://www.tiktok.com/@aaron.vankampen/video/7481695035033980190"
            ]
          },
          "profileUrls": {
            "title": "Creator Profiles (optional)",
            "type": "array",
            "description": "TikTok creator profiles to scrape comments from their recent videos. Accepts @handle, a full profile URL (https://www.tiktok.com/@handle), or a bare handle.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerProfile": {
            "title": "Max Videos Per Profile",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many of each creator's most recent videos to scrape comments from (only applies to Creator Profiles).",
            "default": 10
          },
          "maxComments": {
            "title": "Max Comments Per Video",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of comments to extract per video.",
            "default": 100
          },
          "includeReplies": {
            "title": "Include Replies",
            "type": "boolean",
            "description": "Include reply threads for each comment. Each reply becomes a separate dataset row with parentCommentId set.",
            "default": true
          },
          "maxRepliesPerComment": {
            "title": "Max Replies Per Comment",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of replies to fetch per comment (only applies when Include Replies is enabled).",
            "default": 50
          },
          "maxItems": {
            "title": "Max Total Results (all videos)",
            "minimum": 1,
            "type": "integer",
            "description": "Optional global cap on the total number of results (comments + replies) across ALL videos in this run. Leave empty for no global cap. Useful for controlling cost on large runs."
          },
          "scrapeAllComments": {
            "title": "Scrape All Comments",
            "type": "boolean",
            "description": "Ignore the per-video 'Max Comments' limit and fetch every available comment. The global 'Max Total Results' cap (if set) still applies. Large videos can be slow.",
            "default": false
          },
          "minLikes": {
            "title": "Minimum Likes",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep comments and replies with at least this many likes. Filtered-out rows are not charged."
          },
          "commentDateFrom": {
            "title": "Comments From Date",
            "type": "string",
            "description": "Only keep comments/replies created on or after this date (ISO date, e.g. 2025-01-01). Rows without a timestamp are dropped when a date filter is set."
          },
          "commentDateTo": {
            "title": "Comments To Date",
            "type": "string",
            "description": "Only keep comments/replies created on or before this date (ISO date, e.g. 2025-12-31)."
          },
          "excludePinned": {
            "title": "Exclude Pinned Comments",
            "type": "boolean",
            "description": "Skip creator-pinned comments (and their replies). Pinned comments are not charged when excluded.",
            "default": false
          },
          "sort": {
            "title": "Sort Order",
            "enum": [
              "top",
              "new"
            ],
            "type": "string",
            "description": "Sort comments by relevance (top) or chronologically (new).",
            "default": "top"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}