{
  "openapi": "3.0.1",
  "info": {
    "title": "Tiktok Trend Discovery Scraper",
    "description": "TikTok Trend & Discovery Scraper extracts trending TikTok videos, hashtags, creators, and discovery data. Use it to monitor trends, find viral content early, analyze momentum, and power research, alerts, analytics, and AI workflows.",
    "version": "0.5",
    "x-build-id": "MEFGuclFsI7e3Itir"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/coregent~tiktok-trend-discovery-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-coregent-tiktok-trend-discovery-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-trend-discovery-scraper/runs": {
      "post": {
        "operationId": "runs-sync-coregent-tiktok-trend-discovery-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-trend-discovery-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-coregent-tiktok-trend-discovery-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": {
          "resultType": {
            "title": "Result Type",
            "enum": [
              "videos",
              "hashtags",
              "sounds",
              "creators",
              "musicChartViral50",
              "musicChartTop50"
            ],
            "type": "string",
            "description": "What this run should output — one record type per run, so the dataset is always a clean table.\n\n- **Videos** (default) — the trending videos themselves, with engagement, author and viral scores.\n- **Hashtags** — for each keyword, the hashtags TikTok ranks for it with real view and video counts; for each hashtag you list, its entity record.\n- **Sounds in your niche** — the sounds driving *your* keywords and hashtags, ranked by how many discovered videos use them. Not a global chart — the sounds behind the trend you searched for.\n- **Creators behind the trend** — the creators driving *your* keywords and hashtags, ranked by the engagement they pulled, with full profiles (followers, bio, contact). Not TikTok's global creator list.\n- **Trending sounds — Viral 50** — TikTok's own breakout sound chart: sounds gaining fast, before they peak.\n- **Trending sounds — Top 50** — TikTok's own most-used sound chart.\n\nThe two Trending-sounds charts are fixed **global** leaderboards, so they **ignore your keywords and hashtags** and are capped at 50 sounds (use *Results Per Query* to return fewer).",
            "default": "videos"
          },
          "searchQueries": {
            "title": "Search Queries",
            "type": "array",
            "description": "Keywords or topics to discover trending content for. Example: ai tools, skincare, remote jobs. Leave empty if you only want to scrape hashtags — every keyword you list is scraped and charged.",
            "items": {
              "type": "string"
            }
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Hashtags to inspect (with or without #). Example: fyp, smallbusiness, booktok. Every hashtag you list is scraped and charged.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Direct URLs",
            "type": "array",
            "description": "Optional TikTok URLs to scrape directly. Supported: keyword search URLs (`.../search?q=...`), hashtag URLs (`.../tag/<name>`), and single-video URLs (`.../@user/video/<id>`). A single-video URL returns just that one video as a video record. Anything else is skipped.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "resultsPerQuery": {
            "title": "Results Per Query",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of results to collect per keyword or hashtag. This is a ceiling, not a guarantee — TikTok decides how deep a given search or hashtag feed goes, and popular queries return more than niche ones. For the **Trending sounds** charts it caps the chart at min(this value, 50).",
            "default": 50
          },
          "sortBy": {
            "title": "Sort By (best-effort)",
            "enum": [
              "default",
              "relevance",
              "latest",
              "popular"
            ],
            "type": "string",
            "description": "Requested sort order for keyword search results. Best-effort: the sort is passed to TikTok as a hint and TikTok may ignore it and return its default ranking. Applies to keyword searches only — hashtag pages are always returned in TikTok's own order.",
            "default": "default"
          },
          "enrichAuthorStats": {
            "title": "Enrich Creator Profiles",
            "type": "boolean",
            "description": "Fetch each creator's full profile: follower/like/video counts, bio, link in bio, public business email, category, verification, and TikTok Shop status. TikTok omits all of this from search and hashtag results, so it can only be fetched one creator at a time — this roughly doubles the run's cost and is billed per unique creator. Leave off unless you need creator-level data. NOTE: this option requires a paid Apify plan. On the Free plan it is skipped and you are not charged for it — all video, hashtag and sound records are returned in full, and Result Type 'creators' is unaffected on every plan.",
            "default": false
          },
          "includeVideos": {
            "title": "Include Videos",
            "type": "boolean",
            "description": "Internal. Video records are always collected; there is no extra charge for them.",
            "default": true
          },
          "includeHashtags": {
            "title": "Include Hashtags",
            "type": "boolean",
            "description": "Internal. Hashtag records are always collected; there is no extra charge for them.",
            "default": true
          },
          "debugMode": {
            "title": "Debug Mode",
            "type": "boolean",
            "description": "Internal. Verbose logging.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}