A common starting point for competitive research: pick a brand you care about, then watch what they're shipping right now. This recipe takes two calls — one to look up the brand ID, one to fetch its newest active video ads.
Endpoints used
GET /open/v1/brand-library/search— find a brand by name across the public ad librariesGET /open/v1/brand-library/{brand_id}/ads— ads from a single brand
New to the API? Read the Quickstart for auth and the response envelope.
Step 1 — Find the brand ID
GET /brand-library/search takes a keyword (case-insensitive substring match) and returns matching brands across the supported ad libraries:
curl -sS \
-H "X-API-Key: $ATRIA_API_KEY" \
"https://api.tryatria.com/open/v1/brand-library/search?keyword=acme&page_size=5"import os
import requests
resp = requests.get(
"https://api.tryatria.com/open/v1/brand-library/search",
headers={"X-API-Key": os.environ["ATRIA_API_KEY"]},
params={"keyword": "acme", "page_size": 5},
timeout=30,
)
resp.raise_for_status()
for b in resp.json()["data"]["items"]:
print(b["id"], b["name"], f"({b.get('source_library')}, {b['ad_num']} ads)")const url = new URL("https://api.tryatria.com/open/v1/brand-library/search");
url.searchParams.set("keyword", "acme");
url.searchParams.set("page_size", "5");
const resp = await fetch(url, {
headers: { "X-API-Key": process.env.ATRIA_API_KEY },
});
const { data } = await resp.json();
for (const b of data.items) {
console.log(b.id, b.name, `(${b.source_library}, ${b.ad_num} ads)`);
}Sample response:
{
"code": 0,
"message": "ok",
"data": {
"items": [
{
"id": "m1234567890123456",
"name": "Acme Co.",
"avatar_url": "https://cdn.example.com/acme.png",
"website_url": "https://acme.example",
"industries": ["shopping"],
"ad_num": 142,
"source_library": "meta_ad_library"
}
],
"total": 1,
"page": 1,
"page_size": 5
}
}Copy the id (e.g. m1234567890123456) for Step 2.
Step 2 — Pull their newest active video ads
curl -sS \
-H "X-API-Key: $ATRIA_API_KEY" \
"https://api.tryatria.com/open/v1/brand-library/m1234567890123456/ads?status=active&display_format=video&order=newest&page_size=20"import os
import requests
brand_id = "m1234567890123456"
resp = requests.get(
f"https://api.tryatria.com/open/v1/brand-library/{brand_id}/ads",
headers={"X-API-Key": os.environ["ATRIA_API_KEY"]},
params={
"status": "active",
"display_format": "video",
"order": "newest",
"page_size": 20,
},
timeout=30,
)
resp.raise_for_status()
for ad in resp.json()["data"]["items"]:
print(ad["start_date"], ad["title"][:60])
for v in ad["videos"]:
print(" ", v["url"], f"({v['duration']}s)")const brandId = "m1234567890123456";
const url = new URL(
`https://api.tryatria.com/open/v1/brand-library/${brandId}/ads`,
);
url.searchParams.set("status", "active");
url.searchParams.set("display_format", "video");
url.searchParams.set("order", "newest");
url.searchParams.set("page_size", "20");
const resp = await fetch(url, {
headers: { "X-API-Key": process.env.ATRIA_API_KEY },
});
const { data } = await resp.json();
for (const ad of data.items) {
console.log(ad.start_date, ad.title?.slice(0, 60));
for (const v of ad.videos) console.log(" ", v.url, `(${v.duration}s)`);
}Parameter notes
status=active— only currently-running ads. Drop it to include paused/archived creatives too.display_format=video— repeatable. Pass it multiple times to widen the filter (e.g.display_format=video&display_format=carousel).order=newest— orders bystart_datedescending. Other useful options:most_active(longest-running),oldest.
Going further
- Combine with
start_dateto scope to "ads launched in the last 30 days":start_date=2026-04-12. - Repeat the second call across a list of brand IDs to build a multi-competitor dashboard — see Daily new-ad digest.
