Vexaloom Labs

Facebook Political & Commercial Ad Transparency Extractor

Search the Facebook Ad Library by keyword, advertiser Page ID, Ad ID, or funding-entity name, and get ad text, media, run dates, platforms, and spend or impressions for political and issue ads.

Input schema

Input fields, types, required flags, descriptions, defaults, and prefills come from the published definition. Prefill examples are distinct from defaults.

FieldTypeRequiredDescription
modestringoptionalWhat to scrape. Leave empty to process every target list you filled in (searchTerms, pageIds, adIds, bylines) in one run.
searchTermsarrayoptionalKeywords to search for in the Ad Library, one search per term. Example: ["coffee", "nike"].
pageIdsarrayoptionalFacebook Page IDs to fetch all ads from (numeric IDs, or URLs containing view_all_page_id= or profile.php?id=). Each page is searched separately.
Show all input fields
FieldTypeRequiredDescription
modestringoptionalWhat to scrape. Leave empty to process every target list you filled in (searchTerms, pageIds, adIds, bylines) in one run.
searchTermsarrayoptionalKeywords to search for in the Ad Library, one search per term. Example: ["coffee", "nike"].
pageIdsarrayoptionalFacebook Page IDs to fetch all ads from (numeric IDs, or URLs containing view_all_page_id= or profile.php?id=). Each page is searched separately.
adIdsarrayoptionalAd Library IDs to fetch directly (numeric IDs or Ads Library URLs containing ?id=). All other filters are ignored in this mode.
bylinesarrayoptionalFunding-entity / committee names from the "Paid for by" disclaimer on political and issue ads. Matching is exact (case-insensitive fallback): use the name as it appears in the ad. Byline targets always search the political & issue archive, since the Ad Library ignores this filter elsewhere.
countrystringoptionalCountry to search ads in, or ALL for every country. Ignored when the Countries multi-select below is set.
countriesarrayoptionalOne or more country codes, searched together as a union (unlike the single Country field). Takes precedence over Country when set.
adActiveStatusstringoptionalFilter by ad active status.
adTypestringoptionalFilter by ad category. Note: the political-and-issue archive excludes EU/EEA countries, so EU political searches automatically use All Types (EU transparency stream).
mediaTypestringoptionalFilter by the ad's creative media type.
publisherPlatformsarrayoptionalOnly return ads shown on these platforms. Leave empty for all platforms.
contentLanguagesarrayoptional2-letter ISO language codes (e.g. en, de, es) to restrict ads by creative language.
searchTypestringoptionalHow keyword search terms are matched (mode=search only).
startDatestringoptionalOnly include ads that had impressions on or after this date (YYYY-MM-DD). Combined with End Date it forms a delivery window.
endDatestringoptionalOnly include ads that had impressions on or before this date (YYYY-MM-DD).
sortBystringoptionalOrder results by relevance (Facebook's default) or by total impressions.
resultsPerSearchintegeroptionalMaximum number of ads to extract per search term / page / ad / byline.
maxItemsintegeroptionalStop the whole run after this many ads, across all search targets.
includeEuDetailsbooleanoptionalFetch per-ad detail data: EU total reach, age/country/gender reach breakdown, targeting, payer/beneficiary, advertiser Instagram profile and page About. Adds one extra request per ad.
rehostMediabooleanoptionalCopy each ad's primary media into this run's key-value store and output the permanent URL (Facebook's own media URLs expire after a few days). The original signed URL is kept in media_url_original.
onlyTotalbooleanoptionalSkip ad scraping and return only the total number of results per search target (one lightweight page request, no browser). Counts respect the keyword, country, status, ad type, media type and date window; Facebook caps displayed totals at 50,001 (50,000+). Not available for byline searches.

Download the published input schema

View complete JSON
{
  "description": "Search the Facebook Ad Library by keyword, advertiser Page, Ad Library ID, or \"Paid for by\" name. Returns ad creative, media, run dates, platforms, political spend/impressions and EU transparency reach. No login, cookies or Meta API token required.",
  "properties": {
    "adActiveStatus": {
      "default": "active",
      "description": "Filter by ad active status.",
      "editor": "select",
      "enum": [
        "all",
        "active",
        "inactive"
      ],
      "enumTitles": [
        "All Ads",
        "Active Only",
        "Inactive Only"
      ],
      "prefill": "active",
      "title": "Ad Status",
      "type": "string"
    },
    "adIds": {
      "description": "Ad Library IDs to fetch directly (numeric IDs or Ads Library URLs containing ?id=). All other filters are ignored in this mode.",
      "editor": "stringList",
      "items": {
        "type": "string"
      },
      "title": "Direct Ad IDs",
      "type": "array"
    },
    "adType": {
      "default": "all",
      "description": "Filter by ad category. Note: the political-and-issue archive excludes EU/EEA countries, so EU political searches automatically use All Types (EU transparency stream).",
      "editor": "select",
      "enum": [
        "all",
        "political_and_issue_ads",
        "housing",
        "employment",
        "credit"
      ],
      "enumTitles": [
        "All Types",
        "Political & Issue Ads",
        "Housing",
        "Employment",
        "Credit"
      ],
      "prefill": "all",
      "title": "Ad Type",
      "type": "string"
    },
    "bylines": {
      "description": "Funding-entity / committee names from the \"Paid for by\" disclaimer on political and issue ads. Matching is exact (case-insensitive fallback): use the name as it appears in the ad. Byline targets always search the political & issue archive, since the Ad Library ignores this filter elsewhere.",
      "editor": "stringList",
      "items": {
        "type": "string"
      },
      "title": "Search by \"Paid for by\" name",
      "type": "array"
    },
    "contentLanguages": {
      "description": "2-letter ISO language codes (e.g. en, de, es) to restrict ads by creative language.",
      "editor": "stringList",
      "items": {
        "type": "string"
      },
      "title": "Ad Content Languages",
      "type": "array"
    },
    "countries": {
      "description": "One or more country codes, searched together as a union (unlike the single Country field). Takes precedence over Country when set.",
      "editor": "select",
      "items": {
        "enum": [
          "ALL",
          "AF",
          "AL",
          "DZ",
          "AS",
          "AD",
          "AO",
          "AI",
          "AQ",
          "AG",
          "AR",
          "AM",
          "AW",
          "AU",
          "AT",
          "AZ",
          "BS",
          "BH",
          "BD",
          "BB",
          "BY",
          "BE",
          "BZ",
          "BJ",
          "BM",
          "BT",
          "BO",
          "BA",
          "BW",
          "BR",
          "BN",
          "BG",
          "BF",
          "BI",
          "KH",
          "CM",
          "CA",
          "CV",
          "KY",
          "CF",
          "TD",
          "CL",
          "CN",
          "CO",
          "KM",
          "CG",
          "CD",
          "CR",
          "HR",
          "CU",
          "CY",
          "CZ",
          "DK",
          "DJ",
          "DM",
          "DO",
          "EC",
          "EG",
          "SV",
          "GQ",
          "ER",
          "EE",
          "SZ",
          "ET",
          "FJ",
          "FI",
          "FR",
          "GF",
          "PF",
          "GA",
          "GM",
          "GE",
          "DE",
          "GH",
          "GI",
          "GR",
          "GL",
          "GD",
          "GP",
          "GU",
          "GT",
          "GN",
          "GW",
          "GY",
          "HT",
          "HN",
          "HK",
          "HU",
          "IS",
          "IN",
          "ID",
          "IR",
          "IQ",
          "IE",
          "IL",
          "IT",
          "JM",
          "JP",
          "JO",
          "KZ",
          "KE",
          "KI",
          "KW",
          "KG",
          "LA",
          "LV",
          "LB",
          "LS",
          "LR",
          "LY",
          "LI",
          "LT",
          "LU",
          "MO",
          "MG",
          "MW",
          "MY",
          "MV",
          "ML",
          "MT",
          "MH",
          "MQ",
          "MR",
          "MU",
          "MX",
          "FM",
          "MD",
          "MC",
          "MN",
          "ME",
          "MS",
          "MA",
          "MZ",
          "MM",
          "NA",
          "NR",
          "NP",
          "NL",
          "NC",
          "NZ",
          "NI",
          "NE",
          "NG",
          "NU",
          "MK",
          "NO",
          "OM",
          "PK",
          "PW",
          "PS",
          "PA",
          "PG",
          "PY",
          "PE",
          "PH",
          "PL",
          "PT",
          "PR",
          "QA",
          "RO",
          "RU",
          "RW",
          "WS",
          "SM",
          "ST",
          "SA",
          "SN",
          "RS",
          "SC",
          "SL",
          "SG",
          "SK",
          "SI",
          "SB",
          "SO",
          "ZA",
          "KR",
          "SS",
          "ES",
          "LK",
          "KN",
          "LC",
          "VC",
          "SD",
          "SR",
          "SE",
          "CH",
          "SY",
          "TW",
          "TJ",
          "TZ",
          "TH",
          "TL",
          "TG",
          "TO",
          "TT",
          "TN",
          "TR",
          "TM",
          "TC",
          "TV",
          "UG",
          "UA",
          "AE",
          "GB",
          "US",
          "UY",
          "UZ",
          "VU",
          "VA",
          "VE",
          "VN",
          "VG",
          "VI",
          "YE",
          "ZM",
          "ZW"
        ],
        "enumTitles": [
          "All Countries",
          "Afghanistan",
          "Albania",
          "Algeria",
          "American Samoa",
          "Andorra",
          "Angola",
          "Anguilla",
          "Antarctica",
          "Antigua and Barbuda",
          "Argentina",
          "Armenia",
          "Aruba",
          "Australia",
          "Austria",
          "Azerbaijan",
          "Bahamas",
          "Bahrain",
          "Bangladesh",
          "Barbados",
          "Belarus",
          "Belgium",
          "Belize",
          "Benin",
          "Bermuda",
          "Bhutan",
          "Bolivia",
          "Bosnia and Herzegovina",
          "Botswana",
          "Brazil",
          "Brunei",
          "Bulgaria",
          "Burkina Faso",
          "Burundi",
          "Cambodia",
          "Cameroon",
          "Canada",
          "Cape Verde",
          "Cayman Islands",
          "Central African Republic",
          "Chad",
          "Chile",
          "China",
          "Colombia",
          "Comoros",
          "Congo",
          "Congo (DRC)",
          "Costa Rica",
          "Croatia",
          "Cuba",
          "Cyprus",
          "Czechia",
          "Denmark",
          "Djibouti",
          "Dominica",
          "Dominican Republic",
          "Ecuador",
          "Egypt",
          "El Salvador",
          "Equatorial Guinea",
          "Eritrea",
          "Estonia",
          "Eswatini",
          "Ethiopia",
          "Fiji",
          "Finland",
          "France",
          "French Guiana",
          "French Polynesia",
          "Gabon",
          "Gambia",
          "Georgia",
          "Germany",
          "Ghana",
          "Gibraltar",
          "Greece",
          "Greenland",
          "Grenada",
          "Guadeloupe",
          "Guam",
          "Guatemala",
          "Guinea",
          "Guinea-Bissau",
          "Guyana",
          "Haiti",
          "Honduras",
          "Hong Kong",
          "Hungary",
          "Iceland",
          "India",
          "Indonesia",
          "Iran",
          "Iraq",
          "Ireland",
          "Israel",
          "Italy",
          "Jamaica",
          "Japan",
          "Jordan",
          "Kazakhstan",
          "Kenya",
          "Kiribati",
          "Kuwait",
          "Kyrgyzstan",
          "Laos",
          "Latvia",
          "Lebanon",
          "Lesotho",
          "Liberia",
          "Libya",
          "Liechtenstein",
          "Lithuania",
          "Luxembourg",
          "Macau",
          "Madagascar",
          "Malawi",
          "Malaysia",
          "Maldives",
          "Mali",
          "Malta",
          "Marshall Islands",
          "Martinique",
          "Mauritania",
          "Mauritius",
          "Mexico",
          "Micronesia",
          "Moldova",
          "Monaco",
          "Mongolia",
          "Montenegro",
          "Montserrat",
          "Morocco",
          "Mozambique",
          "Myanmar",
          "Namibia",
          "Nauru",
          "Nepal",
          "Netherlands",
          "New Caledonia",
          "New Zealand",
          "Nicaragua",
          "Niger",
          "Nigeria",
          "Niue",
          "North Macedonia",
          "Norway",
          "Oman",
          "Pakistan",
          "Palau",
          "Palestine",
          "Panama",
          "Papua New Guinea",
          "Paraguay",
          "Peru",
          "Philippines",
          "Poland",
          "Portugal",
          "Puerto Rico",
          "Qatar",
          "Romania",
          "Russia",
          "Rwanda",
          "Samoa",
          "San Marino",
          "Sao Tome and Principe",
          "Saudi Arabia",
          "Senegal",
          "Serbia",
          "Seychelles",
          "Sierra Leone",
          "Singapore",
          "Slovakia",
          "Slovenia",
          "Solomon Islands",
          "Somalia",
          "South Africa",
          "South Korea",
          "South Sudan",
          "Spain",
          "Sri Lanka",
          "St. Kitts and Nevis",
          "St. Lucia",
          "St. Vincent and the Grenadines",
          "Sudan",
          "Suriname",
          "Sweden",
          "Switzerland",
          "Syria",
          "Taiwan",
          "Tajikistan",
          "Tanzania",
          "Thailand",
          "Timor-Leste",
          "Togo",
          "Tonga",
          "Trinidad and Tobago",
          "Tunisia",
          "Turkiye",
          "Turkmenistan",
          "Turks and Caicos Islands",
          "Tuvalu",
          "Uganda",
          "Ukraine",
          "United Arab Emirates",
          "United Kingdom",
          "United States",
          "Uruguay",
          "Uzbekistan",
          "Vanuatu",
          "Vatican City",
          "Venezuela",
          "Vietnam",
          "British Virgin Islands",
          "U.S. Virgin Islands",
          "Yemen",
          "Zambia",
          "Zimbabwe"
        ],
        "type": "string"
      },
      "title": "Countries (multi-select)",
      "type": "array",
      "uniqueItems": true
    },
    "country": {
      "default": "ALL",
      "description": "Country to search ads in, or ALL for every country. Ignored when the Countries multi-select below is set.",
      "editor": "select",
      "enum": [
        "ALL",
        "AF",
        "AL",
        "DZ",
        "AS",
        "AD",
        "AO",
        "AI",
        "AQ",
        "AG",
        "AR",
        "AM",
        "AW",
        "AU",
        "AT",
        "AZ",
        "BS",
        "BH",
        "BD",
        "BB",
        "BY",
        "BE",
        "BZ",
        "BJ",
        "BM",
        "BT",
        "BO",
        "BA",
        "BW",
        "BR",
        "BN",
        "BG",
        "BF",
        "BI",
        "KH",
        "CM",
        "CA",
        "CV",
        "KY",
        "CF",
        "TD",
        "CL",
        "CN",
        "CO",
        "KM",
        "CG",
        "CD",
        "CR",
        "HR",
        "CU",
        "CY",
        "CZ",
        "DK",
        "DJ",
        "DM",
        "DO",
        "EC",
        "EG",
        "SV",
        "GQ",
        "ER",
        "EE",
        "SZ",
        "ET",
        "FJ",
        "FI",
        "FR",
        "GF",
        "PF",
        "GA",
        "GM",
        "GE",
        "DE",
        "GH",
        "GI",
        "GR",
        "GL",
        "GD",
        "GP",
        "GU",
        "GT",
        "GN",
        "GW",
        "GY",
        "HT",
        "HN",
        "HK",
        "HU",
        "IS",
        "IN",
        "ID",
        "IR",
        "IQ",
        "IE",
        "IL",
        "IT",
        "JM",
        "JP",
        "JO",
        "KZ",
        "KE",
        "KI",
        "KW",
        "KG",
        "LA",
        "LV",
        "LB",
        "LS",
        "LR",
        "LY",
        "LI",
        "LT",
        "LU",
        "MO",
        "MG",
        "MW",
        "MY",
        "MV",
        "ML",
        "MT",
        "MH",
        "MQ",
        "MR",
        "MU",
        "MX",
        "FM",
        "MD",
        "MC",
        "MN",
        "ME",
        "MS",
        "MA",
        "MZ",
        "MM",
        "NA",
        "NR",
        "NP",
        "NL",
        "NC",
        "NZ",
        "NI",
        "NE",
        "NG",
        "NU",
        "MK",
        "NO",
        "OM",
        "PK",
        "PW",
        "PS",
        "PA",
        "PG",
        "PY",
        "PE",
        "PH",
        "PL",
        "PT",
        "PR",
        "QA",
        "RO",
        "RU",
        "RW",
        "WS",
        "SM",
        "ST",
        "SA",
        "SN",
        "RS",
        "SC",
        "SL",
        "SG",
        "SK",
        "SI",
        "SB",
        "SO",
        "ZA",
        "KR",
        "SS",
        "ES",
        "LK",
        "KN",
        "LC",
        "VC",
        "SD",
        "SR",
        "SE",
        "CH",
        "SY",
        "TW",
        "TJ",
        "TZ",
        "TH",
        "TL",
        "TG",
        "TO",
        "TT",
        "TN",
        "TR",
        "TM",
        "TC",
        "TV",
        "UG",
        "UA",
        "AE",
        "GB",
        "US",
        "UY",
        "UZ",
        "VU",
        "VA",
        "VE",
        "VN",
        "VG",
        "VI",
        "YE",
        "ZM",
        "ZW"
      ],
      "enumTitles": [
        "All Countries",
        "Afghanistan",
        "Albania",
        "Algeria",
        "American Samoa",
        "Andorra",
        "Angola",
        "Anguilla",
        "Antarctica",
        "Antigua and Barbuda",
        "Argentina",
        "Armenia",
        "Aruba",
        "Australia",
        "Austria",
        "Azerbaijan",
        "Bahamas",
        "Bahrain",
        "Bangladesh",
        "Barbados",
        "Belarus",
        "Belgium",
        "Belize",
        "Benin",
        "Bermuda",
        "Bhutan",
        "Bolivia",
        "Bosnia and Herzegovina",
        "Botswana",
        "Brazil",
        "Brunei",
        "Bulgaria",
        "Burkina Faso",
        "Burundi",
        "Cambodia",
        "Cameroon",
        "Canada",
        "Cape Verde",
        "Cayman Islands",
        "Central African Republic",
        "Chad",
        "Chile",
        "China",
        "Colombia",
        "Comoros",
        "Congo",
        "Congo (DRC)",
        "Costa Rica",
        "Croatia",
        "Cuba",
        "Cyprus",
        "Czechia",
        "Denmark",
        "Djibouti",
        "Dominica",
        "Dominican Republic",
        "Ecuador",
        "Egypt",
        "El Salvador",
        "Equatorial Guinea",
        "Eritrea",
        "Estonia",
        "Eswatini",
        "Ethiopia",
        "Fiji",
        "Finland",
        "France",
        "French Guiana",
        "French Polynesia",
        "Gabon",
        "Gambia",
        "Georgia",
        "Germany",
        "Ghana",
        "Gibraltar",
        "Greece",
        "Greenland",
        "Grenada",
        "Guadeloupe",
        "Guam",
        "Guatemala",
        "Guinea",
        "Guinea-Bissau",
        "Guyana",
        "Haiti",
        "Honduras",
        "Hong Kong",
        "Hungary",
        "Iceland",
        "India",
        "Indonesia",
        "Iran",
        "Iraq",
        "Ireland",
        "Israel",
        "Italy",
        "Jamaica",
        "Japan",
        "Jordan",
        "Kazakhstan",
        "Kenya",
        "Kiribati",
        "Kuwait",
        "Kyrgyzstan",
        "Laos",
        "Latvia",
        "Lebanon",
        "Lesotho",
        "Liberia",
        "Libya",
        "Liechtenstein",
        "Lithuania",
        "Luxembourg",
        "Macau",
        "Madagascar",
        "Malawi",
        "Malaysia",
        "Maldives",
        "Mali",
        "Malta",
        "Marshall Islands",
        "Martinique",
        "Mauritania",
        "Mauritius",
        "Mexico",
        "Micronesia",
        "Moldova",
        "Monaco",
        "Mongolia",
        "Montenegro",
        "Montserrat",
        "Morocco",
        "Mozambique",
        "Myanmar",
        "Namibia",
        "Nauru",
        "Nepal",
        "Netherlands",
        "New Caledonia",
        "New Zealand",
        "Nicaragua",
        "Niger",
        "Nigeria",
        "Niue",
        "North Macedonia",
        "Norway",
        "Oman",
        "Pakistan",
        "Palau",
        "Palestine",
        "Panama",
        "Papua New Guinea",
        "Paraguay",
        "Peru",
        "Philippines",
        "Poland",
        "Portugal",
        "Puerto Rico",
        "Qatar",
        "Romania",
        "Russia",
        "Rwanda",
        "Samoa",
        "San Marino",
        "Sao Tome and Principe",
        "Saudi Arabia",
        "Senegal",
        "Serbia",
        "Seychelles",
        "Sierra Leone",
        "Singapore",
        "Slovakia",
        "Slovenia",
        "Solomon Islands",
        "Somalia",
        "South Africa",
        "South Korea",
        "South Sudan",
        "Spain",
        "Sri Lanka",
        "St. Kitts and Nevis",
        "St. Lucia",
        "St. Vincent and the Grenadines",
        "Sudan",
        "Suriname",
        "Sweden",
        "Switzerland",
        "Syria",
        "Taiwan",
        "Tajikistan",
        "Tanzania",
        "Thailand",
        "Timor-Leste",
        "Togo",
        "Tonga",
        "Trinidad and Tobago",
        "Tunisia",
        "Turkiye",
        "Turkmenistan",
        "Turks and Caicos Islands",
        "Tuvalu",
        "Uganda",
        "Ukraine",
        "United Arab Emirates",
        "United Kingdom",
        "United States",
        "Uruguay",
        "Uzbekistan",
        "Vanuatu",
        "Vatican City",
        "Venezuela",
        "Vietnam",
        "British Virgin Islands",
        "U.S. Virgin Islands",
        "Yemen",
        "Zambia",
        "Zimbabwe"
      ],
      "title": "Country",
      "type": "string"
    },
    "endDate": {
      "description": "Only include ads that had impressions on or before this date (YYYY-MM-DD).",
      "editor": "datepicker",
      "title": "End Date",
      "type": "string"
    },
    "includeEuDetails": {
      "default": true,
      "description": "Fetch per-ad detail data: EU total reach, age/country/gender reach breakdown, targeting, payer/beneficiary, advertiser Instagram profile and page About. Adds one extra request per ad.",
      "prefill": false,
      "title": "Include EU Transparency & Advertiser Details",
      "type": "boolean"
    },
    "maxItems": {
      "default": 1000,
      "description": "Stop the whole run after this many ads, across all search targets.",
      "maximum": 100000,
      "minimum": 1,
      "prefill": 3,
      "title": "Max Ads (global)",
      "type": "integer"
    },
    "mediaType": {
      "default": "all",
      "description": "Filter by the ad's creative media type.",
      "editor": "select",
      "enum": [
        "all",
        "image",
        "video",
        "meme",
        "none"
      ],
      "enumTitles": [
        "All Media",
        "Image",
        "Video",
        "Meme",
        "No Media"
      ],
      "prefill": "all",
      "title": "Media Type",
      "type": "string"
    },
    "mode": {
      "default": "",
      "description": "What to scrape. Leave empty to process every target list you filled in (searchTerms, pageIds, adIds, bylines) in one run.",
      "editor": "select",
      "enum": [
        "",
        "search",
        "byPage",
        "byAdId",
        "byByline"
      ],
      "enumTitles": [
        "All provided targets (default)",
        "Search by keyword",
        "All ads from advertiser Pages",
        "Lookup specific ads by Ad Library ID",
        "Search by \"Paid for by\" name"
      ],
      "prefill": "search",
      "title": "Mode",
      "type": "string"
    },
    "onlyTotal": {
      "default": false,
      "description": "Skip ad scraping and return only the total number of results per search target (one lightweight page request, no browser). Counts respect the keyword, country, status, ad type, media type and date window; Facebook caps displayed totals at 50,001 (50,000+). Not available for byline searches.",
      "prefill": false,
      "title": "Only Total Results",
      "type": "boolean"
    },
    "pageIds": {
      "description": "Facebook Page IDs to fetch all ads from (numeric IDs, or URLs containing view_all_page_id= or profile.php?id=). Each page is searched separately.",
      "editor": "stringList",
      "items": {
        "type": "string"
      },
      "title": "Page IDs / Advertiser Search",
      "type": "array"
    },
    "publisherPlatforms": {
      "description": "Only return ads shown on these platforms. Leave empty for all platforms.",
      "editor": "select",
      "items": {
        "enum": [
          "FACEBOOK",
          "INSTAGRAM",
          "MESSENGER",
          "AUDIENCE_NETWORK",
          "WHATSAPP",
          "THREADS"
        ],
        "enumTitles": [
          "Facebook",
          "Instagram",
          "Messenger",
          "Audience Network",
          "WhatsApp",
          "Threads"
        ],
        "type": "string"
      },
      "title": "Publisher Platforms",
      "type": "array",
      "uniqueItems": true
    },
    "rehostMedia": {
      "default": true,
      "description": "Copy each ad's primary media into this run's key-value store and output the permanent URL (Facebook's own media URLs expire after a few days). The original signed URL is kept in media_url_original.",
      "prefill": false,
      "title": "Rehost Media URLs",
      "type": "boolean"
    },
    "resultsPerSearch": {
      "default": 50,
      "description": "Maximum number of ads to extract per search term / page / ad / byline.",
      "maximum": 100000,
      "minimum": 1,
      "prefill": 3,
      "title": "Results Per Search Term",
      "type": "integer"
    },
    "searchTerms": {
      "description": "Keywords to search for in the Ad Library, one search per term. Example: [\"coffee\", \"nike\"].",
      "editor": "stringList",
      "items": {
        "type": "string"
      },
      "prefill": [
        "coffee"
      ],
      "title": "Search Terms",
      "type": "array"
    },
    "searchType": {
      "default": "keyword_unordered",
      "description": "How keyword search terms are matched (mode=search only).",
      "editor": "select",
      "enum": [
        "keyword_unordered",
        "keyword_exact_phrase"
      ],
      "enumTitles": [
        "Any order (default)",
        "Exact phrase"
      ],
      "prefill": "keyword_unordered",
      "title": "Keyword Match",
      "type": "string"
    },
    "sortBy": {
      "default": "relevance",
      "description": "Order results by relevance (Facebook's default) or by total impressions.",
      "editor": "select",
      "enum": [
        "relevance",
        "total_impressions"
      ],
      "enumTitles": [
        "Relevance (default)",
        "Total Impressions"
      ],
      "prefill": "relevance",
      "title": "Sort By",
      "type": "string"
    },
    "startDate": {
      "description": "Only include ads that had impressions on or after this date (YYYY-MM-DD). Combined with End Date it forms a delivery window.",
      "editor": "datepicker",
      "title": "Start Date",
      "type": "string"
    }
  },
  "schemaVersion": 1,
  "title": "Facebook Ad Transparency Extractor Input",
  "type": "object"
}

Output schema

Published result links and storage locations. This schema is not an exhaustive contract for every field in a dataset record.

FieldTypeRequiredDescription
adsstringoptionalDataset containing all scraped Facebook ads, one JSON object per ad

Download the published output schema

View complete JSON
{
  "actorOutputSchemaVersion": 1,
  "description": "One record per Facebook Ad Library ad, with creative text, media, run dates, platforms, political spend/impressions and EU DSA transparency fields. Records where an ad did not receive a field (e.g. spend on a commercial ad) simply omit it.",
  "properties": {
    "ads": {
      "description": "Dataset containing all scraped Facebook ads, one JSON object per ad",
      "template": "{{links.apiDefaultDatasetUrl}}/items",
      "title": "Ad Library Data",
      "type": "string"
    }
  },
  "title": "Facebook Ad Transparency Extractor Output"
}

Dataset schema

Published dataset views and any declared field definitions. A view can select only a subset of the returned record fields.

Download the published dataset schema

View complete JSON
{
  "actorSpecification": 1,
  "title": "Facebook Ad Library Data",
  "views": {
    "detailed": {
      "display": {
        "component": "table",
        "properties": {
          "ad_id": {
            "format": "text",
            "label": "Ad ID"
          },
          "ad_snapshot_url": {
            "format": "link",
            "label": "Snapshot URL"
          },
          "ad_text": {
            "format": "text",
            "label": "Ad Text"
          },
          "advertiser_ig_followers": {
            "format": "text",
            "label": "IG Followers"
          },
          "advertiser_ig_username": {
            "format": "text",
            "label": "IG Username"
          },
          "byline": {
            "format": "text",
            "label": "Paid For By"
          },
          "caption": {
            "format": "text",
            "label": "Caption"
          },
          "collation_count": {
            "format": "text",
            "label": "Creative Reuse"
          },
          "collation_id": {
            "format": "text",
            "label": "Collation ID"
          },
          "contains_digital_created_media": {
            "format": "text",
            "label": "AI Media"
          },
          "cta_text": {
            "format": "text",
            "label": "CTA"
          },
          "currency": {
            "format": "text",
            "label": "Currency"
          },
          "days_running": {
            "format": "text",
            "label": "Days Running"
          },
          "disclaimer_label": {
            "format": "text",
            "label": "Disclaimer"
          },
          "display_format": {
            "format": "text",
            "label": "Display Format"
          },
          "end_date": {
            "format": "text",
            "label": "Ended"
          },
          "gated_type": {
            "format": "text",
            "label": "Gated Type"
          },
          "image_urls": {
            "format": "text",
            "label": "Image URLs"
          },
          "impressions": {
            "format": "text",
            "label": "Impressions"
          },
          "is_active": {
            "format": "text",
            "label": "Active"
          },
          "link_description": {
            "format": "text",
            "label": "Link Description"
          },
          "link_url": {
            "format": "link",
            "label": "Link URL"
          },
          "media_type": {
            "format": "text",
            "label": "Media Type"
          },
          "media_url": {
            "format": "link",
            "label": "Media URL"
          },
          "page_categories": {
            "format": "text",
            "label": "Page Categories"
          },
          "page_id": {
            "format": "text",
            "label": "Page ID"
          },
          "page_like_count": {
            "format": "text",
            "label": "Page Likes"
          },
          "page_name": {
            "format": "text",
            "label": "Page Name"
          },
          "page_url": {
            "format": "link",
            "label": "Page URL"
          },
          "publisher_platform": {
            "format": "text",
            "label": "Platforms"
          },
          "reach_estimate": {
            "format": "text",
            "label": "Reach Estimate"
          },
          "regional_regulation_data": {
            "format": "text",
            "label": "Regional Regulation"
          },
          "resolved_ad_text": {
            "format": "text",
            "label": "Resolved Ad Text"
          },
          "scraped_at": {
            "format": "text",
            "label": "Scraped At"
          },
          "search_term": {
            "format": "text",
            "label": "Search Term"
          },
          "spend": {
            "format": "text",
            "label": "Spend"
          },
          "start_date": {
            "format": "text",
            "label": "Started"
          },
          "status": {
            "format": "text",
            "label": "Status"
          },
          "template_tokens": {
            "format": "text",
            "label": "Template Tokens"
          },
          "title": {
            "format": "text",
            "label": "Title"
          },
          "video_urls": {
            "format": "text",
            "label": "Video URLs"
          }
        }
      },
      "title": "Detailed View",
      "transformation": {
        "fields": [
          "ad_id",
          "page_name",
          "page_id",
          "page_url",
          "ad_text",
          "resolved_ad_text",
          "template_tokens",
          "title",
          "caption",
          "cta_text",
          "link_url",
          "link_description",
          "display_format",
          "start_date",
          "end_date",
          "days_running",
          "status",
          "is_active",
          "media_type",
          "media_url",
          "image_urls",
          "video_urls",
          "publisher_platform",
          "collation_count",
          "collation_id",
          "page_like_count",
          "page_categories",
          "advertiser_ig_username",
          "advertiser_ig_followers",
          "spend",
          "impressions",
          "reach_estimate",
          "currency",
          "byline",
          "disclaimer_label",
          "gated_type",
          "regional_regulation_data",
          "contains_digital_created_media",
          "ad_snapshot_url",
          "search_term",
          "scraped_at"
        ]
      }
    },
    "euTransparency": {
      "display": {
        "component": "table",
        "properties": {
          "ad_id": {
            "format": "text",
            "label": "Ad ID"
          },
          "ad_snapshot_url": {
            "format": "link",
            "label": "Snapshot URL"
          },
          "age_country_gender_reach_breakdown": {
            "format": "text",
            "label": "Reach Breakdown"
          },
          "audience_age_gender": {
            "format": "text",
            "label": "Audience Age/Gender"
          },
          "audience_location": {
            "format": "text",
            "label": "Audience Location"
          },
          "audience_single_country": {
            "format": "text",
            "label": "Country"
          },
          "byline": {
            "format": "text",
            "label": "Paid For By"
          },
          "categories": {
            "format": "text",
            "label": "Categories"
          },
          "currency": {
            "format": "text",
            "label": "Currency"
          },
          "eu_total_reach": {
            "format": "text",
            "label": "EU Reach"
          },
          "impressions": {
            "format": "text",
            "label": "Impressions"
          },
          "is_violating_eu_siep": {
            "format": "text",
            "label": "EU SIEP Violation"
          },
          "page_name": {
            "format": "text",
            "label": "Page Name"
          },
          "payer_beneficiary": {
            "format": "text",
            "label": "Payer / Beneficiary"
          },
          "reach_estimate": {
            "format": "text",
            "label": "Reach"
          },
          "search_term": {
            "format": "text",
            "label": "Search Term"
          },
          "spend": {
            "format": "text",
            "label": "Spend"
          },
          "spend_lower_bound": {
            "format": "text",
            "label": "Spend Min"
          },
          "spend_upper_bound": {
            "format": "text",
            "label": "Spend Max"
          },
          "target_age_audience": {
            "format": "text",
            "label": "Target Ages"
          },
          "target_gender_audience": {
            "format": "text",
            "label": "Target Gender"
          },
          "target_location_audience": {
            "format": "text",
            "label": "Target Locations"
          },
          "violation_types": {
            "format": "text",
            "label": "Violations"
          }
        }
      },
      "title": "EU Transparency & Political Ads",
      "transformation": {
        "fields": [
          "ad_id",
          "page_name",
          "byline",
          "categories",
          "spend",
          "spend_lower_bound",
          "spend_upper_bound",
          "impressions",
          "reach_estimate",
          "currency",
          "eu_total_reach",
          "target_age_audience",
          "target_gender_audience",
          "target_location_audience",
          "age_country_gender_reach_breakdown",
          "payer_beneficiary",
          "audience_age_gender",
          "audience_location",
          "audience_single_country",
          "violation_types",
          "is_violating_eu_siep",
          "ad_snapshot_url",
          "search_term"
        ]
      }
    },
    "overview": {
      "display": {
        "component": "table",
        "properties": {
          "ad_id": {
            "format": "text",
            "label": "Ad ID"
          },
          "ad_snapshot_url": {
            "format": "link",
            "label": "Snapshot URL"
          },
          "ad_text": {
            "format": "text",
            "label": "Ad Text"
          },
          "collation_count": {
            "format": "text",
            "label": "Creative Reuse"
          },
          "cta_text": {
            "format": "text",
            "label": "CTA"
          },
          "impressions": {
            "format": "text",
            "label": "Impressions"
          },
          "link_url": {
            "format": "link",
            "label": "Link URL"
          },
          "media_type": {
            "format": "text",
            "label": "Media"
          },
          "page_name": {
            "format": "text",
            "label": "Page Name"
          },
          "publisher_platform": {
            "format": "text",
            "label": "Platforms"
          },
          "search_term": {
            "format": "text",
            "label": "Search Term"
          },
          "spend": {
            "format": "text",
            "label": "Spend"
          },
          "start_date": {
            "format": "text",
            "label": "Started"
          },
          "status": {
            "format": "text",
            "label": "Status"
          }
        }
      },
      "title": "Ad Overview",
      "transformation": {
        "fields": [
          "ad_id",
          "page_name",
          "ad_text",
          "start_date",
          "status",
          "media_type",
          "cta_text",
          "link_url",
          "publisher_platform",
          "collation_count",
          "spend",
          "impressions",
          "ad_snapshot_url",
          "search_term"
        ]
      }
    }
  }
}

Key-value schema

Published key-value store definitions, when provided by this build.

This definition is not present in the default published build. See the published README for available documentation.

Published README

Read the full published documentation

Facebook Political & Commercial Ad Transparency Extractor

Read Facebook's public Ad Library directly and export one clean JSON record per ad — creative copy, carousel cards, images and videos, placements, advertiser identity, run dates, and the transparency numbers Meta only publishes for political and EU-delivered ads (spend ranges, impressions, reach, payer/beneficiary, age/country/gender reach). Works with a plain guest session: no Facebook login, no cookies, no Meta developer app.

What you get

  • Four ways to search — keywords, advertiser Pages, exact Ad Library IDs, or the funding entity on a "Paid for by" disclaimer, all in one run if you want
  • Meta's own transparency payloads, re-emitted whole — political spend and impression ranges; EU total reach plus the per-country age/gender reach breakdown; declared payer and beneficiary; audience age/gender/location distributions returned as Meta publishes them
  • Creative in full — primary media URL (copied to a permanent URL before it can expire), every image and video URL, carousel cards with their own text/CTA/link, CTA type, caption, title and display format
  • Advertiser context — Page URL, profile picture, likes, categories, verification, and the linked Instagram handle with follower count and About text
  • Scale signals — collation_count (variants sharing the same creative), days_running, placements, and the special-ad categories
  • Honest gaps — a field Meta does not disclose for an ad is simply left out; nothing is estimated or fabricated

Data source

The actor talks to the same internal JSON endpoint the Ad Library web page uses (facebook.com/api/graphql/, guest session). The page's own query identifiers are re-learned from the live site when they rotate, so the actor keeps working across Meta releases. No credential of any kind is required. Requests run through a built-in connection ladder (direct first, an Apify datacenter pool, then residential as a last resort) chosen automatically per request — you never configure a proxy.

Modes

Mode What it does
search Keyword search across all advertisers (any-order or exact-phrase matching)
byPage Every ad an advertiser Page is running or has run
byAdId Fetch one or more specific ads by their Ad Library ID
byByline Political/issue ads by their "Paid for by" funding entity
(empty) Processes every target list you filled in, in a single run

Input

Field Type Default Description
mode select All provided targets Which target list to use; empty processes all of them
searchTerms array – Keywords, one search each
pageIds array – Numeric Page IDs or URLs containing view_all_page_id= / ?id=
adIds array – Numeric Ad Library IDs or ads-library URLs containing ?id=
bylines array – "Paid for by" funding-entity names (exact string matching; always searched in the political & issue archive, where this filter exists)
country select ALL Single country code; ignored when countries is set
countries multi-select – Several country codes searched together (true union)
adActiveStatus select active all / active / inactive
adType select all all / political_and_issue_ads / housing / employment / credit
mediaType select all all / image / video / meme / none
publisherPlatforms multi-select – FACEBOOK / INSTAGRAM / MESSENGER / AUDIENCE_NETWORK / WHATSAPP / THREADS
contentLanguages array – ISO 639-1 codes of the ad creative (e.g. en, de)
searchType select keyword_unordered Any-order or exact-phrase keyword matching
startDate date – Ads with impressions on/after this date (delivery window)
endDate date – Ads with impressions on/before this date
sortBy select relevance relevance or total_impressions
resultsPerSearch integer 50 Cap per search target (1–100000)
maxItems integer 1000 Global cap across everything (1–100000)
includeEuDetails boolean true Fetch EU transparency, payer/beneficiary and advertiser profile per ad
rehostMedia boolean true Copy the primary media into a permanent URL (originals kept in media_url_original)
onlyTotal boolean false Return just the total result count per target, read from the Ad Library page in one lightweight request (no browser, no pagination) — respects every filter including the date window; Facebook caps displayed totals at 50,001 (50,000+)

Output fields

Every record is omit-empty (a field that does not apply is absent, never null).

Field Meaning
ad_id, ad_snapshot_url Ad Library ID and its public snapshot URL
page_id, page_name, page_url, page_profile_picture_url Advertiser identity
page_like_count, page_categories, page_verification, page_is_deleted Advertiser page signals
advertiser_ig_username, advertiser_ig_followers, advertiser_ig_verified, advertiser_about Linked Instagram profile and About text
ad_text, title, caption, link_description, display_format Creative text (as Meta serves it)
template_body, template_title, template_tokens, resolved_ad_text, resolved_title Dynamic-creative handling: raw {{…}} placeholders are kept in template_body/template_title, their token names in template_tokens, and a token-free resolved_ad_text/resolved_title is attached when the payload's carousel cards carry the served variant
cta_text, cta_type, link_url Call to action and destination
media_type, media_url, media_url_original, media_url_expires_at Primary creative media
image_urls, video_urls, video_preview_urls All creative media URLs
cards Carousel cards (title, body, caption, link, CTA, image, videos)
start_date, end_date, days_running, status, is_active Delivery window and live status
publisher_platform Placements (Facebook, Instagram, Messenger, …)
collation_count, collation_id Creative-reuse group size and ID
categories, gated_type, regional_regulation_data Special categories and regulation flags
spend, spend_lower_bound, spend_upper_bound, currency Spend range (political & EU-regulated ads)
impressions, impressions_index, impressions_lower_bound, impressions_upper_bound, reach_estimate Impression/reach signals (same gating)
byline, disclaimer_label "Paid for by" funding entity
eu_total_reach, age_country_gender_reach_breakdown EU DSA total reach and per-country age/gender breakdown
target_age_audience, target_gender_audience, target_location_audience Declared EU/UK targeting
audience_age_gender, audience_location, audience_single_country Audience distribution as published
payer_beneficiary, violation_types, is_violating_eu_siep EU payer/beneficiary declarations and violations
contains_digital_created_media, contains_sensitive_content, has_user_reported, is_aaa_eligible, total_active_time, hide_data_status, state_media_run_label Additional Meta flags
search_term, scraped_at Which search produced the row, and when

Diagnostic rows use type: "facebook_ads_library_diagnostic" with searchTerm, outcome, message and scrapedAt; onlyTotal runs push type: "facebook_ads_library_total" with total_results. Ad-ID lookups that neither the search endpoint nor the ad's own page can resolve produce a detail_unavailable diagnostic that reports Facebook's own reason (NO_AD_FOUND) — no record is ever fabricated.

Example

{
    "mode": "search",
    "searchTerms": ["coffee"],
    "country": "US",
    "adActiveStatus": "active",
    "includeEuDetails": true,
    "maxItems": 50
}

FAQ

Do I need a Facebook account or cookies? No. The actor works with an anonymous guest session by default.

Why is spend missing on some ads? Meta publishes spend and impressions ranges only for political/issue ads and EU-regulated advertising. The actor returns those fields when the source has them and omits them otherwise — it never fills a gap with a guess.

Why did my political search for an EU country return all ad types? Meta's political/issue archive does not cover EU/EEA countries; EU political ads live in the general transparency stream, so the actor automatically searches all types there and says so in the run log.

Will image and video links keep working? Facebook's media links are signed and expire within days. With rehostMedia on, the primary media is copied to a permanent URL first and the original is preserved in media_url_original; the arrays keep Meta's URLs, each with its expiry in media_url_expires_at.

How far back does the data go? Whatever the public Ad Library serves for your query: seven years for political/issue ads, one year for ads delivered to the EU, and live archive coverage for commercial ads.

Can I scrape several countries or targets at once? Yes — countries yields a union, and every target list can run together in one job.

What is collation_count? The number of ad variants Meta groups under the same creative and text — a quick way to spot heavily scaled campaigns.

Why does ad_text sometimes contain {{product.brand}}? Dynamic-creative (DCO/DPA) ads are stored with template placeholders; Meta resolves them only when the ad is delivered. The actor keeps the served text untouched in ad_text, records the placeholder in template_body/template_tokens, and attaches resolved_ad_text/resolved_title when the payload's cards contain the resolved creative instead of inventing one.

Is the total count exact? It is the number the Ad Library page itself displays for your filters. Meta caps the display at 50,001, meaning "50,000 or more"; below that it is exact. Totals are not available for byline searches because the Ad Library UI has no byline filter.

Python quickstart

Use a schema-derived input and the Python standard library to start a run. An Apify account and token are required for execution.

Open the step-by-step Python guide →

Source build WuTbehzZYnu3x7Fwe. Documentation is regenerated from the default published build; private drafts are not included.