{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Viral Video Finder & Competitor Breakout Analyzer",
    "description": "Find breakout TikTok videos that beat each creator's normal baseline. Get Creator View Multipliers, 0–100 Breakout Scores, views/hour velocity, engagement rates, hook/CTA creative patterns, and competitor winners in JSON/CSV — no AI key or login.",
    "version": "2.2",
    "x-build-id": "KPVpBi8ZssFPdfu0F"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scravion~tiktok-viral-video-competitor-analyzer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scravion-tiktok-viral-video-competitor-analyzer",
        "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/scravion~tiktok-viral-video-competitor-analyzer/runs": {
      "post": {
        "operationId": "runs-sync-scravion-tiktok-viral-video-competitor-analyzer",
        "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/scravion~tiktok-viral-video-competitor-analyzer/run-sync": {
      "post": {
        "operationId": "run-sync-scravion-tiktok-viral-video-competitor-analyzer",
        "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": {
          "targets": {
            "title": "TikTok Accounts or Video URLs",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "Add @username, username, public TikTok profile URL, public video URL, or vm./vt. short link. Add multiple creators to compare competitors side-by-side.",
            "items": {
              "type": "string"
            }
          },
          "videosToAnalyze": {
            "title": "Videos to Analyze per Creator",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum recent public videos used to calculate each creator's median/average baseline and breakout scores.",
            "default": 30
          },
          "calculateBreakoutScore": {
            "title": "Calculate Breakout Score (0–100)",
            "type": "boolean",
            "description": "Calculates a transparent 0–100 descriptive score combining Creator View Multiplier (50%), Views/Day (25%), Engagement Rate (20%), and Recency (5%).",
            "default": true
          },
          "sortBy": {
            "title": "Sort Results By",
            "enum": [
              "creatorViewMultiplier",
              "breakoutScore",
              "viewsPerHour",
              "viewsPerDay",
              "engagementRate",
              "views"
            ],
            "type": "string",
            "description": "Primary ranking order applied before maxItems is stored.",
            "default": "creatorViewMultiplier"
          },
          "sourceDatasetId": {
            "title": "Source Apify Dataset ID (Optional Pipeline Mode)",
            "type": "string",
            "description": "Optional Apify Dataset ID from any TikTok scraper (e.g., clockworks/tiktok-scraper). Automatically normalizes items, computes per-creator baselines, Breakout Scores, hooks, and winning patterns."
          },
          "videosInput": {
            "title": "Direct TikTok Videos JSON Array (Optional)",
            "type": "array",
            "description": "Optional JSON array of TikTok video objects (supports both TikTok raw item JSON and Apify scraper formats)."
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration (Apify Residential Default for Live Profiles)",
            "type": "object",
            "description": "Defaults to Apify Residential Proxy with media/image blocking enabled for minimal bandwidth cost and reliable public TikTok profile access.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "maxItems": {
            "title": "Max Unique Video Results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum unique accepted primary videos stored across all sources. Duplicates and failed records never consume this limit.",
            "default": 30
          },
          "minBaselineVideos": {
            "title": "Minimum Videos for Creator Baseline",
            "minimum": 3,
            "maximum": 20,
            "type": "integer",
            "description": "Creator median/average and outlier multiplier stay null until at least this many videos have valid view counts.",
            "default": 5
          },
          "includeProfile": {
            "title": "Include Creator Profile Metrics",
            "type": "boolean",
            "description": "Include follower, following, verified status, and total-like fields when publicly exposed.",
            "default": true
          },
          "includeEngagementMetrics": {
            "title": "Calculate Engagement Metrics",
            "type": "boolean",
            "description": "Calculate engagementRate, likeRate, commentRate, and shareRate without treating missing counts as zero.",
            "default": true
          },
          "includeCreativeAnalysis": {
            "title": "Analyze Captions, Hooks & CTAs (No AI Key Required)",
            "type": "boolean",
            "description": "Deterministic extraction of first-line hooks, question/number hooks, CTAs, hashtags, mentions, emoji density, and keywords.",
            "default": true
          },
          "timeout": {
            "title": "Request Timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Per-request timeout for public TikTok pages and oEmbed fallback.",
            "default": 25
          },
          "concurrency": {
            "title": "Request Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum simultaneous public requests. Keep conservative to reduce rate-limit risk.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}