{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Trending Videos Scraper: Hashtag Category Stats",
    "description": "TikTok Trending Videos Scraper: Extract trending videos with hashtags, category stats, views, likes, comments, shares, creators, and engagement data. Compare hashtag performance by category to identify viral topics, audience interests, and content opportunities.",
    "version": "0.1",
    "x-build-id": "kSAotT2a4gZWX8VQn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/api-empire~tiktok-trending-videos-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-api-empire-tiktok-trending-videos-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/api-empire~tiktok-trending-videos-scraper/runs": {
      "post": {
        "operationId": "runs-sync-api-empire-tiktok-trending-videos-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/api-empire~tiktok-trending-videos-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-api-empire-tiktok-trending-videos-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": {
          "discoveryCountry": {
            "title": "🌐 Discovery Country",
            "enum": [
              "AU",
              "BR",
              "CA",
              "EG",
              "FR",
              "DE",
              "ID",
              "IL",
              "IT",
              "JP",
              "MY",
              "PH",
              "RU",
              "SA",
              "SG",
              "KR",
              "ES",
              "TW",
              "TH",
              "TR",
              "AE",
              "GB",
              "US",
              "VN"
            ],
            "type": "string",
            "description": "Country to pull the trending list from (base input key 'countryCode' is still accepted as a fallback). Only used when 'Direct Video URLs' below is empty."
          },
          "trendRankBy": {
            "title": "📊 Trend Rank Metric",
            "enum": [
              "vv",
              "like",
              "comment",
              "repost"
            ],
            "type": "string",
            "description": "Sort the discovery list by this metric (base input key 'sortBy' is still accepted as a fallback)."
          },
          "lookbackPeriod": {
            "title": "📅 Lookback Period",
            "enum": [
              "7",
              "30"
            ],
            "type": "string",
            "description": "Trending window to scrape (base input key 'period' is still accepted as a fallback)."
          },
          "maxResults": {
            "title": "🔢 Max Results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of videos to return, whether from discovery or direct video URLs (base input key 'maxItems' is still accepted as a fallback)."
          },
          "includeEngagementStats": {
            "title": "📈 Include Engagement Stats (Discovery Mode)",
            "type": "boolean",
            "description": "In discovery mode, fetch each video's detail page for likes/comments/bookmarks/shares/videoUrl (base input key 'includeDetailedVideoData' is still accepted as a fallback). Always fetched automatically in Direct Video Input mode, since the classifier/engagement features require it."
          },
          "videoUrls": {
            "title": "🔗 Direct Video URLs",
            "type": "array",
            "description": "Bypass the country-based discovery list entirely and run the classifier + engagement analytics directly against these TikTok video URLs. Recommended: TikTok deprecated the discovery endpoint server-side (see actor README) — this is the reliable way to verify results today. Example: https://www.tiktok.com/@user/video/1234567890123456789",
            "items": {
              "type": "string"
            }
          },
          "targetIndustries": {
            "title": "🏭 Target Industries",
            "type": "array",
            "description": "Only keep videos whose LOCALLY-CLASSIFIED niche/industry (a keyword heuristic over title + hashtags + creator bio — not a TikTok-provided field) matches one of the selected categories. Leave empty to keep all industries.",
            "items": {
              "type": "string",
              "enum": [
                "Apparel & Accessories",
                "Baby, Kids & Maternity",
                "Beauty & Personal Care",
                "Business Services",
                "Education",
                "Financial Services",
                "Food & Beverage",
                "Games",
                "Healthcare",
                "Home Improvement",
                "Household Products",
                "Life Services",
                "News & Entertainment",
                "Pets",
                "Real Estate",
                "Software & Apps",
                "Sports & Outdoor",
                "Tech & Electronics",
                "Travel",
                "Vehicle & Transportation"
              ]
            },
            "default": []
          },
          "minEngagementRate": {
            "title": "📊 Min Engagement Rate",
            "minimum": 0,
            "type": "number",
            "description": "Only keep videos with a computed engagementRate (likes+comments+shares ÷ views, as a percentage) at or above this value. Videos with unknown views are excluded when this is > 0. Default 0 = no filter.",
            "default": 0
          },
          "onlyPromotedVideos": {
            "title": "📢 Only Promoted Videos",
            "type": "boolean",
            "description": "Only keep videos where the real TikTok 'isAd' (sponsored/Spark Ad) field is true.",
            "default": false
          },
          "includeNicheBenchmarks": {
            "title": "🥇 Include Niche Benchmarks",
            "type": "boolean",
            "description": "Add a nicheBenchmark object to each row comparing its engagementRate to the average engagementRate of other videos classified in the same industry within this run.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy Configuration",
            "type": "object",
            "description": "Optional Apify Proxy configuration for the video-page fetches."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}