# Tiktok Ads Scraper (`ayen-data/tiktok-ads-scraper`) Actor

The TikTok Ads Scraper extracts structured ad data from the advertiser details, creatives, audience targeting, impression ranges, and "paid for by" disclosures. It's built for marketers, competitive researchers, agencies, and anyone monitoring TikTok advertising.

- **URL**: https://apify.com/ayen-data/tiktok-ads-scraper.md
- **Developed by:** [Anyx Solutions](https://apify.com/ayen-data) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

![banner](https://i.ibb.co/HDNBGQqH/Screenshot-2026-06-20-at-10-19-06-PM.png)

## TikTok Ads Scraper

**Unlock the TikTok Ad Library for competitive insights, creative inspiration, and market research within minutes.**

The TikTok Ads Scraper extracts structured ad data from the [TikTok Ad Library](https://library.tiktok.com): advertiser details, creatives, audience targeting, impression ranges, and "paid for by" disclosures. It's built for marketers, competitive researchers, agencies, and anyone monitoring TikTok advertising.

### ⚡ Quick start

Search by keyword:

```json
{
  "query": "skincare sale",
  "maxPages": 1
}
````

Or search by advertiser:

```json
{
  "advertiserName": "Mallows Beauty",
  "maxPages": 1
}
```

### 🧩 Input

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `query` | string | one of `query`/`advertiserName` | — | Keyword phrase to locate ads. Use quotation marks for an exact phrase, or omit them to match words in any order. |
| `advertiserName` | string | one of `query`/`advertiserName` | — | Advertiser name to filter results by. Falls back to keyword search if no advertiser matches. |
| `maxPages` | integer | no | `1` | Number of result pages to crawl. |
| `startDate` | string | no | 2 years ago | Lower bound for the ad date range, `YYYY-MM-DD`. |
| `endDate` | string | no | 1 month ago | Upper bound for the ad date range, `YYYY-MM-DD`. |
| `country` | string | no | `all` | Country/region code to filter ads, or `all`. |
| `proxyConfiguration` | object | no | `{ "useApifyProxy": true }` | Apify proxy settings. |

When both `query` and `advertiserName` are supplied, the actor prioritizes the advertiser and falls back to the keyword query if no advertiser is found.

### 📤 Output

Each scraped ad is pushed to the dataset as one record.

#### Fields

| Field | Type | Description |
|---|---|---|
| `adId` | string | TikTok ad identifier. |
| `adTitle` | string | null | Ad name/title. |
| `adType` | string | number | null | Ad creative type (`1` text, `2` video, `3` image). |
| `adSpent` | string | number | null | Reported ad spend range. |
| `adVideoUrl` | string | null | Ad video URL. |
| `adVideoCover` | string | null | Ad video cover image URL. |
| `adStartDate` | number | string | null | First shown date. |
| `adEndDate` | number | string | null | Last shown date. |
| `advertiserId` | string | null | Advertiser business ID. |
| `advertiserName` | string | null | Advertiser name. |
| `advertiserCountry` | string | null | Advertiser registry country. |
| `adImpressions` | string | null | Total impressions range. |
| `advertiserPaidForBy` | string | null | "Paid for by" disclosure. |
| `adTotalRegions` | number | null | Number of regions targeted. |
| `adEstimatedAudience` | string | number | null | Estimated audience range. |
| `targetingByLocation` | array | Impressions broken down by location. |
| `targetingByAge` | array | Targeting broken down by age group. |
| `targetingByGender` | array | Targeting broken down by gender. |

<details><summary>Example output</summary>

```json
{
  "adId": "1750117232800785",
  "adTitle": "Mallows Beauty",
  "adType": "2",
  "adVideoUrl": "https://v16m.tiktokcdn.com/...",
  "adVideoCover": "https://p19-csp-adlib-site-sign-sg.ibyteimg.com/...",
  "adStartDate": 1668988800000,
  "adEndDate": 1672185600000,
  "advertiserId": "6916504448172819201",
  "advertiserName": "Mallows Beauty",
  "adImpressions": "10K-100K",
  "advertiserPaidForBy": "Wayflyer Limited (GBP)",
  "targetingByLocation": [{ "region": "GB", "impressions": "21K" }],
  "targetingByAge": [{ "region": "GB", "18-24": true, "25-34": true }],
  "targetingByGender": [{ "region": "GB", "female": true }]
}
```

</details>

### 💡 Use cases

- **Marketers** benchmark competitor creatives and messaging.
- **Agencies** research advertiser activity and spend ranges.
- **Researchers** analyze targeting, impressions, and ad trends.
- **Creators** find creative inspiration across brands.

### ❓ FAQ

- **What is the TikTok Ad Library?** A public database of ads served on TikTok, including advertiser, creative, and targeting details.
- **What can be scraped?** Public ads matching a keyword query or advertiser name, optionally filtered by date and region.
- **What if TikTok changes its site?** We maintain the scraper and update it when major changes affect functionality.

### 🔗 More scrapers by Anyx

- [TikTok Trending Hashtag Scraper](https://apify.com/anyxsolutions/tiktok-trending-hashtag-scraper)
- [Google Ads Scraper](https://apify.com/anyxsolutions/tiktok-trending-hashtag-scraper)
- [Youtube Channel Scraper](https://apify.com/anyxsolutions/tiktok-trending-hashtag-scraper)

### 🤝 Anyx Solutions

Anyx Solutions is an Apify Partner. We build custom scrapers and data-extraction pipelines.

Email : tantosthor@gmail.com

# Actor input Schema

## `startUrls` (type: `array`):

Paste TikTok Ad Library search URLs (for example, a https://library.tiktok.com/ads?... link with region, dates, advertiser, and sort). Each URL is scraped as its own search with its own filters. When provided, the query, advertiser name, country, dates, and sort fields below are ignored.

## `query` (type: `string`):

Keywords to search for in the TikTok Ad Library. Wrap a phrase in quotation marks (for example, "red shoe sale") to match that exact sequence, or leave the quotes off to return ads containing the words in any order. Provide either a search query or an advertiser name.

## `advertiserName` (type: `string`):

Name of the advertiser whose ads you want to collect. Provide either a search query or an advertiser name.

## `adIds` (type: `array`):

Collect specific ads by their TikTok Ad Library ID. When provided, the search query and advertiser name are ignored.

## `quickSearch` (type: `boolean`):

Return only the data available on the search results list (creative, dates, audit status) without fetching each ad's full details. Much faster, but omits advertiser and targeting data.

## `sortBy` (type: `string`):

Order in which results are returned.

## `maxItems` (type: `integer`):

Maximum number of ads to collect per run. Leave empty to collect every ad across the crawled pages.

## `maxPages` (type: `integer`):

Maximum number of result pages to crawl per run. Each page returns up to 12 ads.

## `startDate` (type: `string`):

Only include ads shown on or after this date (format: YYYY-MM-DD). Defaults to one year ago when left empty.

## `endDate` (type: `string`):

Only include ads shown on or before this date (format: YYYY-MM-DD). Defaults to today when left empty.

## `timezone` (type: `string`):

IANA timezone (for example, "America/New\_York") used to interpret the start and end dates. Defaults to UTC.

## `country` (type: `string`):

Two-letter country code used to filter ads, or "all" to include every supported country. Defaults to "all".

## `proxyConfiguration` (type: `object`):

Apify proxy settings used for the run.

## Actor input object example

```json
{
  "query": "skincare sale",
  "quickSearch": false,
  "sortBy": "last_shown_date,desc",
  "maxPages": 1,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "skincare sale"
};

// Run the Actor and wait for it to finish
const run = await client.actor("ayen-data/tiktok-ads-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "query": "skincare sale" }

# Run the Actor and wait for it to finish
run = client.actor("ayen-data/tiktok-ads-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "skincare sale"
}' |
apify call ayen-data/tiktok-ads-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=ayen-data/tiktok-ads-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Tiktok Ads Scraper",
        "description": "The TikTok Ads Scraper extracts structured ad data from the advertiser details, creatives, audience targeting, impression ranges, and \"paid for by\" disclosures. It's built for marketers, competitive researchers, agencies, and anyone monitoring TikTok advertising.",
        "version": "1.0",
        "x-build-id": "qqvTkW8g1TvTdaRfm"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ayen-data~tiktok-ads-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ayen-data-tiktok-ads-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/ayen-data~tiktok-ads-scraper/runs": {
            "post": {
                "operationId": "runs-sync-ayen-data-tiktok-ads-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/ayen-data~tiktok-ads-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-ayen-data-tiktok-ads-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "Paste TikTok Ad Library search URLs (for example, a https://library.tiktok.com/ads?... link with region, dates, advertiser, and sort). Each URL is scraped as its own search with its own filters. When provided, the query, advertiser name, country, dates, and sort fields below are ignored.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "query": {
                        "title": "Search query",
                        "type": "string",
                        "description": "Keywords to search for in the TikTok Ad Library. Wrap a phrase in quotation marks (for example, \"red shoe sale\") to match that exact sequence, or leave the quotes off to return ads containing the words in any order. Provide either a search query or an advertiser name."
                    },
                    "advertiserName": {
                        "title": "Advertiser name",
                        "type": "string",
                        "description": "Name of the advertiser whose ads you want to collect. Provide either a search query or an advertiser name."
                    },
                    "adIds": {
                        "title": "Ad IDs",
                        "type": "array",
                        "description": "Collect specific ads by their TikTok Ad Library ID. When provided, the search query and advertiser name are ignored.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "quickSearch": {
                        "title": "Quick search (list only)",
                        "type": "boolean",
                        "description": "Return only the data available on the search results list (creative, dates, audit status) without fetching each ad's full details. Much faster, but omits advertiser and targeting data.",
                        "default": false
                    },
                    "sortBy": {
                        "title": "Sort by",
                        "enum": [
                            "last_shown_date,desc",
                            "last_shown_date,asc",
                            "create_time,desc",
                            "create_time,asc",
                            "impression,desc",
                            "impression,asc"
                        ],
                        "type": "string",
                        "description": "Order in which results are returned.",
                        "default": "last_shown_date,desc"
                    },
                    "maxItems": {
                        "title": "Maximum items",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of ads to collect per run. Leave empty to collect every ad across the crawled pages."
                    },
                    "maxPages": {
                        "title": "Maximum pages",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of result pages to crawl per run. Each page returns up to 12 ads.",
                        "default": 1
                    },
                    "startDate": {
                        "title": "Start date",
                        "type": "string",
                        "description": "Only include ads shown on or after this date (format: YYYY-MM-DD). Defaults to one year ago when left empty."
                    },
                    "endDate": {
                        "title": "End date",
                        "type": "string",
                        "description": "Only include ads shown on or before this date (format: YYYY-MM-DD). Defaults to today when left empty."
                    },
                    "timezone": {
                        "title": "Timezone",
                        "type": "string",
                        "description": "IANA timezone (for example, \"America/New_York\") used to interpret the start and end dates. Defaults to UTC."
                    },
                    "country": {
                        "title": "Country",
                        "enum": [
                            "all",
                            "FR",
                            "AT",
                            "BE",
                            "BG",
                            "HR",
                            "CY",
                            "CZ",
                            "DK",
                            "EE",
                            "FI",
                            "DE",
                            "GR",
                            "HU",
                            "IS",
                            "IE",
                            "IT",
                            "LV",
                            "LI",
                            "LT",
                            "LU",
                            "MT",
                            "NL",
                            "NO",
                            "PL",
                            "PT",
                            "RO",
                            "SK",
                            "SI",
                            "ES",
                            "SE",
                            "CH",
                            "GB"
                        ],
                        "type": "string",
                        "description": "Two-letter country code used to filter ads, or \"all\" to include every supported country. Defaults to \"all\"."
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify proxy settings used for the run.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
