Facebook Ad Library ad details API
  1. Docs
  2. Facebook
  3. Facebook Ad Library ad details API

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).

GET /v1/facebook/ad-library/ad

GET /v1/facebook/ad-library/ad

One ad by id or URL: page, status, dates and the snapshot (text, images, videos, format, link, call to action). Regulated ads add their transparency data in extra.

  • Cost: 1 credit
  • 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 Library URL (facebook.com/ads/library/?id=...). Accepted hosts: facebook.com.
get_transcriptbooleannoAccepted 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. Default false.

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).

1curl -G "https://api.socialscrape.dev/v1/facebook/ad-library/ad" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode "id=352695862528588"

Example response#

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

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_4b391ed27ba57aff4b7f1f13",8  "data": {9    "object": "ad",10    "platform": "facebook",11    "id": "352695862528588",12    "url": "https://www.facebook.com/ads/library/?id=352695862528588",13    "advertiser": {14      "object": "advertiser",15      "platform": "facebook",16      "id": "20531316728",17      "name": "Facebook",18      "url": "https://facebook.com/facebook",19      "page_id": "20531316728",20      "country": null,21      "verified": true,22      "ad_count": null,23      "extra": {24        "alias": "facebook",25        "categories": [26          "Website",27          "Company"28        ],29        "category": "Internet company",30        "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=EuEVSNa1RDcQ7kNvwHnW1tw&_nc_oc=AdqSn7iMHpK98NorWHNmWMsaeUzo9rmK0eTofV9wjUckzcvcGFaCln32LWYFM...",31        "entity_type": "PERSON_PROFILE",32        "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=418b77&_nc_ohc=J-0bhyn71VEQ7kNvwGwrgcD&_nc_oc=Adp9fMi50sr3ccQrqeElkIGp8BZbrFv8hTEDP5...",33        "instagram_followers": 7777531,34        "instagram_username": "facebook",35        "instagram_verified": true,36        "likes": 154849444,37        "restricted": false,38        "verification": "BLUE_VERIFIED"39      }40    },41    "status": "inactive",42    "started_at": "2020-08-27T07:00:00Z",43    "ended_at": "2020-08-30T07:00:00Z",44    "title": "Change Together: From the March on Washington to Today",45    "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. Change Together features notable civil rights leaders such as Patrisse Cullors, Reve...",46    "cta_text": null,47    "landing_url": null,48    "format": "video",49    "media": {50      "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=tpXEeRskuVcQ7kNvwG_nIfD&_nc_oc=AdoK9Gjnn-LfVkcA-p5JCkomtqIfP8YyI9f9CQlVa3u5K07rih2FUPhm0sfcl4...",51      "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_sid=ef5aa3&_nc_ht=video-iad6-1.xx.fbcdn.net&_nc_ohc=QaFwD5-UhtsQ7kNvwFsGH28&efg=ey...",52      "audio_url": null,53      "image_urls": null,54      "width": null,55      "height": null56    },57    "regions": null,58    "publisher_platforms": [59      "facebook"60    ],61    "impressions": {62      "lower": 1000000.0,63      "upper": null,64      "currency": null65    },66    "spend": {67      "lower": 1000000.0,68      "upper": null,69      "currency": "USD"70    },71    "extra": {72      "byline": "Facebook, Inc.",73      "categories": [74        "POLITICAL"75      ],76      "contains_digital_created_media": false,77      "contains_sensitive_content": false,78      "disclaimer_label": "PAID_FOR_BY",79      "gated_type": "TAKEN_DOWN",80      "hide_data_status": "NONE",81      "impressions_text": ">1M",82      "is_aaa_eligible": false,83      "media_expires_at": "2026-11-03T13:31:43Z",84      "page_spend": {85        "current_week": null,86        "is_political_page": true,87        "lifetime_by_disclaimer": [88          {89            "disclaimer": "",90            "spend": 92131091          },92          {93            "disclaimer": "Facebook, Inc.",94            "spend": 3035636295          }96        ],97        "weekly_by_disclaimer": []98      },99      "reach_estimate": ">1M",100      "regional_regulation_data": {101        "finserv": {102          "is_deemed_finserv": false,103          "is_limited_delivery": false104        },105        "tw_anti_scam": {106          "is_limited_delivery": false107        }108      }109    }110  },111  "cursor": null,112  "has_more": null113}

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:

1{2  "ok": false,3  "error": {4    "code": "not_found",5    "message": "The platform says this profile, post or item does not exist.",6    "retryable": false7  },8  "credits_charged": 0,9  "request_id": "req_18965a343014cc47f59524ec"10}

Also served at#

These paths answer the same request, so code written for other APIs keeps working: /v1/facebook/adLibrary/ad. See Switching from ScrapeCreators.