TikTok Trends Scraper avatar

TikTok Trends Scraper

Pricing

from $0.08 / 1,000 videos

Go to Apify Store
TikTok Trends Scraper

TikTok Trends Scraper

Scrape the videos that trend on TikTok now and the top videos of any hashtag. Each hashtag also comes with its video count and view count. Each video comes with its hashtags, author, music, video details, and stats (views, likes, comments, shares, saves).

Pricing

from $0.08 / 1,000 videos

Rating

0.0

(0)

Developer

Kai

Kai

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Features

Limited permissions

Share

Get the videos that trend on TikTok now, and the top videos of any hashtag, with their stats. Every video is one item in the Dataset: description, hashtags, creation time, author with follower counts, music, video details, and counts of views, likes, comments, shares, and saves. Every hashtag that you add also gives one item with its video count and its view count.

Run it with no input to get a fresh sample of trending videos in about half a minute. Add hashtag URLs to compare hashtags and to read their top videos.

Use cases

Trend monitoring

See what is popular on TikTok right now: which videos, creators, sounds, and hashtags. Run the same input on an Apify schedule and compare the runs.

{
"resultsLimit": 100
}

Use videoId, desc, hashtags, music.title, author.uniqueId, stats.views, stats.likes, and stats.shares.

Hashtag analytics

Compare how big hashtags are. Each hashtag gives one item with its video count and view count.

{
"hashtagUrls": [
"https://www.tiktok.com/tag/space",
"https://www.tiktok.com/tag/astronomy"
],
"resultsLimit": 20
}

Filter the Dataset on type equal to hashtag. Use name, stats.videos, and stats.views.

Content research for a niche

Read the top videos of a hashtag, and see which creators, sounds, and co-occurring hashtags go with it.

{
"hashtagUrls": ["https://www.tiktok.com/tag/space"],
"resultsLimit": 150
}

Use author.uniqueId, author.followers, desc, hashtags, music.title, stats.views, and stats.likes.

Sound and creator discovery

Find the sounds and creators in the trending videos. Sort by stats.views, or count how often a music.id or an author.uniqueId appears.

Use music.id, music.title, author.uniqueId, author.followers, and stats.views.

Growth tracking

Run a hashtag on an Apify schedule. Watch stats.videos and stats.views on the hashtag item to see how fast the hashtag grows. Join the video items of the runs on videoId, and watch stats.views, stats.likes, and stats.shares move over time.

Choose what to collect

Starting pointInputUse it for
The trending videosNo inputA sample of what trends now
Fewer or more trending videosresultsLimitKeep a run short, or read more
One or more hashtagshashtagUrlsThe hashtag counts and the top videos
Trending videos and hashtagshashtagUrls and the limitBoth in one run

The trending videos are always read first. To keep only hashtag data, filter the Dataset on source equal to hashtag, or on type equal to hashtag.

What each item includes

  • Video: ID, URL, description and its language, creation time, hashtags, mentions, and effects
  • Video details: duration, size in pixels, format, bitrate, and cover links
  • Author: handle, display name, bio, verified flag, avatar link, and follower, following, like, and video counts
  • Stats: views, likes, comments, shares, saves, and reposts
  • Music: ID, title, author, album, duration, and links
  • Flags: ad, and whether duets, stitches, and sharing are on
  • Photo posts: the image links
  • Source: explore for a trending video, hashtag for a hashtag video, and the hashtag URL from your input
  • Position: the rank of a video among the videos of its hashtag
  • Hashtag item: ID, name, description, video count, view count, and image link

Run the Actor with an empty input, or set resultsLimit:

{
"resultsLimit": 100
}

The Actor saves up to 100 trending videos. The default is 50. The highest value is 1000.

The trending videos are a sample that TikTok picks. It changes from run to run, and it is not a ranking. A trending video has rank set to null for this reason. Two runs a few minutes apart share some videos and differ in others.

Read the videos of hashtags

Add hashtag URLs:

{
"hashtagUrls": ["https://www.tiktok.com/tag/space"],
"resultsLimit": 30
}

For each hashtag, the Actor saves one hashtag item, then up to 30 videos. A hashtag URL looks like https://www.tiktok.com/tag/<name>.

The rank of a hashtag video is its position among the videos of the hashtag, starting at 1. TikTok sets this order. It is not the order of views or of time.

A hashtag gives about 140 to 175 videos. A higher resultsLimit does not give more videos for a hashtag.

How results are ordered and limited

Order. The Actor saves the trending videos first. It then handles hashtagUrls in input order. For each hashtag, the hashtag item comes first, then the videos of the hashtag in rank order. An error item goes to the Errors dataset.

Limit. resultsLimit applies to the trending videos and to each hashtag, not to the complete run. The Actor stops at exactly that number of videos. The hashtag items do not count.

Same video twice. A video appears once in one source. It can appear again in another source: the trending videos and a hashtag, or two hashtags. Its source and inputUrl tell you the source. The same URL twice in hashtagUrls is read once.

Input

All input fields are optional. An empty input reads the trending videos.

Input reference

ParameterTypeDefaultEffect
hashtagUrlsstring[]emptyTikTok hashtag URLs. The Actor saves a hashtag item and the top videos of each hashtag.
resultsLimitinteger, 1 to 100050Upper limit on saved videos for the trending videos and for each hashtag.
proxyConfigurationobject{"useApifyProxy":true}Connection settings for the run. Keep the default.
  • A hashtag URL looks like https://www.tiktok.com/tag/<name>. An entry that is not a hashtag URL gives an error item. The other entries are still read.
  • A resultsLimit below 1 or above 1000 stops the run before collection. The message names the problem.
  • Unknown input fields are ignored.

Output

Each Dataset item is one video or one hashtag. A source that the Actor could not read gives one error item in the Errors dataset, not in the Dataset. The field type says video or hashtag. Every documented video field is present in every video item. A value that is not available is null, an empty list, or 0 for a count. The fields author, stats, music, and video are objects.

Sample video

This is a trending video. The links are removed. It is not a saved Dataset item.

Sample hashtag

The link is removed. It is not a saved Dataset item.

Field reference

FieldType and contents
typestring. video for a video item.
sourcestring. explore for a trending video, hashtag for a video of a hashtag.
inputUrlstring or null. The hashtag URL from your input. null for a trending video.
ranknumber or null. The position among the videos of the hashtag, from 1. null for trending.
videoIdstring. The video ID.
videoUrlstring. The link to the video.
descstring. The description. It is empty when the video has none.
descLanguagestring or null. The language code of the description, such as en.
createTimestring or null. The creation time in Unix seconds, such as "1793260800".
locationCreatedstring or null. Always null in this Actor.
categoriesstring[]. Always empty in this Actor.
hashtagsstring[]. The hashtags of the description, without #.
mentionsstring[]. The accounts that the description mentions, without @.
effectsstring[]. The names of the effects that the video uses.
isAdboolean or null. true for a paid ad.
isAiGeneratedboolean or null. Always null in this Actor.
isPinnedboolean or null. Always null in this Actor.
duetEnabledboolean or null. Whether other users can make a duet with the video.
stitchEnabledboolean or null. Whether other users can stitch the video.
shareEnabledboolean or null. Whether the video can be shared.
captionLanguagesstring[]. The caption languages that the video offers, such as eng-US.
imagesstring[]. The image links of a photo post. Empty for a video.

video

FieldType and contents
video.durationnumber. The duration in seconds. It is 0 for a photo post.
video.widthnumber or null. The width in pixels.
video.heightnumber or null. The height in pixels.
video.ratiostring or null. The resolution label, such as 1080p.
video.definitionstring or null. The quality label, such as 1080p.
video.formatstring or null. The file format, such as mp4.
video.codecstring or null. The video codec, such as h264.
video.bitratenumber or null. The bitrate in bits per second.
video.sizenumber or null. The file size in bytes.
video.coverstring or null. A link to the cover image.
video.originCoverstring or null. A link to the original cover image.
video.dynamicCoverstring or null. A link to the animated cover.

author

FieldType and contents
author.idstring. The account ID.
author.uniqueIdstring. The handle, without @.
author.nicknamestring. The display name.
author.verifiedboolean or null. Whether the account is verified.
author.signaturestring or null. The bio.
author.createTimestring or null. Always null in this Actor.
author.privateboolean or null. Whether the account is private.
author.sellerboolean or null. Always null in this Actor.
author.avatarstring or null. A link to the avatar image.
author.followersnumber or null. The follower count.
author.followingnumber or null. The count of accounts that the author follows.
author.likesnumber or null. The total likes that the account received.
author.videosnumber or null. The video count of the account.
author.likesGivennumber or null. The count of videos that the account liked.

stats

FieldType and contents
stats.viewsnumber. The play count.
stats.likesnumber. The like count.
stats.commentsnumber. The comment count.
stats.sharesnumber. The share count.
stats.savesnumber. The count of users who saved the video.
stats.repostsnumber. The repost count.

music

FieldType and contents
music.idstring or null. The sound ID.
music.titlestring or null. The sound title.
music.authorstring or null. The name of the sound author.
music.albumstring or null. The album, when the sound has one.
music.durationnumber or null. The duration in seconds.
music.playUrlstring or null. A link to the audio file.
music.coverstring or null. A link to the sound cover image.
  • The values in stats are the values at the time of the run. They change over time.
  • TikTok rounds large counts, such as followers of 1700000.
  • Image and audio links expire after about two days. Download the files soon after the run if you need them.

Hashtag fields

FieldType and contents
typestring. hashtag for a hashtag item.
inputUrlstring. The hashtag URL from your input.
hashtagIdstring. The hashtag ID.
namestring. The hashtag, without #.
descstring. The description of the hashtag. It is empty when the hashtag has none.
isCommerceboolean or null. Whether TikTok marks the hashtag as a commerce hashtag.
imagestring or null. A link to the hashtag image. It is null when the hashtag has none.
stats.videosnumber or null. The number of videos with the hashtag.
stats.viewsnumber or null. The total views of the videos with the hashtag.
  • stats.videos and stats.views are the figures that TikTok shows for the hashtag. They do not have to match the number of videos that the hashtag gives. One test hashtag showed 96 videos and gave 141.
  • The hashtag item comes before the videos of the hashtag.

Which fields are empty for which input

These video fields are always empty in this Actor: locationCreated, categories, isAiGenerated, isPinned, author.createTime, and author.seller. The Actor still saves them. Each value is null or an empty list. Other fields can still be empty for one video, for example when the video has no captions.

The trending videos and the hashtag videos have the same fields. Only these fields differ:

FieldTrending videosHashtag videos
sourceexplorehashtag
inputUrlnullHashtag URL
ranknullFrom 1

Error items

A source that the Actor cannot read gives one error item in the Errors dataset. The Dataset holds only videos and hashtags. The run goes on with the next source.

{
"inputUrl": "https://www.tiktok.com/tag/zzznosuchtag84726153",
"error": "The hashtag does not exist or is not available.",
"errorCode": "HASHTAG_UNAVAILABLE"
}

An error item has three fields:

FieldType and contents
inputUrlstring or null. The entry from your input. null for the trending videos.
errorstring. A short sentence that says what went wrong.
errorCodestring. One of the codes below.
errorCodeMeaning
NOT_A_HASHTAG_URLThe entry of hashtagUrls is not a hashtag URL.
HASHTAG_UNAVAILABLEThe hashtag does not exist or is not available.
READ_FAILEDThe trending videos or the videos of a hashtag could not be read. Try again later.

Limits and field notes

How many videos can I collect?

resultsLimit is an upper limit for the trending videos and for each hashtag, not a required result count. The Actor can save fewer videos.

  • The trending videos are a sample that changes between runs. resultsLimit goes up to 1000.
  • A hashtag gives about 140 to 175 videos. In our tests, one hashtag gave 150 videos and another 141. A hashtag with a large video count still gives about 140 to 175 videos.

How long does a run take?

These times are from our tests. Times can differ from run to run.

RunTime
The trending videos with the default limit of 50about 30 s
150 trending videos and one hashtag of 150 videosabout 80 s
A hashtag that does not exist, with 1 trending videoabout 20 s
1000 trending videos and two hashtags of about 150 eachabout 2.5 minutes

A source that cannot be read at all takes longer: about 1.5 minutes for the trending videos and about 3 minutes for a hashtag in our tests.

No. TikTok picks them, and they change from run to run. Use createTime to see the age of each video, and stats.views to sort them.

Are the hashtag videos recent?

Not always. TikTok picks the videos of a hashtag, and many of them are old.

Which videos are available?

The Actor reads public data only. Private accounts and age-gated videos are not available.

Why are some fields empty?

Not every video has every field, and some fields are always empty in this Actor. The Actor still saves the video. See Which fields are empty for which input.

What happens when a source fails?

The Actor gives an error item, writes a warning to the log, and continues with the next source. The items that it already saved stay in the Dataset.

If nothing at all can be read, the run fails with the message "No video could be read. Check the input and try again." The error items stay in the Errors dataset. Invalid input also fails the run with a message that names the problem.

Can a video disappear after I collect it?

Yes. A creator can delete a video or make it private at any time. Compare runs of the same input to find the videos that are gone.

Similar Actors