
Tiktok Search Scraper
- epctex/tiktok-search-scraper
- Modified
- Users 263
- Runs 11.6k
- Created by
epctex
Unleash the power of data extraction with our advanced TikTok Search Scraper. Gather videos, hashtags, posts, URLs, share numbers, followers, hearts, names, music-related data, and more. Download data in various formats including HTML, JSON, CSV, Excel, or XML.
To run the code examples, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token. For a more detailed explanation, please read about running Actors via the API in Apify Docs.
from apify_client import ApifyClient
# Initialize the ApifyClient with your API token
client = ApifyClient("<YOUR_API_TOKEN>")
# Prepare the Actor input
run_input = {
"search": [
"anime",
"tiktok",
],
"startUrls": [
"https://www.tiktok.com/search?q=music&t=1670685477846",
"https://www.tiktok.com/search?q=dance&t=1670685484412",
"https://www.tiktok.com/search?q=challenge&t=1670685494590",
],
"maxItems": 10,
"endPage": 1,
"extendOutputFunction": "($) => { return {} }",
"customMapFunction": "(object) => { return {...object} }",
"proxy": { "useApifyProxy": True },
}
# Run the Actor and wait for it to finish
run = client.actor("epctex/tiktok-search-scraper").call(run_input=run_input)
# Fetch and print Actor results from the run's dataset (if there are any)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)