{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok LIVE Comment Scraper",
    "description": "Capture the live chat of a TikTok LIVE room while it is happening. One flat row per comment, with commenter identity where public, plus optional gift and join events. No login, no cookies, no WebSocket client to operate.",
    "version": "1.0",
    "x-build-id": "Uba5S9OW6AeMf2rJ0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/coregent~tiktok-live-comment-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-coregent-tiktok-live-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-live-comment-scraper/runs": {
      "post": {
        "operationId": "runs-sync-coregent-tiktok-live-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-live-comment-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-coregent-tiktok-live-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": {
          "liveRooms": {
            "title": "Live rooms",
            "minItems": 0,
            "maxItems": 100,
            "type": "array",
            "description": "Rooms to listen to. Accepts any mix of: a live URL (https://www.tiktok.com/@user/live), a short link (https://vt.tiktok.com/XXXX/), an @handle, a bare handle, or a numeric room ID. Output from the TikTok LIVE Scraper can be pasted in unchanged.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "captureMinutes": {
            "title": "Capture minutes (per room)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "How long to listen to each room. THIS IS THE COST DRIVER — you are billed per minute of capture, per room, so a 10-minute capture of 3 rooms costs 30 minutes. A quiet room costs the same as a busy one, because the cost is the time spent attached, not the number of comments. Capture stops early if the room ends or a cap is reached.",
            "default": 5
          },
          "maxCommentsPerRoom": {
            "title": "Max comments per room",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard ceiling on rows captured from any one room. Reaching it stops that room's capture early — which also stops its billing, so a busy room can cost less than captureMinutes implies.",
            "default": 1000
          },
          "maxTotalComments": {
            "title": "Max total comments (whole run)",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Absolute ceiling across every room in the run. This is the hard cost cap: reaching it ends the run. Set deliberately — it is the only limit that bounds a multi-room run as a whole.",
            "default": 5000
          },
          "includeGifts": {
            "title": "Include gift events",
            "type": "boolean",
            "description": "Also capture gifts sent during the capture window, as rows with eventType = gift. Free — gifts arrive on the same connection already held for comments, so this costs no extra time or upstream calls.",
            "default": false
          },
          "includeJoins": {
            "title": "Include join events",
            "type": "boolean",
            "description": "Also capture viewers joining the room, as rows with eventType = join. High volume and low information value in a busy room — these rows count toward your comment caps, so they can crowd out actual comments.",
            "default": false
          },
          "includeCommenterFields": {
            "title": "Include commenter identity",
            "type": "boolean",
            "description": "Include the commenter block: ID, username, display name, avatar, verified flag and follower count. Turn off for a narrower, more privacy-conservative dataset. Costs nothing either way — the fields arrive with the message.",
            "default": true
          },
          "deduplicateComments": {
            "title": "Deduplicate comments",
            "type": "boolean",
            "description": "OFF by default, so you get the raw stream exactly as it arrived. Turn it ON to drop repeat deliveries of the same comment ID. This matches on TikTok's per-message ID, never on text — two people posting the same words, or one person posting twice, are always separate rows either way. What it removes is the same physical message arriving twice, which happens because the Actor replays the chat backlog on connect and again after any reconnect (typically 20-30% of messages). Note that with this OFF, those repeats count toward your comment caps. Billing is unaffected either way — you are charged per minute, not per row.",
            "default": false
          },
          "includeSummary": {
            "title": "Write run summary",
            "type": "boolean",
            "description": "Write a run summary to the key-value store under SUMMARY, with per-room counts, comments per minute, unique commenters and top commenters. Never written to the dataset, so it cannot break CSV exports. Not charged.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Datacenter proxy, no proxy, or your own Custom proxy URLs. Apify RESIDENTIAL is rejected at startup — see the README's Proxy policy for why, and for how to use your own residential provider instead.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}