TikTok Comments Scraper avatar
TikTok Comments Scraper
Try for free

Pay $1.00 for 1,000 comments

View all Actors
TikTok Comments Scraper

TikTok Comments Scraper

clockworks/tiktok-comments-scraper
Try for free

Pay $1.00 for 1,000 comments

Extract TikTok comments. Just add a TikTok URL and get TikTok video and profile data: comments, URLs, numbers of shares, followers, hashtags, hearts, video, and music metadata. Export scraped data, run the scraper via API, schedule and monitor runs or integrate with other tools.

Do you want to learn more about this Actor?

Get a demo
LZ

Scraping comments from a certain date

Closed

light_zep opened this issue
2 months ago

If I have a video URL that was posted a week ago, but only want new to scrape new comments today, is there a way to filter for that in the scrape?

lukas.prusa avatar

Hi Rob, thanks for your patience and for opening this issue!

Unfortunately, since there is no way to sort comments on TikTok by date, there is no other way other than just filtering them out. While we could add this custom filter feature to this scraper, it would mostly just bloat the input, because this filtering option can simply be achieved on the output.

You can simply use an Actor to Actor integration with a utility Actor like the Merge, Dedup & Transform Datasets. In the transforming function, set this code which will filter out only dates newer than the given one:

1async (items, { Apify }) => {
2    const cutoffDate = new Date("2024-07-25"); // Your date goes here
3
4    return items.filter((item) => {
5        const itemDate = new Date(item.createTimeISO);
6        const isNewEnoughDate = itemDate.getTime() > cutoffDate.getTime();
7
8        return isNewEnoughDate
9    })
10}

I hope this helps, thanks!

We also have some issues currently with users not being able to comment/reopen on closed issues, so I will keep this open for now and feel free to close this if everything has been resolved :) Thanks and happy scraping!

LZ

light_zep

a month ago

Wonderful, Lukáš. Will give this a try. Thank you! - Rob

Developer
Maintained by Apify
Actor metrics
  • 337 monthly users
  • 34 stars
  • 99.9% runs succeeded
  • 12 days response time
  • Created in Feb 2023
  • Modified 4 days ago