Skip to content

Search ads with optional text, range, date, country, technology, and sorting filters. Returned ad records include appUrl, a direct link to open that ad in the AfterLib web app.

ParameterLocationTypeDefaultAllowed valuesDescription
searchJSON bodystringnoneup to 200 charsKeyword search across public ad fields.
limitJSON bodynumber201 to 100Maximum ads returned.
cursorJSON bodystringnonevalue from previous responseFetch the next cursor page.
sortByJSON bodystringperformanceperformance, duplicates, trend, started_at, audience_reach, duplicates_change_p_all, audience_reach_change_p_allSort field.
sortDirectionJSON bodystringdescasc, descSort direction.
textSearchJSON bodystring or objectnonetext string or field include/exclude objectMatch text in specific public fields.
duplicates, performance, audienceReachJSON bodyobjectnone{ "gte": number, "lte": number }Numeric range filters.
dateRangeJSON bodyobjectnone{ "gte": "YYYY-MM-DD", "lte": "YYYY-MM-DD" }Active date range filter.
countries, technologies, publisherPlatformJSON bodyobjectnone{ "include": [], "exclude": [], "operator": "or" }Include/exclude filters.
displayFormat, ctaTypeJSON bodystring arraynonesupported public valuesFilter by ad format or call to action.
Terminal window
curl https://api.afterlib.com/v1/ads/search \
-H "Authorization: Bearer $AFTERLIB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"search": "coffee",
"limit": 10,
"sortBy": "performance",
"sortDirection": "desc"
}'

Response:

{
"items": [
{
"id": "018f2f8e-8f32-7c11-a4a6-33c73a4d7ad1",
"appUrl": "https://app.afterlib.com/ads/018f2f8e-8f32-7c11-a4a6-33c73a4d7ad1",
"headline": "Bring home cleaner skin",
"body": "A concise public ad response with creative metadata, media, page, and website context.",
"startedAt": "2025-08-26T09:04:49.640Z",
"lastSeenAt": "2025-09-03T09:04:49.640Z",
"duplicates": 1228,
"performancePublic": 100,
"trendPublic": 0,
"countries": ["US"],
"displayFormat": "video",
"ctaType": "SHOP_NOW",
"media": [
{
"type": "THUMB",
"url": "creative-thumb.jpg",
"mediaFormat": "jpg",
"urls": {"preview": "https://box.afterlib.com/example-preview"}
}
],
"page": {"pageName": "Drift Wellness Company", "adsAmount": 4},
"website": {"siteDomain": "seed-store.afterlib.local"}
}
],
"cursor": null,
"hasMore": false,
"totalHits": 1
}

Use include filters and ranges together when you want a narrower set of ads that match a market and threshold.

Terminal window
curl https://api.afterlib.com/v1/ads/search \
-H "Authorization: Bearer $AFTERLIB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"search": "coffee",
"countries": {"include": ["US"], "operator": "or"},
"technologies": {"include": ["shopify"], "operator": "or"},
"duplicates": {"gte": 100},
"dateRange": {"gte": "2025-01-01"},
"limit": 25
}'

Fetch one ad by its public UUID.

ParameterLocationTypeDefaultAllowed valuesDescription
adIdpathUUID stringrequiredpublic ad UUIDThe ad to fetch.
Terminal window
curl https://api.afterlib.com/v1/ads/018f2f8e-8f32-7c11-a4a6-33c73a4d7ad1 \
-H "Authorization: Bearer $AFTERLIB_API_KEY"

Response:

{
"id": "018f2f8e-8f32-7c11-a4a6-33c73a4d7ad1",
"appUrl": "https://app.afterlib.com/ads/018f2f8e-8f32-7c11-a4a6-33c73a4d7ad1",
"headline": "Bring home cleaner skin",
"duplicates": 1228,
"performancePublic": 100,
"countries": ["US"],
"page": {"pageName": "Drift Wellness Company", "adsAmount": 4},
"website": {"siteDomain": "seed-store.afterlib.local"}
}

POST /v1/ads/search and GET /v1/ads/{adId} can charge credits for returned unique ads. Save X-Afterlib-Request-Id when debugging unexpected results or credit charges.