Docs menu

TikTok Ad Library ad details

Beta GET /v1/tiktok/ad-library/ad

GET /v1/tiktok/ad-library/ad

One ad from TikTok's European Ads Library: the creative, the advertiser (business id, registry country) and the targeting with impressions by region, age and gender, as the library shows them.

  • Cost: 1 credit
  • Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
idstringone ofAd id in the library. Also accepted as ad_id, adId.
urlURLone ofAd URL (library.tiktok.com/ads/detail/?ad_id=...). Accepted hosts: library.tiktok.com, tiktok.com.

Send at least one of id, url. If you send several, the first listed is used and the rest are ignored.

Every request also accepts:

  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

curl
curl -G "https://api.socialscrape.io/v1/tiktok/ad-library/ad" \
  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \
  --data-urlencode "id=1879687389944914"
Python
import os
import requests

params = {
    "id": "1879687389944914",
}
res = requests.get(
    "https://api.socialscrape.io/v1/tiktok/ad-library/ad",
    headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
    params=params,
)
body = res.json()

if body["ok"]:
    print(body["data"])
else:
    print(body["error"]["code"], body["error"]["message"])
TypeScript
const url = new URL("https://api.socialscrape.io/v1/tiktok/ad-library/ad");
url.search = new URLSearchParams({
  "id": "1879687389944914"
}).toString();
const res = await fetch(url, {
  headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();

if (body.ok) {
  console.log(body.data);
} else {
  console.error(body.error.code, body.error.message);
}
n8n
{
  "nodes": [
    {
      "name": "SocialScrape TikTok Ad Library ad details",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "method": "GET",
        "url": "https://api.socialscrape.io/v1/tiktok/ad-library/ad",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "id",
              "value": "1879687389944914"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
            }
          ]
        }
      }
    }
  ],
  "connections": {}
}

Example response#

This is a sample from a recorded response, lists and long text are shortened. Status 200.

{
  "ok": true,
  "credits_charged": 1,
  "credits_remaining": 4999,
  "cached": false,
  "cached_at": null,
  "request_id": "req_3459c1698f912ff48eaffd66",
  "data": {
    "object": "ad",
    "platform": "tiktok",
    "id": "1879687389944914",
    "url": "https://library.tiktok.com/ads/detail/?ad_id=1879687389944914",
    "advertiser": {
      "object": "advertiser",
      "platform": "tiktok",
      "id": "6876453732930814722",
      "name": "GYMSHARK LTD",
      "url": null,
      "page_id": null,
      "country": null,
      "verified": null,
      "ad_count": null,
      "extra": null
    },
    "status": "unknown",
    "started_at": "2026-10-21T00:00:00Z",
    "ended_at": null,
    "title": null,
    "body": null,
    "cta_text": null,
    "landing_url": null,
    "format": "video",
    "media": {
      "thumbnail_url": "https://p16-common-sign.tiktokcdn.com/tos-alisg-p-0051c001-sg/oEmm9Mihr4XDjgoIB65BvIwEBfAhiAAHPA11FI~tplv-tiktokx-origin.jpeg?dr=14582&refresh_token=b88f0181&x-expires=1793347200&x-signature=P4xxeIHW0DvN6tY7p6w6zsjhlTQ%3D&t=4d5b0474&ps=1374...",
      "video_url": "https://library.tiktok.com/api/v1/cdn/1793325957/video/aHR0cHM6Ly92NzcudGlrdG9rY2RuLmNvbS9hNWZiNTFhNzg4ZDJmNWVkMjYxNjU1MTVlOGQ2ODU3NS82YWU0NGZmMC92aWRlby90b3MvdXNlYXN0MmEvdG9zLXVzZWFzdDJhLXZlLTAwNTFjNzk5LWV1dHRwL29jeEluOEFZcEZlVjhmNHZnZWp2V...",
      "audio_url": null,
      "image_urls": [
        "https://p16-common-sign.tiktokcdn.com/tos-alisg-p-0051c001-sg/oEmm9Mihr4XDjgoIB65BvIwEBfAhiAAHPA11FI~tplv-tiktokx-origin.jpeg?dr=14582&refresh_token=b88f0181&x-expires=1793347200&x-signature=P4xxeIHW0DvN6tY7p6w6zsjhlTQ%3D&t=4d5b0474&ps=1374..."
      ],
      "width": null,
      "height": null
    },
    "regions": null,
    "publisher_platforms": null,
    "impressions": {
      "lower": 1000.0,
      "upper": 10000.0,
      "currency": null
    },
    "spend": null,
    "extra": {
      "advertiser_registry_location": "United Kingdom",
      "audit_status": "1",
      "estimated_audience": "1K-10K",
      "impression": 0,
      "last_shown_at": "2026-10-28T00:00:00Z",
      "show_mode": 1,
      "sor_audit_status": "1",
      "sponsor": "GYMSHARK LTD",
      "targeting": {
        "age": [
          {
            "13-17": false,
            "18-24": true,
            "25-34": true,
            "35-44": false,
            "45-54": false,
            "55+": false,
            "region": "GB"
          }
        ],
        "audience": "No",
        "gender": [
          {
            "female": true,
            "male": false,
            "region": "GB",
            "unknown": false
          }
        ],
        "location": {
          "data": [
            {
              "breakdowns": [],
              "impressions": "4K",
              "region": "GB"
            }
          ],
          "total_impressions": "1K-10K",
          "total_region": 1
        },
        "target_audience_size": "7.1M-8.7M"
      }
    }
  },
  "cursor": null,
  "has_more": null
}

Response#

A Ad object in data.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
unsupported_url400noThe URL is not one this endpoint accepts (wrong platform or form).
not_found404noThe platform says this profile, post or item does not exist.

Every request can also fail with the account and platform errors listed on the Errors page.

Example error:

{
  "ok": false,
  "error": {
    "code": "not_found",
    "message": "The platform says this profile, post or item does not exist.",
    "retryable": false
  },
  "credits_charged": 0,
  "request_id": "req_b5122697bfb1f6fce3d04c09"
}