Remember when vertical videos were considered nonsense? Well, meet Instagram Reels, YouTube Shorts, and Facebook Stories - they all ended up emulating the success of one little app, TikTok. So how do you scrape it?
Hey, we're Apify. You can build, deploy, share, and monitor your scrapers on the Apify platform. Check us out.
TikTok grew out of a space for teenagers to show off their dance moves and lip sync. Now a major infotainment platform for Gen Z, millennials, and beyond, it is no longer just a "Chinese app" but a place for new trends, authentic dialogue, and advanced search. TikTok's growing popularity is only making it more interesting to users from other social media platforms, celebrities, researchers, brands, tech giants, and even the FBI! ๐ฎ So can we download that data?
In this short tutorial, weโll show you how to scrape TikTok videos in 4 simple steps and 3 different ways, no coding required. No time for reading? We get it, head over to the YouTube tutorial ๐น๐ด
โWhy extract TikTok data?
Before we start, hereโs a couple of things you should know about this app and its users:
๐ TikTok moves fast. In 2022, TikTok became the most downloaded app in the world, with 3.5+ BLN total downloads. Mic drop.
๐โโ๏ธ Its audience is young and active.Nearly half of TikTok users are under 30. And they really love the app, spending an average of 52 min/day on the platform. If you consider that most of the videos do not exceed a minute, that's a lot of videos. 83% of TikTok users have posted a video at least once.
๐ Visual search is a competition to Google. In July 2022, SVP of search at Google admitted that โalmost 40% of young people, when they are looking for a place for lunch, they donโt go to Google Maps or Search, they go to TikTok or Instagram.โ
โถ๏ธ Faster video content is a competition to YouTube. It goes further: a study has shown kids aged 4-15 spend an average of 80 min/day on this app, making TikTok the biggest competitor to YouTube for kids.
๐งโโ๏ธ Setting trends and influencing other media. If you see an interesting Instagram Reel, YouTube Short, or Facebook Story - it's very likely just an old TikTok video.
๐ More and more brands are joining TikTok. Uncharted territory or "tabula rasa for marketing campaigns" no more. In 2022, numerous brands were cautiously registering on the platform, learning its ways, and succeeding.
๐ชข Does TikTok have an API?
TikTok offers four APIs that allow access to TikTok data: Research API, Display API, Commercial Content API, and Data Portability API. You can find all of them on Developers' Portal. However, to access any of these APIs, you would typically need to register and get approved.
To use TikTok's official APIs, you will typically need a TikTok developer account, a regular TikTok account, and approval for Login Kit or other API products. Some APIs, like the Data Portability API, are still being developed. To access them, you must have a specific use case or be in certain geographical areas, like the EEA.
So can I scrape TikTok without an API?
As for an approval-free alternative, you can use scrapers and crawlers as a stand-in for a web scraping API, e.g. TikTok Data Extractor or TikTok Scraper. These TikTok web scrapers are just an example of Actors available in Apify Store. As with the other Actors, you can use these using an API or scheduler. So basically, you can consider them your own personal TikTok API. You can call them using an API Client in Python, JavaScript, and curl. You can also use available API Endpoints to get the scraped TikTok data to where you need it.
๐ฅพ Step-by-step guide to scraping TikTok
You'll need a tool that is easy enough to use but complicated enough to scrape a website with a structure like TikTok's. Itโs a tall order.
Cue our TikTok Scraper, which scrapes data from hashtags, user profiles, and separate videos in a structured format. You can download that TikTok data onto your computer and plug it into your existing workflow, projects, spreadsheets, and applications. Here's how you can do that:
Step 1. Go to TikTok Scraper and click Try for free
Find the TikTok Scraper page (which will look like this) and click theTry for freebutton. Youโll be redirected from our website to the Apify Console.
If you donโt have an Apify account yet, sign up using your email, Gmail, or GitHub account. No credit card strings attached; you'll have a free trial.
Step 2. Indicate TikTok video, profile or hashtag to scrape
Now that you're in your workspace, it's time to decide: what data you want to extract? Choose your starting point:
section 1 โ hashtags #๏ธโฃ
section 2 โ profiles ๐จโ๐ณ
section 3 โ specific videos ๐ผ
section 4 โ search ๐
#๏ธโฃ How to scrape data from TikTok hashtags?
Type in or copy-paste one or more TikTok hashtags that interest you. You will be able to scrape all videos posted with this hashtag and their details.
#๏ธโฃ
Hashtags data will include (to each scraped video of this hashtag): caption, timestamp, country of creation, ad status, music details, video format details, video URL, number of comments, plays, shares, likes, as well as author's name, nickname, verified status, link in bio, total number of fans, hearts, videos, likes, popularity of hashtag, etc.
๐จโ๐ณ How to scrape data from TikTok profiles?
Alternatively, you can also scrape not just hashtags, but TikTok videos uploaded by a specific user. Think of a user profile page you want to scrape; letโs say, Gordon Ramsayโs and Jamie Oliver's tiktoks. So just add their usernames into the fields. If in doubt, you can always check their handles with the app.
๐จโ๐ณ
Profile data will include (to each scraped video of this profile): caption, timestamp, country of creation, ad status, music details, video format details, video URL, number of comments, plays, shares, saves, likes, as well as author's name, nickname, verified status, link in bio, total number of fans, hearts, videos, likes, etc.
๐ผ How to scrape data from specific TikTok videos?
You can scrape data from specific TikTok videos by simply adding their URLs.
๐ผ
Video data will include: caption, creation timestamp, number of likes, shares, plays, comments, video duration, URL, and author's username.
๐ How to scrape TikTok search results?
You can scrape TikTok search by simply typing in or pasting queries and choosing the search section (top, by video or by profile).
๐
Search data will include: caption, creation timestamp, author metadata, music and video metadata, video URL, number of likes, shares, plays, comments, saves, included hashtags, mentions, isPinned and isSlideshow.
Three final remarks before we start extracting data:
โ in each section, you can add as many fields as you want or paste a prepared list into Bulk edit field
โ you can fill several sections at once or keep it to one
โ you can set how many results you want in Max results field. It counts results per field, so if you set it to 20 and add 3 hashtags (for instance), you'll get 60 results in total.
Step 3. Click Start โถ๏ธ
Once you are all set, click the Start button. Notice that the status will change to Running, so wait for the scraper's run to finish. It will be just a few minutes before you see the status switch to Succeeded.
Step 4. View and collect your data
After the run has finished, you can preview scraped data in the Output table or in a new tab. You can preview the data by format before downloading any of it.
You can also preview the data by category: by posts, authors, videos, overview table, or all results. This categorization will help you see clearly through very large datasets and complex search queries.
To export the data, click on Export X results button or go to the Storage tab. Storage contains your scraped data in many formats, including HTML table, JSON, CSV, Excel, XML, and RSS feed. There you can download it in a format that suits your needs. You can also export all the data you're seeing or only a part of it: by category or even specific fields.
And that's kind of it. But wait, there's more!
โ FAQ
๐ฉโโ๏ธ Is it legal to scrape TikTok?
Just like with any other Apify data extraction tools, web scraping publicly available data on any website, including TikTok, is legal. But itโs still important to take several regulations into account, such as the GDPR and CCPA, as these protect personal data. Here you can learn more about the legality of web scraping and scraping ethically.
๐ธ Need more predictable pricing when scraping TikTok?
For the most predictable pricing, you might want to try TikTok Data Extractor which can scrape 1,000 results for $4.00.
๐ค Can I use AI to scrape TikTok?
AI is currently unable to scrape websites directly, but it can help generate code for scraping TikTok if you prompt it with the target elements you want to scrape. Note that the code may not be functional, and website structure and design changes may impact the targeted elements and attributes.
โจ๏ธ Can I export TikTok comments?
Yes. Use TikTok Comments Scraper ๐ to that end. It extracts full comment text, username, timestamp, number of replies, number of likes, etc. You can explore other dedicated TikTok crawlers we have in Store.
#๏ธโฃ Want to scrape TikTok comments or hashtags?
If you want to scrape specific TikTok data, you can use one of the dedicated scrapers below, each built particularly for the relevant TikTok data scraping case, whether it's hashtags, comments, sounds, or all data at once:
Follow trends and predict emerging opportunities and influences
Scan the market for authentic product reviews
Detect coordinated efforts in spreading disinformation, such as in this tool used by journalists to analyze the events of the Russo-Ukrainian war.
๐ How to use data extracted from TikTok for marketing?
TikTok is the most dynamic environment to learn about the young generation. In general, TikTok is very responsive to promotional efforts, with 61% of TikTok users admitting they are likely to watch ads. However, TikTok marketing campaigns have to be especially intricate, involving the right causes and authentic engagement. With scraped TikTok data you can:
do market research for planning and analyzing campaigns
promote your own channel
collaborate with an influencer
The best thing about TikTok is that it's a huge flexible social media platform with user-generated content, authentic engagement, and community-building at its core. All this points to piles of social data you can scrape, learn from and adjust your research and analysis strategies accordingly.