> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mindcase.co/llms.txt
> Use this file to discover all available pages before exploring further.

# TikTok Ads API

> TikTok ads from the Ad Library with advertiser, paid-by entity, ad copy and CTA text. Search by keyword or advertiser, or pass ad URLs.

`POST /v1/data/tiktok/ads/run`

**Pricing:** $0.002 per ad ($2.00 per 1,000).

## Ways to call it

* **Search Query**: set `query` (optional: `country`, `maxResults`)
* **Advertiser**: set `advertiser` (optional: `country`, `maxResults`)
* **URLs**: set `urls` (optional: `country`, `maxResults`)

## Request

Send the inputs under `params`. Only the keys below are accepted; any other key returns `422 invalid_params`.

**query** `string`

Search Query.

**advertiser** `string`

Advertiser.

**urls** `string[]`

One or more urls. One request reads them all.

**country** `string` (default: DE)

Country whose TikTok Ad Library to search. TikTok publishes its ad library only for the EU/EEA, Switzerland and the United Kingdom. Germany (DE) by default. Example: France (FR).

32 allowed values, for example `AT` (Austria), `BE` (Belgium), `BG` (Bulgaria), `HR` (Croatia), `CY` (Cyprus), `CZ` (Czech Republic), `DK` (Denmark), `EE` (Estonia), `FI` (Finland), `FR` (France). Fetch the full list with `GET /v1/data/tiktok/ads?expand=options`.

**maxResults** `integer` (default: 100)

How many ads to return in total. Defaults to 100; use 0 for all.

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/tiktok/ads/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "urls": [
      "https://library.tiktok.com/ads?region=DE&start_time=1790899200000&end_time=1793577599000&adv_name=nike&adv_biz_ids=&query_type=1&sort_type=last_shown_date%2Cdesc"
    ],
    "maxResults": 10
  }
}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://api.mindcase.co/v1/data/tiktok/ads/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "urls": [
        "https://library.tiktok.com/ads?region=DE&start_time=1790899200000&end_time=1793577599000&adv_name=nike&adv_biz_ids=&query_type=1&sort_type=last_shown_date%2Cdesc"
    ],
    "maxResults": 10
}},
)
job = r.json()
rows = job.get("data", [])  # if job["status"] == "running", poll /v1/jobs/{job_id}/results
```

```javascript Node.js theme={null}
const r = await fetch("https://api.mindcase.co/v1/data/tiktok/ads/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "urls": [
    "https://library.tiktok.com/ads?region=DE&start_time=1790899200000&end_time=1793577599000&adv_name=nike&adv_biz_ids=&query_type=1&sort_type=last_shown_date%2Cdesc"
  ],
  "maxResults": 10
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
```

## Response fields

Each row in `data` is one ad, keyed by these fields.

| Field | Name | Type |
| - | - | - |
| `adId` | Ad ID | text |
| `adUrl` | Ad URL | url |
| `advertiserName` | Advertiser Name | text |
| `advertiserId` | Advertiser ID | text |
| `paidBy` | Paid By | text |
| `body` | Body | text |
| `ctaText` | CTA Text | text |
| `clickUrl` | Click URL | url |
| `objective` | Objective | text |
| `startDate` | Start Date | datetime |
| `endDate` | End Date | datetime |
| `daysActive` | Days Active | number |
| `reach` | Reach | object |
| `reachBreakdown` | Reach Breakdown | object\_array |
| `targeting` | Targeting | object |
| `advertiser` | Advertiser | object |
| `mediaUrl` | Media URL | url |
| `videos` | Videos | object\_array |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "tiktok/ads",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "reachBreakdown": [
        {
          "regionCode": "DE",
          "impressions": 413000,
          "reach": {
            "lowerBound": 413000,
            "upperBound": 413000
          },
          "breakdowns": [
            {
              "age": "18-24",
              "gender": "MALE",
              "reach": {
                "lowerBound": 50000,
                "upperBound": 50000
              }
            },
            {
              "age": "18-24",
              "gender": "FEMALE",
              "reach": {
                "lowerBound": 113000,
                "upperBound": 113000
              }
            },
            {
              "age": "18-24",
              "gender": "UNKNOWN",
              "reach": {
                "lowerBound": 0,
                "upperBound": 1000
              }
            }
          ]
        }
      ],
      "objective": "Traffic",
      "startDate": "2026-10-20T00:00:00.000Z",
      "paidBy": "INITIATIVE MEDIA B.V.",
      "ctaText": "Learn more",
      "videos": [
        {
          "url": "https://library.tiktok.com/api/v1/cdn/1793536461/video/aHR0cHM6Ly92MTZtLnRpa3Rva2Nkbi5jb20vYTYwMzdlNDU5OWE5N2E0NDFiNGMyZjMxZDVhMDkyYTAvNmFlNzg2M2IvdmlkZW8vdG...",
          "coverImageUrl": "https://p16-common-sign.tiktokcdn.com/ad-site-i18n-sg/20261013c7c72a61615657cc4f6482cd~tplv-tiktokx-origin.jpeg?dr=14582&refresh_token=f4e4e879&x-expires=179..."
        }
      ],
      "endDate": "2026-10-31T00:00:00.000Z",
      "advertiserName": "NIKE Retail B.V.",
      "adId": "1879578146577714",
      "adUrl": "https://library.tiktok.com/ads/detail/?ad_id=1879578146577714",
      "clickUrl": "https://www.nike.com/de/retail?cp=38925767129_soc_CR175KY863WU",
      "advertiser": {
        "username": "nike",
        "displayName": "Nike",
        "avatarUrl": "https://p16-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:168:168.jpeg?dr=9638&refresh_token=...",
        "followersCount": 9300000,
        "profileUrl": "https://www.tiktok.com/share/user/208464585232822272?source=ad_review"
      },
      "reach": {
        "lowerBound": 400000,
        "upperBound": 500000
      },
      "advertiserId": "6876453864464188162",
      "body": "Neue Winterausrüstung in Nike Factory Stores.",
      "daysActive": 12,
      "targeting": {
        "audienceSize": {
          "lowerBound": 15200000,
          "upperBound": 18600000
        },
        "firstPartyAudience": false,
        "interests": [],
        "videoInteractions": null,
        "creatorInteractions": null,
        "languages": [],
        "highSpendingPower": false,
        "devices": [],
        "operatingSystems": [
          "ALL"
        ],
        "regions": [
          {
            "ageRanges": [
              "18-24",
              "25-34",
              "35-44"
            ],
            "genders": [
              "female",
              "male",
              "unknown"
            ],
            "regionCode": "DE"
          }
        ]
      },
      "mediaUrl": "https://library.tiktok.com/api/v1/cdn/1793536461/video/aHR0cHM6Ly92MTZtLnRpa3Rva2Nkbi5jb20vYTYwMzdlNDU5OWE5N2E0NDFiNGMyZjMxZDVhMDkyYTAvNmFlNzg2M2IvdmlkZW8vdG..."
    }
  ]
}
```

## Related APIs

For Meta ads use [`facebook/ads`](https://docs.mindcase.co/apis/facebook/ads); for Google ads use [`google-ads/ads`](https://docs.mindcase.co/apis/google-ads/ads); for LinkedIn ads use [`linkedin/ads-library`](https://docs.mindcase.co/apis/linkedin/ads-library).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.