Retrieve the public trends currently rendered by TikTok Creative Center, including hashtag trends and, when requested, video trends. Preserve each visible trend's name, destination URL, and surrounding metrics, ranking, creator, or other card text.
Use Cases
Use for current public trend discovery on TikTok Creative Center when the caller supplies a country and optionally a time period or region. This recipe is read-only and does not require signing in or interacting with trend cards.
Automation Flow
- Construct the direct trend URL rather than opening the Creative Center homepage:
- Hashtags:
https://ads.tiktok.com/creative/creativeCenter/trends/hashtag?countryCode={country-code}&period={period}®ion={region} - Videos:
https://ads.tiktok.com/creative/creativeCenter/trends/video?countryCode={country-code}&period={period}®ion={region}The observed default wasperiod=7; retain the caller's requested country, period, and region. Theregionparameter is optional if the page accepts the country-level default.
- In one browser call per requested trend type, navigate directly to the route with DOM-content completion and wait for client-rendered rows or cards to appear. Do not click tabs, cards, or “View details”.
- Run this evaluator on the loaded page. It extracts semantic rows, Creative Center trend links, and public TikTok hashtag, profile, or video links:
(() => {
const visible = el => {
const s = getComputedStyle(el), r = el.getBoundingClientRect();
return s.display !== 'none' && s.visibility !== 'hidden' && r.width > 0 && r.height > 0;
};
const clean = s => (s || '').replace(/\s+/g, ' ').trim();
const trendLink = href => /\/(?:hashtag|video)(?:[/?#]|$)/i.test(href || '');
const routeTab = href => /\/creative\/creativeCenter\/trends\/(?:hashtag|video)\/?(?:[?#]|$)/i.test(href || '');
const publicTikTok = href => /^https?:\/\/(?:www\.)?tiktok\.com\/(?:@[^/?#]+|video\/\d+|tag\/[^/?#]+)/i.test(href || '');
const cardOf = a => a.closest('li,article,[role="listitem"],[class*="card"],tr,[role="row"]') || a;
const rows = [...document.querySelectorAll('tr,[role="row"]')]
.filter(visible)
.map(row => {
const text = clean(row.innerText), a = row.querySelector('a[href]');
const named = row.querySelector('a[href*="/hashtag/"]') || a;
const name = named?.innerText || (text.match(/#[\p{L}\p{N}_.-]+/u) || [text])[0];
return {name: clean(name), details: text, href: a?.href || null};
})
.filter(x => x.name && x.details && !/^rank$|^name$/i.test(x.name));
const links = [...document.querySelectorAll('a[href]')]
.filter(a => visible(a) && !routeTab(a.href) && (trendLink(a.href) || publicTikTok(a.href)))
.map(a => {
const card = cardOf(a), details = clean(card.innerText);
const hash = details.match(/#[\p{L}\p{N}_.-]+/u);
return {name: clean(a.innerText) || (hash ? hash[0] : ''), details, href: a.href};
})
.filter(x => x.name && x.details);
const all = [...rows, ...links];
const items = all.filter((x, i) => all.findIndex(y =>
(x.href && y.href === x.href) || (!x.href && y.name === x.name && y.details === x.details)
) === i);
return {
url: location.href,
type: /\/video(?:[/?#]|$)/i.test(location.pathname) ? 'video' : 'hashtag',
items
};
})()- Return the evaluator's
items; if both trend types are requested, run the same one-call navigation-and-extraction sequence for each direct route and label the combined results bytype.
Possible Friction Points
- The useful pages are nested routes under
/creative/creativeCenter/trends/, not merely the landing route/creative/creativeCenter/trends. countryCode,period, andregionare query parameters; preserve them when switching between hashtag and video routes.- Trend content is client-rendered after navigation. A DOM-content event alone may precede the rows, so wait for visible
tr,[role="row"], or trend links/cards before evaluating. - The page's own Hashtag and Video tabs are links to
/creative/creativeCenter/trends/hashtagand/creative/creativeCenter/trends/video. They match the trend-link shape, so exclude those bare route URLs or they appear among the results as trend items. - Hashtag pages commonly expose table rows or Creative Center hashtag links. Public TikTok destinations may use
/tag/{hashtag}as well as/@{username}or/video/{video-id}; preserve the surrounding card or row text. - Video pages may expose creator/video cards whose destination links are public TikTok URLs. The extractor includes creator, video, and hashtag destination forms.
- Some cards expose creator text rather than a hashtag or video title. Preserve the card's surrounding
detailsand destinationhrefinstead of assuming every item has a hashtag name. - CSS class names may change; the extractor intentionally prefers semantic rows, stable URL patterns, and generic card ancestors. If no items are returned, verify that the page finished rendering rather than clicking or interacting with the page.