# How to get TikTok Creative Center top ads by API

> Search TikTok Creative Center Top Ads by keyword, country and time window, then read one brand's ads in TikTok's Ads Library: parameters, code and what a run costs.

Canonical page: https://okdata.online/guides/tiktok-creative-center-top-ads/

Two endpoints, in this order: TikTok Creative Center top ads to see which ads in a category did well, then TikTok Ads Library search for the ads one of those brands showed in Europe. The worked example is 4 calls and costs $0.012; a failed call is not charged.

Updated 2026-11-12

The job: you are writing the next creative brief for a category and want two views of TikTok advertising. The Creative Center's Top Ads is TikTok's showcase of ads that performed, with likes and click-through rate but no run dates. The Ads Library is the transparency record of ads shown in Europe, with run dates and a reach bracket but no performance figures. Use the showcase to find the hooks and brands worth studying, then open one brand's record to see how many ads it runs and for how long.

You end with two tables: top creatives with their metrics, and one advertiser's ad history. No TikTok account or login is involved; each call is an HTTPS request with your key.

## Step by step

### Step 1: search the Creative Center top ads

Call [TikTok Creative Center top ads](https://okdata.online/apis/tiktok/creative_center/ads/search/) with a `query`. Three parameters shape the result:

- `country`: an ISO country code, `US` by default. The UK is `GB`.
- `window`: how many days to look back, `7`, `30` (the default) or `180`.
- `sort`: `relevance` (the default) or `likes`.

One call returns up to 20 ads for $0.002. Each ad has `id`, the caption in `text`, the brand in `advertiser.name`, the video in `videos`, the cover image in `images` and the Creative Center page in `url`. Add `view=full` and each ad also carries `ext.likes`, `ext.ctr`, `ext.budget_level`, `ext.objective`, `ext.industry` and `ext.duration_seconds`. The price does not change.

```bash
curl -G "https://api.okdata.online/v1/tiktok/creative_center/ads/search" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'query=sunscreen' \
  -d country=GB -d window=7 -d sort=likes -d view=full
```

For the second page, send `page.next_cursor` back as `cursor`, unchanged. Stop when `page.has_more` is `false`.

### Step 2: open one brand's record in the Ads Library

Count the brands in step 1 and pick the one you want to study. Pass its name to [TikTok Ads Library search](https://okdata.online/apis/tiktok/ads/search/) as `advertiser`, or search the library by keywords with `query`. Give one of the two, not both: both or neither is answered with `invalid_params`, which is not charged.

One call returns up to 12 ads for $0.004. Each ad has `advertiser.name`, the ad's title in `text`, `videos` and `images`, `first_shown_at` and `last_shown_at`, `reach` as the library's bracket of people reached (such as `10K-100K`), and the library page in `url`. With `view=full` you also get `ext.subject`, the library's category for the ad.

```bash
curl -G "https://api.okdata.online/v1/tiktok/ads/search" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'advertiser=Sunday Shield Ltd'
```

The name that works here is the one the library files the ads under, often a company name. If `advertiser` finds nothing, search with `query` set to the brand and keep the rows whose `advertiser.name` matches.

### Step 3: both steps in Python

```python
import collections
import csv
import os
import requests

API = "https://api.okdata.online"
HEADERS = {"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"}
PAGES = 2  # pages per step; each page is one call


def pages(path, params):
    cursor = None
    for _ in range(PAGES):
        body = requests.get(API + path, headers=HEADERS, params={**params, **({"cursor": cursor} if cursor else {})}, timeout=60).json()
        if body["code"] != "ok":
            raise RuntimeError(f"{body['code']}: {body['message']} (charged: {body['charged']})")
        yield from body["data"]["items"]
        if not body["page"]["has_more"]:
            return
        cursor = body["page"]["next_cursor"]


top = list(pages("/v1/tiktok/creative_center/ads/search", {"query": "sunscreen", "country": "GB", "window": "7", "sort": "likes", "view": "full"}))
with open("top_ads.csv", "w", newline="", encoding="utf-8") as f:
    out = csv.writer(f)
    out.writerow(["id", "brand", "caption", "likes", "ctr", "budget_level", "url"])
    for a in top:
        out.writerow([a["id"], a["advertiser"]["name"], a["text"], a["ext"]["likes"], a["ext"]["ctr"], a["ext"]["budget_level"], a["url"]])

brands = collections.Counter(a["advertiser"]["name"] for a in top if a["advertiser"]["name"])
brand = brands.most_common(1)[0][0]
with open("brand_ads.csv", "w", newline="", encoding="utf-8") as f:
    out = csv.writer(f)
    out.writerow(["id", "advertiser", "title", "first_shown", "last_shown", "reach", "url"])
    for a in pages("/v1/tiktok/ads/search", {"advertiser": brand}):
        out.writerow([a["id"], a["advertiser"]["name"], a["text"], a["first_shown_at"], a["last_shown_at"], a["reach"], a["url"]])
```

## Good to know

- **A showcase, not a census.** Top Ads is TikTok's own selection. A brand missing from it can still be spending a lot; the Ads Library is the place to check what a brand actually ran.
- **Europe only in the library.** The Ads Library records ads shown in Europe. A brand that advertises only in the US may have nothing there.
- **What is null.** Creative Center ads have no run dates, landing page, reach or advertiser ID, so those fields are null and named in `meta.unavailable`. The brand name can be empty when the Creative Center shows none. `ext.objective` and `ext.industry` come as TikTok's own keys, such as `campaign_objective_traffic`.
- **Treat CTR and budget level as signals.** They rank creatives against each other inside the Creative Center. Plan budgets on your own numbers.
- **Save the videos you keep.** Video links point at TikTok's servers and can stop working, so download keepers on the day you collect them.
- **Retries without paying twice.** Send an `Idempotency-Key` header with each call. The same request with the same key within 24 hours returns the stored answer with `meta.replayed: true` and no new charge.

For the question of whether TikTok offers an API for this at all, see [the Creative Center top ads answer](https://okdata.online/answers/tiktok-creative-center-top-ads-api/). To watch one competitor across Meta, Google and TikTok, see [competitor ads on three libraries](https://okdata.online/answers/competitor-ads-meta-google-tiktok/).

## What the example costs

Two pages of Creative Center top ads for sunscreen in the UK over the last 7 days, sorted by likes, then two Ads Library pages for the brand that shows up most

| Endpoint | Calls | Price | Subtotal |
|---|---|---|---|
| [TikTok Creative Center top ads](https://okdata.online/apis/tiktok/creative_center/ads/search/) | 2 | $0.002 | $0.004 |
| [TikTok Ads Library search](https://okdata.online/apis/tiktok/ads/search/) | 2 | $0.004 | $0.008 |
| Total | 4 |  | $0.012 |

Prices in force when this page was built. A failed call costs nothing.

## In your AI (MCP)

Connect the MCP server once, then say what you want. The agent finds these endpoints, reads their prices and calls them on your balance.

Say: Find the TikTok Creative Center top ads for sunscreen in the UK over the last 7 days, sorted by likes, two pages, with likes and CTR. Then take the brand that appears most often and list its ads in the TikTok Ads Library, two pages, with first and last day shown and the reach bracket.

```json
{
  "endpoint": "tiktok.creative_center.ads.search",
  "params": {
    "query": "coffee"
  },
  "idempotency_key": "<a new UUID>"
}
```

MCP: `https://api.okdata.online/mcp`

## Endpoints in this guide

- [TikTok Creative Center top ads](https://okdata.online/apis/tiktok/creative_center/ads/search/) `tiktok.creative_center.ads.search`: $0.002 per call · about 20 ads per page
- [TikTok Ads Library search](https://okdata.online/apis/tiktok/ads/search/) `tiktok.ads.search`: $0.004 per call · about 12 ads per page

## More about TikTok

- [TikTok API](https://okdata.online/apis/tiktok/)
- [TikTok comments in Python for sentiment analysis (2026)](https://okdata.online/guides/tiktok-comments-python/)
- [How to collect TikTok Shop product reviews by keyword](https://okdata.online/guides/tiktok-shop-product-reviews/)
- [How do I see all the ads a competitor is running on Meta, Google and TikTok?](https://okdata.online/answers/competitor-ads-meta-google-tiktok/)
- [Is there an API for TikTok Creative Center Top Ads?](https://okdata.online/answers/tiktok-creative-center-top-ads-api/)
- [How long should I cache social media API results to avoid paying twice?](https://okdata.online/answers/cache-social-media-api-results/)
- [How do I choose between social media data API vendors?](https://okdata.online/answers/choose-social-media-data-api-vendor/)
- [How do I compare data API prices quoted per call, per result, per credit or per GB?](https://okdata.online/answers/compare-data-api-pricing-units/)
- [How much does it cost to look up follower counts for 1,000 creators?](https://okdata.online/answers/creator-profile-lookup-cost/)
- [Official platform APIs vs third-party data APIs (2026)](https://okdata.online/compare/official-apis-vs-data-apis/)
- [How to choose a social media data API (2026)](https://okdata.online/compare/social-media-data-apis/)
- [Ad search API](https://okdata.online/roles/ads-search/)
