TikTok Ads Library Scraper
Pricing
from $4.99 / 1,000 results
Go to Apify Store
TikTok Ads Library Scraper
Scrapes TikTok Ads Library (library.TikTok.com/ads) for ad creatives, advertiser details, engagement metrics, and video URLs.
Pricing
from $4.99 / 1,000 results
Rating
0.0
(0)
Developer
codingfrontend
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
Apify actor to scrape ad creatives, advertiser details, engagement metrics, and video URLs from the TikTok Ads Library.
Features
- Search TikTok Ads Library by keyword or brand name
- Filter ads by country/region
- Extract ad text, advertiser names, dates, platform, and engagement metrics
- Capture direct video URLs for ad creatives
- Automatic scrolling and "Load More" handling
- Proxy support for reliable scraping
Input
| Field | Type | Default | Description |
|---|---|---|---|
query | string | "fitness" | Keyword or phrase to search for |
country | string | "DE" | ISO 3166-1 alpha-2 country code for EU/EEA countries only. TikTok Ads Library is limited to European Economic Area (e.g. DE, FR, GB, IT, ES, NL, PL, AT). US/IN/AU are not supported. |
maxItems | integer | 50 | Maximum number of ads to scrape (1–1000) |
proxyConfiguration | object | Apify Proxy | Proxy settings for the browser |
Example Input
{"query": "fitness","country": "DE","maxItems": 10}
Output
Each scraped ad contains:
| Field | Type | Description |
|---|---|---|
position | integer | Position/rank in search results |
advertiserName | string | Name of the advertiser running the ad |
adText | string | Text/caption content of the ad creative |
firstShown | string | Date when the ad was first displayed |
lastShown | string | Date when the ad was last displayed |
platform | string | Platform(s) where the ad was shown (e.g. TikTok, Pangle) |
link | string | Destination URL or detail page link |
videoUrl | string | Direct URL to the ad video creative |
likes | string | Number of likes/reactions on the ad |
scrapedAt | string | ISO timestamp of when the data was scraped |
Example Output
{"position": 1,"advertiserName": "FitGear Pro","adText": "Transform your workout with our new resistance bands!","firstShown": "Dec 10, 2024","lastShown": "Jan 5, 2025","platform": "TikTok","link": "https://library.tiktok.com/ads/detail/12345","videoUrl": "https://v16-webapp-prime.tiktok.com/video/example.mp4","likes": "1.2K","scrapedAt": "2025-01-15T10:30:00.000Z"}
Usage
Apify Console
- Go to the actor's page on Apify Console
- Set the input parameters
- Click "Start"
API
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: 'YOUR_TOKEN' });const run = await client.actor('your-username/tiktok-ads-library-scraper').call({query: 'fitness',country: 'DE',maxItems: 50,});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items);
Local Development
npm installnpm start
Project Structure
src/├── main.js # Actor entry point — reads input, configures crawler├── constants.js # Shared constants (URLs, selectors, limits)├── routes.js # Crawler route handlers (SEARCH)└── utils/├── extraction.js # Ad data extraction from page DOM├── browser.js # Consent banners, country filter, search input helpers└── scrolling.js # Load-more / infinite scroll helpers