How I Scraped 2,000 Emails from TikTok for Cold Email Outreach
TL;DR #
Using a simple strategy, I scraped 2,000 emails from TikTok to advertise my micro SaaS side project over the weekend. To my surprise, the open rate of these cold emails was high. I haven’t fully optimized my email collection process, so I wrote this post to help you scrape even more emails from TikTok.
This is a technical blog. If you’re not a programmer but need to collect emails in the hundreds of thousands, I would recommend checking out Toughdata. They provide tools for TikTok scraping, and have helped several well known brands scale up their data collection.
Scraping Emails from TikTok #
I decided to experiment with cold email outreach to advertise my micro SaaS side project related to TikTok. Since I was focusing on TikTok, I figured the best place to find people to reach out to was on the platform itself.
After some digging, I discovered that many user-generated content (UGC) creators (i.e., people who create TikTok videos for brands) list their email addresses in their bios. These were my first set of target customers.
Attempt 1: Scraping the TikTok Accounts Search Tab #
I went to the TikTok accounts tab (example) to search for keywords like “ugc”, “creator” and “ugc content creators”.
It was great that many of the accounts I searched for listed their emails in the bio, making it easy to quickly scroll down the page to get what I needed.
Account Search Tab on TikTok
TikTok restricts the number of total accounts they display for any given search in the Accounts tab. Additionally, their Accounts search feature is fairly basic and only considers exact match. This made it challenging to scale the process, but I still managed to scrape 176 emails.
Thanks to the Watir library and an awesome course by Ryan Kulp, I was able to create an Account page scraper in Ruby that only took 57 lines of code.
Attempt 2: Scraping TikTok usernames from a Video Search Tab #
The next thing I did was to look at the accounts in the Videos tab of the search page.
TikTok showed me a wide variety of profiles, with videos related to my search query. Bingo! This means I can access even more profiles, as opposed to the exact match of the username I’d get in the account search tab.
Video Search Tab on TikTok
I used “ugc”, “personality”, “content” and “content creator” to scrape around 1240 unique usernames. I checked to see how many of them included an email address in their bio, and ended up with 414 emails (33% of the total). It was much better than the 10-20% I was expecting.
It’s important to note that if you open too many profiles in a short space of time, TikTok will temporarily stop displaying new pages. So be careful when scraping!
Here are 2 lines of code to get usernames from Video Search Tab in Javascript:
usernames = [];
document.querySelectorAll('[data-e2e="search-card-user-unique-id"]').forEach(div => usernames.push(div.innerText));
I am leaving out the code to scrape the bio of individual usernames from code above as an exercise 🙂 (Hint look at the Ruby code I linked in the Attempt 1).
Final Attempt: Scraping TikTok usernames via Hashtags #
TikTok has been releasing their Top Ads, i.e. the categories and types of videos that convert the best on their platform.
TikTok’s Best Performing Ads
I reasoned that the people who post in these categories get contacted by the brands to advertise the product, and therefore are more likely to list an email in the bio.
I devised some hashtags based on the categories I saw on the TikTok Top Ads page at the time: #makeuptutorial, #selfcare, #cleanbeauty, #couplestiktok, #springcleaning, #skincare, #essential, #whatsinmybag, #whatsinmypurse, #fyp, #sportsequipment, #exercise
I used the same strategy and the code to scrape the usernames and their emails, as I did in the previous attempt. I managed to scape 2,879 usernames after removing duplicates leading to a total of 1,371 email scraped (48% of the total).
Total emails scraped: 1,961. Not bad, considering it took only a few hours of work during the weekend.
Further Ideas to Scrape Even More Emails #
I had a few other ideas in mind for scraping more emails, but I didn’t get around to trying them out since I already had enough emails to do cold email outreach. I am listing them here in case anyone else wants to give them a shot.
You could look into following the accounts that the accounts you’ve already scraped follow, since the creator likely follows another creator. Unfortunately, TikTok only allows you to view the accounts people follow on the mobile app which I didn’t investigate. Should I need to investigate it, I would use ToughData to scrape TikTok followers. Their REST API simplifies the process of scraping follower information for any TikTok username.
Some accounts list “linktr.ee” or “beacons.ai” which contains the email or other contact info. Worth scraping that as well.
Cold Email Outreach #
Disclaimer, I had no experience sending cold emails, so I was trying to figure out a way to do it at scale. I wanted a software that would automate the process of sending emails in bulk and also track the results.
My first thought was to use Postmark, an email service tool that I already use for the transactional emails. Unfortunately, after sending around 200 emails, Postmark noticed that I was running a cold email campaign and temporarily paused sending on my account. Apparently, Postmark doesn’t allow cold emails to be sent through their API.
Tracking few cold emails I sent with Postmark
By sending first 200 emails, I got an early glimpse of the results. On the good side, my emails had a high open rate of 75%. Unfortunately, very few people clicked on the website I linked in the email, and I could only get two registered users (1%) from this campaign.
I didn’t want to stop at sending 200 emails, since I had 1,800 more to send emails to; so I had to find a workaround. Luckily, I stumbled upon the Yet Another Mail Merge (YAMM) extension on Google (thanks to Ryan again). It allowed me to send out mass personalized emails with Gmail, without relying on any API provider. The only limitation was the number of emails Google allowed me to send out per day. Let’s go!
I ran a cold email campaign over a few days with YAMM, using various templates. The results I got were similar to what I’d seen with Postmark: a relatively high open rate (60%), with somewhat disappointing click-throughs (2%).
As a final note, one of the replies I got gave me an idea for a better target customer.
Lessons and Next Steps #
Scraping emails from TikTok is not hard - many accounts leave their email in their bio. Most of these people will open an email if you reach out to them.
Would you like to get the spreadsheet with TikTok usernames and emails I scraped? You can download it by opening this Google Sheets link.
Would you like some help scraping this or similar information from TikTok? Reach out to me and we will figure it out.
Case Studies: In June 2023, after reading this blog post, a person reached out to me with a request to scrape thousands of emails from TikTok that match his criteria. He ended up very happy with the emails I scraped for him. I largely re-used the code above, with few modifications like scraping linktree profiles and cleaning emails with GPT-3, that I might one day write about in depth. Meanwhile, if you would like to get bunch of emails from TikTok that match your criteria don’t hesitate to reach out.
Testimonial from a happy customer who asked me to scrape bunch of emails for him matching his criteria