Facebook Ad Library ad details API
One ad by id or URL: page, status, dates and the snapshot (text, images, videos, format, link, call to action).
- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
- Status
- Betashape may still gain fields
Regulated ads add their transparency data in extra.
You send one of id or url.
Request
Send your key in the x-api-key header.
curl -G "https://api.socialscrape.io/v1/facebook/ad-library/ad" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode 'id=352695862528588'import os
import requests
params = {
"id": "352695862528588",
}
res = requests.get(
"https://api.socialscrape.io/v1/facebook/ad-library/ad",
headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
params=params,
timeout=60,
)
body = res.json()
if body["ok"]:
print(body["data"])
else:
print(body["error"]["code"], body["error"]["message"])const url = new URL("https://api.socialscrape.io/v1/facebook/ad-library/ad");
url.search = new URLSearchParams({
id: "352695862528588",
}).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);
}{
"nodes": [
{
"name": "SocialScrape Facebook Ad Library ad details",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/facebook/ad-library/ad",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "id",
"value": "352695862528588"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
}
]
}
}
}
],
"connections": {}
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | one of | Ad id in the library. Also accepted as ad_id, adId. |
url | url | one of | Ad Library URL (facebook.com/ads/library/?id=...). |
get_transcript | boolean | Accepted for compatibility. A video ad's transcript is its own call, `ad/transcript` (AI transcription, metered); this flag only adds a pointer to it in `extra.transcript_hint`. |
Every request also accepts trim, raw and max_age_days.
Response
Sample from a recorded response, shortened. Values are public data, not yours.
{
"ok": true,
"credits_charged": 1,
"credits_remaining": 4999,
"cached": false,
"cached_at": null,
"request_id": "req_4b391ed27ba57aff4b7f1f13",
"data": {
"object": "ad",
"platform": "facebook",
"id": "352695862528588",
"url": "https://www.facebook.com/ads/library/?id=352695862528588",
"advertiser": {
"object": "advertiser",
"platform": "facebook",
"id": "20531316728",
"name": "Facebook",
"url": "https://facebook.com/facebook",
"page_id": "20531316728",
"country": null,
"verified": true,
"ad_count": null,
"extra": {
"alias": "facebook",
"categories": [
"Website",
"Company"
],
"category": "Internet company",
"cover_url": "https://scontent-iad3-1.xx.fbcdn.net/v/t39.30808-6/756138980_1586883190150362_1776895842644499433_n.avif?_nc_cat=108&ccb=1-7&_nc_sid=957871&_nc_ohc=EuEVSNa1R...",
"entity_type": "PERSON_PROFILE",
"image_url": "https://scontent-iad3-1.xx.fbcdn.net/v/t39.30808-1/380700650_10162533193146729_2379134611963304810_n.jpg?stp=dst-jpg_s148x148_tt6&_nc_cat=1&ccb=1-7&_nc_sid=4..."
}
},
"status": "inactive",
"started_at": "2020-08-27T07:00:00Z",
"ended_at": "2020-08-30T07:00:00Z",
"title": "Change Together: From the March on Washington to Today",
"body": "Queen Latifah hosts a series of candid conversations honoring the 57th anniversary of the #MarchOnWashington and this new era of the civil rights movement. C...",
"cta_text": null,
"landing_url": null,
"format": "video",
"media": {
"thumbnail_url": "https://scontent-iad6-1.xx.fbcdn.net/v/t39.35426-6/123131854_3586232378268717_4745383357747290556_n.jpg?_nc_cat=109&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=tpXEeRskuV...",
"video_url": "https://video-iad6-1.xx.fbcdn.net/o1/v/t2/f2/m412/AQOhKuKthAVVa0rFEi41ggsiGpIjueM36xj6WP_vqqtBOe-ys_sa5nUBYG9fKBArU14yCLHp-zR-F0aBPcYRtpg.mp4?_nc_cat=107&_nc...",
"audio_url": null,
"image_urls": null,
"width": null,
"height": null
},
"regions": null,
"publisher_platforms": [
"facebook"
],
"impressions": {
"lower": 1000000,
"upper": null,
"currency": null
},
"spend": {
"lower": 1000000,
"upper": null,
"currency": "USD"
},
"extra": {
"byline": "Facebook, Inc.",
"categories": [
"POLITICAL"
],
"contains_digital_created_media": false,
"contains_sensitive_content": false,
"disclaimer_label": "PAID_FOR_BY",
"gated_type": "TAKEN_DOWN"
}
},
"cursor": null,
"has_more": null
}Fields
One Ad in data.
A field the platform does not give is null, never made up. Extra platform details are in extra.
| Field | Type | Always | Notes |
|---|---|---|---|
object | "ad" | ||
platform | Platform | yes | the ad library's platform |
id | string | yes | |
url | string or null | ||
advertiser | Advertiser or null | ||
status | "active" or "inactive" or "unknown" | ||
started_at | string (ISO 8601 date-time) or null | ||
ended_at | string (ISO 8601 date-time) or null | ||
title | string or null | ||
body | string or null | ||
cta_text | string or null | ||
landing_url | string or null | ||
format | string or null | "image" | "video" | "carousel" | "text" | platform-specific | |
media | Media |
Show the other 5 fields
Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.
Questions
Which errors can it return?
invalid_params (do not retry), unsupported_url (do not retry), not_found (do not retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.
Is there an SDK call for it?
The preview Python client has client.facebook.ad_library_ad(...) and the TypeScript client client.facebook.adLibraryAd(). Both return the same envelope as the HTTP API. The packages are not published yet; plain HTTP works today in any language.
Can an AI agent call it?
Yes. The MCP server reaches every built endpoint, with the same prices.