TikTok Ads Library Scraper avatar

TikTok Ads Library Scraper

Pricing

from $4.99 / 1,000 results

Go to Apify Store
TikTok Ads Library Scraper

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

codingfrontend

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

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

FieldTypeDefaultDescription
querystring"fitness"Keyword or phrase to search for
countrystring"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.
maxItemsinteger50Maximum number of ads to scrape (1–1000)
proxyConfigurationobjectApify ProxyProxy settings for the browser

Example Input

{
"query": "fitness",
"country": "DE",
"maxItems": 10
}

Output

Each scraped ad contains:

FieldTypeDescription
positionintegerPosition/rank in search results
advertiserNamestringName of the advertiser running the ad
adTextstringText/caption content of the ad creative
firstShownstringDate when the ad was first displayed
lastShownstringDate when the ad was last displayed
platformstringPlatform(s) where the ad was shown (e.g. TikTok, Pangle)
linkstringDestination URL or detail page link
videoUrlstringDirect URL to the ad video creative
likesstringNumber of likes/reactions on the ad
scrapedAtstringISO 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

  1. Go to the actor's page on Apify Console
  2. Set the input parameters
  3. 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 install
npm 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