Use TikTok Hashtag Momentum & Top Creator Tracker with Python
Reads TikTok Creative Center's trending-hashtag list for any country and returns rank, post and view counts, a day-by-day momentum curve, and top creators behind each trend.
1. Choose the data you need
Review the published README for supported collection modes, examples, and limits. The recipe below uses the current published input definition.
2. Prepare a source-based input
This JSON contains published prefills and required-field defaults. Review every value for your task before running it; it is not a promise of successful collection.
{
"countries": [
"US"
],
"includeCreatorLeaders": false,
"includeOverallRanking": true,
"includeTopComments": false,
"industries": [],
"maxItems": 10,
"minHashtagAppearances": 2,
"mode": "trendingHashtags",
"periods": [
"7"
],
"scanAllIndustries": false,
"videoContentTags": [],
"videoCountries": [
"US"
],
"videoOrganicOnly": false,
"videoPeriods": [
"7"
],
"videoSortBy": "views",
"weeksBack": 0
}
Download input.example.json and save your reviewed copy as input.json.
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | optional | Choose 'Trending hashtags' for TikTok's ranked hashtag charts (post/view counts, popularity curve, creators) or 'Trending videos' for TikTok's ranked video charts (views, engagement, author stats). |
countries | array | optional | (mode=trendingHashtags) One or more markets to read the hashtag chart for. Each market adds its own ranked rows. |
periods | array | optional | (mode=trendingHashtags) Lookback windows in days. 7 shows recent spikes, 90 shows longer-term trends. Select one or more. |
includeOverallRanking | boolean | optional | (mode=trendingHashtags) Include each market's overall top-3 hashtag chart. Turn off to read only the industry charts selected below. |
scanAllIndustries | boolean | optional | (mode=trendingHashtags) Read all 19 industry charts for every market and window. This widens coverage from 3 to up to 60 hashtags per market and window, because each industry chart is read separately. |
industries | array | optional | (mode=trendingHashtags) Specific industry charts to read when 'Scan all industries' is off. Ignored when scanning all industries. 19 public categories are available. |
includeCreatorLeaders | boolean | optional | (mode=trendingHashtags) Add creator rows that aggregate the creators TikTok credits across the collected hashtags, sorted by how many trends they appear in. |
minHashtagAppearances | integer | optional | (mode=trendingHashtags, creator leaderboard only) Only list creators credited on at least this many collected hashtag rows. |
videoCountries | array | optional | (mode=trendingVideos) Markets with a public TikTok trending-video chart. Select one or more. |
videoPeriods | array | optional | (mode=trendingVideos) Windows in days for the trending-video chart: 7 for videos created in the last week, 30 for the last month. |
videoSortBy | string | optional | (mode=trendingVideos) Metric used for the video ranking. |
videoOrganicOnly | boolean | optional | (mode=trendingVideos) Rank only organic (non-promoted) videos. TikTok returns a different ranking for organic-only charts. |
videoContentTags | array | optional | (mode=trendingVideos) Query TikTok's video ranking by content tag and dedupe the videos. Each selected tag is a separate ranking read; 'All tags' also includes the unfiltered chart, returning up to ~24 videos per market, window and sort instead of 4. Leave empty for the current unfiltered ranking. |
weeksBack | integer | optional | (mode=trendingVideos) Add past weekly rankings by moving the chart end date back 7 days per step (0-4). Useful for comparing this week with earlier weeks. |
includeTopComments | boolean | optional | (mode=trendingVideos) Add each video's top comments and comment keywords. Each video's comments are read separately (up to 100 videos per run). |
maxItems | integer | optional | Maximum number of data rows to write per run. Creator rows are not counted. |
3. Start an Actor run
Set APIFY_TOKEN in your environment. Python 3.10 or newer is sufficient; this recipe uses no third-party packages.
Execution may incur charges. Review current pricing on Apify. The request asks for a 120-second timeout and a charge limit; these settings are subject to Apify’s pricing and do not guarantee an all-inclusive spending cap.
import json
import os
import urllib.request
# Save the schema-derived example as input.json; review and edit it first.
with open("input.json", encoding="utf-8") as stream:
actor_input = json.load(stream)
token = os.environ["APIFY_TOKEN"]
request = urllib.request.Request(
"https://api.apify.com/v2/acts/yVYeUmb7hb4vybt1d/runs?timeout=120&maxTotalChargeUsd=0.50",
data=json.dumps(actor_input).encode("utf-8"),
headers={"Authorization": "Bearer " + token, "Content-Type": "application/json"},
method="POST",
)
# This starts a potentially billable run. Do not automatically retry this POST.
with urllib.request.urlopen(request, timeout=40) as response:
run = json.load(response)["data"]
print("Run ID:", run["id"])
print("Status:", run["status"])
# Inspect and download results in Apify Console once the run succeeds.
4. Inspect the actual results
Open the run in Apify Console and wait for a successful completion. Use the published output schema to locate results and the dataset schema to understand declared views. Missing or optional record fields must not be treated as guaranteed values.
Trending-hashtag rows with ranks, post and view counts, popularity curves, momentum signals and top creators; optional creator-leader rows; trending-video rows with engagement metrics and author stats.
Questions before you run
Which inputs are required?
No top-level fields are marked required in the published schema. Conditional requirements can still apply; check the README.
What does this guide verify?
The fields, prefills, and schema links are rendered from the published build. This is a usage recipe, not a paid live extraction test. Source availability and collection results can vary.
What if the run request times out?
Check Apify Console before retrying. The first request may already have created a run. Do not automatically repeat a run-creation POST.
Generated from source build vB58tHp5oGWTEgfzB and its README and schemas. Source changes regenerate this guide; no third-party editorial claims are inferred.