{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Live Scraper",
    "description": "TikTok LIVE scraper — is-live check by username, full live-room metadata + viewer count + stream URLs, real-time chat & gifts feed, and currently-live creator discovery. Auto-detects mode from input. No cookies, no login. MCP-ready.",
    "version": "0.1",
    "x-build-id": "jdn1whZyHUgoZrT1Q"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~tiktok-live-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-tiktok-live-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/khadinakbar~tiktok-live-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-tiktok-live-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/khadinakbar~tiktok-live-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-tiktok-live-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": {
          "usernames": {
            "title": "TikTok usernames (live-status mode)",
            "type": "array",
            "description": "List of TikTok @handles to check live status for (e.g. ['stoolpresidente', 'khaby.lame']). Bare handles or full profile URLs both accepted. Returns one record per handle with isLive, roomId, title, viewerCount, startedAt, streamUrls. Use this for is-live monitoring of known creators. NOT for one-off live-room URL inspection (use 'liveRoomUrls') or chat capture (use 'chatFeedUsername').",
            "items": {
              "type": "string"
            }
          },
          "liveRoomUrls": {
            "title": "Live room URLs or room IDs (room-details mode)",
            "type": "array",
            "description": "List of TikTok live room URLs like 'https://www.tiktok.com/@user/live' or bare numeric roomIds. Returns the full live-room object (title, viewers, streamData, hashTag, paidEvent flag). Use this when you have direct room URLs from elsewhere; for username-only is-live checks use 'usernames'.",
            "items": {
              "type": "string"
            }
          },
          "chatFeedUsername": {
            "title": "Username for real-time chat + gifts capture (chat-feed mode)",
            "type": "string",
            "description": "Single TikTok @handle whose live chat/gifts/joins/likes will be captured for 'chatCaptureSeconds' seconds via WebSocket (no cookies). The creator must be live when the run starts. One event per comment/gift/member-join/like is pushed to the dataset. Charged at $0.0002 per event. NOT for is-live polling (use 'usernames')."
          },
          "chatCaptureSeconds": {
            "title": "Chat capture duration (seconds)",
            "minimum": 10,
            "maximum": 1800,
            "type": "integer",
            "description": "How long to listen on the live chat WebSocket before closing. Defaults to 60 seconds. Range 10-1800. Only used when 'chatFeedUsername' is set. Longer captures cost more (one PPE event per chat/gift/join/like message). Run also stops early if the creator ends the stream.",
            "default": 60
          },
          "chatEventTypes": {
            "title": "Chat event types to capture",
            "type": "array",
            "description": "Which WebSocket event classes to push. Defaults to ['chat','gift'] (the high-signal ones). Add 'member' for join notifications and 'like' for like bursts (verbose). 'social' = follows/shares.",
            "items": {
              "type": "string",
              "enum": [
                "chat",
                "gift",
                "member",
                "like",
                "social"
              ]
            },
            "default": [
              "chat",
              "gift"
            ]
          },
          "discoverCategory": {
            "title": "Discover currently-live by category (discover mode)",
            "enum": [
              "",
              "gaming",
              "lifestyle",
              "music",
              "fashion",
              "food",
              "sports",
              "education",
              "entertainment",
              "beauty",
              "comedy"
            ],
            "type": "string",
            "description": "Category slug to list currently-broadcasting rooms (e.g. 'gaming', 'lifestyle', 'music'). Uses tiktok.com/live discovery via Playwright + residential proxy. Returns list of live rooms with creator handle, title, viewer count. Leave blank when not in discover mode.",
            "default": ""
          },
          "discoverRegion": {
            "title": "Discover region (ISO country)",
            "type": "string",
            "description": "Two-letter ISO country code for residential proxy region when discovering live rooms (e.g. 'US', 'GB', 'JP'). Defaults to 'US'. Only used in discover mode.",
            "default": "US"
          },
          "maxDiscoverResults": {
            "title": "Max discover results",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Hard cap on currently-live rooms returned by discover mode. Default 50, range 1-200. Higher = more compute + proxy cost.",
            "default": 50
          },
          "maxResults": {
            "title": "Max results (status/room modes)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Hard cap on records pushed by live-status + room-details modes (does NOT cap chat-feed events — use 'chatCaptureSeconds'). Default 100, range 1-1000.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}