For AI

Endpoints by data type

Ad search API

3 endpoints on 2 platforms return ads as the same Ad object. Ads in public ad libraries that match a keyword or an advertiser name, a page at a time: advertiser, copy, images or video, landing page, where they run and since when. A call costs from $0.002 to $0.004, each endpoint at its own price; a failed call is free.

Ad search · on each platform

PlatformEndpointPathA pagePrice
Meta Ad LibraryMeta Ad Library searchGET /v1/meta/ads/search30$0.004 per call · about 30 ads per page
TikTokTikTok Ads Library searchGET /v1/tiktok/ads/search12$0.004 per call · about 12 ads per page
TikTokTikTok Creative Center top adsGET /v1/tiktok/creative_center/ads/search20$0.002 per call · about 20 ads per page

from $0.002 to $0.004 a call, each endpoint at its own price. A call that fails costs nothing.

The object it returns: Ad

Every endpoint above returns these fields with the same names and types. A field a platform does not show comes back null and is named in meta.unavailable.

FieldTypeMeaning
idstringAd ID in the library.
urlstringLink to the ad in the library.
advertiserAdvertiserRefWho runs the ad.
titlestring | nullHeadline, where the ad has one.
textstringAd copy as plain text; empty when the ad has none.
formatstring | nullCreative format; dynamic means the platform assembles it per viewer (catalog ads).
imagesstring[] | nullImage URLs of the creative.
videosstring[] | nullVideo URLs of the creative.
landing_urlstring | nullWhere the ad leads.
ctastring | nullCall-to-action button text.
platformsstring[] | nullWhere it is delivered, e.g. facebook, instagram.
activeboolean | nullWhether the ad is still running.
first_shown_atstring | nullFirst time or day shown, ISO 8601 in UTC.
last_shown_atstring | nullLast time or day shown, ISO 8601 in UTC.
reachstring | nullPeople reached, as the library publishes it: a bracket such as 1K-10K, or a count (the EU reach of a Meta ad); null where none is published.
extobjectPlatform-specific extras. Only returned with view=full.

The same call on two platforms

Same parameters, same paging, same response shape. Only the path changes.

cURL
# Meta Ad Library
curl -G "https://api.okdata.online/v1/meta/ads/search" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'query=portable espresso'

# TikTok
curl "https://api.okdata.online/v1/tiktok/ads/search" \
  -H "Authorization: Bearer $OKDATA_API_KEY"

What people use it for

  • See which brands advertise on a keyword such as a product category.
  • Build a swipe file of the ads in your niche.
  • Find out how long competitors keep the same creative running.

Questions

Do these cover every ad?
The Meta Ad Library and TikTok’s Ads Library are transparency records, each within its own rules on regions and ad types. TikTok’s Creative Center is a showcase of ads that did well, not every ad, and has no run dates.
Can I filter by country?
Meta search and Creative Center search take a country. TikTok’s Ads Library covers ads shown in Europe. The parameters are on each endpoint page.
Can I download the creative?
images and videos hold the media URLs wherever the library exposes them. Save the files on your side if you need them later.

Connect once, then just ask.

Every new key comes with $0.10 to try it. One sentence connects your agent.

Start free
Connect your AI

Paste this into your agent

Read https://okdata.online/agents.md and set up okdata for me; my key is in the OKDATA_API_KEY environment variable.

Claude Code, Cursor, Codex and other agents that can open a link set themselves up from it.

MCP serverhttps://api.okdata.online/mcp