{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Ads Library Scraper - All Filters, Caps, Free Count",
    "description": "Scrape the Facebook (Meta) Ad Library without login: keywords, advertiser pages, ad IDs or Ad Library URLs, every filter (country, ad type, status, media, platform, language, dates, political audience), EU and political transparency details. Exact caps, free total count, pay once per ad.",
    "version": "1.0",
    "x-build-id": "Ic0slN3kONWtBoZQR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation_craft~facebook-ads-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation_craft-facebook-ads-library-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/automation_craft~facebook-ads-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automation_craft-facebook-ads-library-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/automation_craft~facebook-ads-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automation_craft-facebook-ads-library-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "searchTerms": {
            "title": "Keywords",
            "type": "array",
            "description": "One search per line, exactly like typing in the Ad Library search box. Each keyword is searched in every selected country. Leave empty when you search by page, advertiser, URL or ad ID.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Keyword matching",
            "enum": [
              "keyword_unordered",
              "keyword_exact_phrase"
            ],
            "type": "string",
            "description": "Unordered (default): ads containing the words in any order. Exact phrase: the words together, as the Ad Library does when you put a phrase in quotes.",
            "default": "keyword_unordered"
          },
          "pageIds": {
            "title": "Advertiser pages (IDs or URLs)",
            "type": "array",
            "description": "Facebook page IDs, page URLs (facebook.com/nike, facebook.com/profile.php?id=...), Instagram profile URLs or Ad Library \"view all page\" URLs. Page names / handles are resolved to IDs automatically. Returns every ad the page runs (the \"See all ads\" view).",
            "items": {
              "type": "string"
            }
          },
          "advertiserNames": {
            "title": "Advertiser names",
            "type": "array",
            "description": "Advertiser names as you would type them in the Ad Library search box, e.g. \"Nike\" or \"VoteVets\". The best matching page is used; the run summary lists the candidates so you can pin the ID next time.",
            "items": {
              "type": "string"
            }
          },
          "adLibraryUrls": {
            "title": "Ad Library URLs",
            "type": "array",
            "description": "Paste any facebook.com/ads/library URL. Every parameter in it (keyword, page, country, ad type, status, media type, platforms, languages, date range, sort, political filters) is applied to that query. URLs with ?id= fetch that single ad.",
            "items": {
              "type": "string"
            }
          },
          "adArchiveIds": {
            "title": "Ad IDs (Library IDs)",
            "type": "array",
            "description": "Ad Library IDs to fetch directly, e.g. 161966936869658, or ?id= URLs. Each returns the current record of that ad (status, dates, creative, political spend). Unknown IDs are reported and free.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Where the ads were shown. \"All countries\" (ALL) works for every ad type. Select several to run one query per country; \"EU\" (via the API) expands to the 27 member states. Names and ISO codes are both accepted through the API.",
            "items": {
              "type": "string",
              "enum": [
                "ALL",
                "AF",
                "AX",
                "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",
                "BQ",
                "BA",
                "BW",
                "BV",
                "BR",
                "IO",
                "BN",
                "BG",
                "BF",
                "BI",
                "CV",
                "KH",
                "CM",
                "CA",
                "KY",
                "CF",
                "TD",
                "CL",
                "CN",
                "CX",
                "CC",
                "CO",
                "KM",
                "CG",
                "CD",
                "CK",
                "CR",
                "CI",
                "HR",
                "CU",
                "CW",
                "CY",
                "CZ",
                "DK",
                "DJ",
                "DM",
                "DO",
                "EC",
                "EG",
                "SV",
                "GQ",
                "ER",
                "EE",
                "SZ",
                "ET",
                "FK",
                "FO",
                "FJ",
                "FI",
                "FR",
                "GF",
                "PF",
                "TF",
                "GA",
                "GM",
                "GE",
                "DE",
                "GH",
                "GI",
                "GR",
                "GL",
                "GD",
                "GP",
                "GU",
                "GT",
                "GG",
                "GN",
                "GW",
                "GY",
                "HT",
                "HM",
                "VA",
                "HN",
                "HK",
                "HU",
                "IS",
                "IN",
                "ID",
                "IR",
                "IQ",
                "IE",
                "IM",
                "IL",
                "IT",
                "JM",
                "JP",
                "JE",
                "JO",
                "KZ",
                "KE",
                "KI",
                "KP",
                "KR",
                "KW",
                "KG",
                "LA",
                "LV",
                "LB",
                "LS",
                "LR",
                "LY",
                "LI",
                "LT",
                "LU",
                "MO",
                "MG",
                "MW",
                "MY",
                "MV",
                "ML",
                "MT",
                "MH",
                "MQ",
                "MR",
                "MU",
                "YT",
                "MX",
                "FM",
                "MD",
                "MC",
                "MN",
                "ME",
                "MS",
                "MA",
                "MZ",
                "MM",
                "NA",
                "NR",
                "NP",
                "NL",
                "NC",
                "NZ",
                "NI",
                "NE",
                "NG",
                "NU",
                "NF",
                "MK",
                "MP",
                "NO",
                "OM",
                "PK",
                "PW",
                "PS",
                "PA",
                "PG",
                "PY",
                "PE",
                "PH",
                "PN",
                "PL",
                "PT",
                "PR",
                "QA",
                "RE",
                "RO",
                "RU",
                "RW",
                "BL",
                "SH",
                "KN",
                "LC",
                "MF",
                "PM",
                "VC",
                "WS",
                "SM",
                "ST",
                "SA",
                "SN",
                "RS",
                "SC",
                "SL",
                "SG",
                "SX",
                "SK",
                "SI",
                "SB",
                "SO",
                "ZA",
                "GS",
                "SS",
                "ES",
                "LK",
                "SD",
                "SR",
                "SJ",
                "SE",
                "CH",
                "SY",
                "TW",
                "TJ",
                "TZ",
                "TH",
                "TL",
                "TG",
                "TK",
                "TO",
                "TT",
                "TN",
                "TR",
                "TM",
                "TC",
                "TV",
                "UG",
                "UA",
                "AE",
                "GB",
                "US",
                "UM",
                "UY",
                "UZ",
                "VU",
                "VE",
                "VN",
                "VG",
                "VI",
                "WF",
                "EH",
                "YE",
                "ZM",
                "ZW"
              ],
              "enumTitles": [
                "All countries",
                "Afghanistan (AF)",
                "Åland Islands (AX)",
                "Albania (AL)",
                "Algeria (DZ)",
                "American Samoa (AS)",
                "Andorra (AD)",
                "Angola (AO)",
                "Anguilla (AI)",
                "Antarctica (AQ)",
                "Antigua & Barbuda (AG)",
                "Argentina (AR)",
                "Armenia (AM)",
                "Aruba (AW)",
                "Australia (AU)",
                "Austria (AT)",
                "Azerbaijan (AZ)",
                "Bahamas (BS)",
                "Bahrain (BH)",
                "Bangladesh (BD)",
                "Barbados (BB)",
                "Belarus (BY)",
                "Belgium (BE)",
                "Belize (BZ)",
                "Benin (BJ)",
                "Bermuda (BM)",
                "Bhutan (BT)",
                "Bolivia (BO)",
                "Caribbean Netherlands (BQ)",
                "Bosnia & Herzegovina (BA)",
                "Botswana (BW)",
                "Bouvet Island (BV)",
                "Brazil (BR)",
                "British Indian Ocean Territory (IO)",
                "Brunei (BN)",
                "Bulgaria (BG)",
                "Burkina Faso (BF)",
                "Burundi (BI)",
                "Cape Verde (CV)",
                "Cambodia (KH)",
                "Cameroon (CM)",
                "Canada (CA)",
                "Cayman Islands (KY)",
                "Central African Republic (CF)",
                "Chad (TD)",
                "Chile (CL)",
                "China (CN)",
                "Christmas Island (CX)",
                "Cocos (Keeling) Islands (CC)",
                "Colombia (CO)",
                "Comoros (KM)",
                "Congo - Brazzaville (CG)",
                "Congo - Kinshasa (CD)",
                "Cook Islands (CK)",
                "Costa Rica (CR)",
                "Côte d’Ivoire (CI)",
                "Croatia (HR)",
                "Cuba (CU)",
                "Curaçao (CW)",
                "Cyprus (CY)",
                "Czechia (CZ)",
                "Denmark (DK)",
                "Djibouti (DJ)",
                "Dominica (DM)",
                "Dominican Republic (DO)",
                "Ecuador (EC)",
                "Egypt (EG)",
                "El Salvador (SV)",
                "Equatorial Guinea (GQ)",
                "Eritrea (ER)",
                "Estonia (EE)",
                "Eswatini (SZ)",
                "Ethiopia (ET)",
                "Falkland Islands (FK)",
                "Faroe Islands (FO)",
                "Fiji (FJ)",
                "Finland (FI)",
                "France (FR)",
                "French Guiana (GF)",
                "French Polynesia (PF)",
                "French Southern Territories (TF)",
                "Gabon (GA)",
                "Gambia (GM)",
                "Georgia (GE)",
                "Germany (DE)",
                "Ghana (GH)",
                "Gibraltar (GI)",
                "Greece (GR)",
                "Greenland (GL)",
                "Grenada (GD)",
                "Guadeloupe (GP)",
                "Guam (GU)",
                "Guatemala (GT)",
                "Guernsey (GG)",
                "Guinea (GN)",
                "Guinea-Bissau (GW)",
                "Guyana (GY)",
                "Haiti (HT)",
                "Heard & McDonald Islands (HM)",
                "Vatican City (VA)",
                "Honduras (HN)",
                "Hong Kong SAR China (HK)",
                "Hungary (HU)",
                "Iceland (IS)",
                "India (IN)",
                "Indonesia (ID)",
                "Iran (IR)",
                "Iraq (IQ)",
                "Ireland (IE)",
                "Isle of Man (IM)",
                "Israel (IL)",
                "Italy (IT)",
                "Jamaica (JM)",
                "Japan (JP)",
                "Jersey (JE)",
                "Jordan (JO)",
                "Kazakhstan (KZ)",
                "Kenya (KE)",
                "Kiribati (KI)",
                "North Korea (KP)",
                "South Korea (KR)",
                "Kuwait (KW)",
                "Kyrgyzstan (KG)",
                "Laos (LA)",
                "Latvia (LV)",
                "Lebanon (LB)",
                "Lesotho (LS)",
                "Liberia (LR)",
                "Libya (LY)",
                "Liechtenstein (LI)",
                "Lithuania (LT)",
                "Luxembourg (LU)",
                "Macao SAR China (MO)",
                "Madagascar (MG)",
                "Malawi (MW)",
                "Malaysia (MY)",
                "Maldives (MV)",
                "Mali (ML)",
                "Malta (MT)",
                "Marshall Islands (MH)",
                "Martinique (MQ)",
                "Mauritania (MR)",
                "Mauritius (MU)",
                "Mayotte (YT)",
                "Mexico (MX)",
                "Micronesia (FM)",
                "Moldova (MD)",
                "Monaco (MC)",
                "Mongolia (MN)",
                "Montenegro (ME)",
                "Montserrat (MS)",
                "Morocco (MA)",
                "Mozambique (MZ)",
                "Myanmar (Burma) (MM)",
                "Namibia (NA)",
                "Nauru (NR)",
                "Nepal (NP)",
                "Netherlands (NL)",
                "New Caledonia (NC)",
                "New Zealand (NZ)",
                "Nicaragua (NI)",
                "Niger (NE)",
                "Nigeria (NG)",
                "Niue (NU)",
                "Norfolk Island (NF)",
                "North Macedonia (MK)",
                "Northern Mariana Islands (MP)",
                "Norway (NO)",
                "Oman (OM)",
                "Pakistan (PK)",
                "Palau (PW)",
                "Palestinian Territories (PS)",
                "Panama (PA)",
                "Papua New Guinea (PG)",
                "Paraguay (PY)",
                "Peru (PE)",
                "Philippines (PH)",
                "Pitcairn Islands (PN)",
                "Poland (PL)",
                "Portugal (PT)",
                "Puerto Rico (PR)",
                "Qatar (QA)",
                "Réunion (RE)",
                "Romania (RO)",
                "Russia (RU)",
                "Rwanda (RW)",
                "St. Barthélemy (BL)",
                "St. Helena (SH)",
                "St. Kitts & Nevis (KN)",
                "St. Lucia (LC)",
                "St. Martin (MF)",
                "St. Pierre & Miquelon (PM)",
                "St. Vincent & Grenadines (VC)",
                "Samoa (WS)",
                "San Marino (SM)",
                "São Tomé & Príncipe (ST)",
                "Saudi Arabia (SA)",
                "Senegal (SN)",
                "Serbia (RS)",
                "Seychelles (SC)",
                "Sierra Leone (SL)",
                "Singapore (SG)",
                "Sint Maarten (SX)",
                "Slovakia (SK)",
                "Slovenia (SI)",
                "Solomon Islands (SB)",
                "Somalia (SO)",
                "South Africa (ZA)",
                "South Georgia & South Sandwich Islands (GS)",
                "South Sudan (SS)",
                "Spain (ES)",
                "Sri Lanka (LK)",
                "Sudan (SD)",
                "Suriname (SR)",
                "Svalbard & Jan Mayen (SJ)",
                "Sweden (SE)",
                "Switzerland (CH)",
                "Syria (SY)",
                "Taiwan (TW)",
                "Tajikistan (TJ)",
                "Tanzania (TZ)",
                "Thailand (TH)",
                "Timor-Leste (TL)",
                "Togo (TG)",
                "Tokelau (TK)",
                "Tonga (TO)",
                "Trinidad & Tobago (TT)",
                "Tunisia (TN)",
                "Türkiye (TR)",
                "Turkmenistan (TM)",
                "Turks & Caicos Islands (TC)",
                "Tuvalu (TV)",
                "Uganda (UG)",
                "Ukraine (UA)",
                "United Arab Emirates (AE)",
                "United Kingdom (GB)",
                "United States (US)",
                "U.S. Outlying Islands (UM)",
                "Uruguay (UY)",
                "Uzbekistan (UZ)",
                "Vanuatu (VU)",
                "Venezuela (VE)",
                "Vietnam (VN)",
                "British Virgin Islands (VG)",
                "U.S. Virgin Islands (VI)",
                "Wallis & Futuna (WF)",
                "Western Sahara (EH)",
                "Yemen (YE)",
                "Zambia (ZM)",
                "Zimbabwe (ZW)"
              ]
            }
          },
          "adType": {
            "title": "Ad category",
            "enum": [
              "all",
              "political_and_issue_ads",
              "housing_ads",
              "employment_ads",
              "financial_products_and_services_ads"
            ],
            "type": "string",
            "description": "The Ad Library category. \"All ads\" covers commercial ads. Political ads carry spend, impressions, audience size and paid-for-by data; housing, employment and financial categories are the regulated US categories.",
            "default": "all"
          },
          "activeStatus": {
            "title": "Active status",
            "enum": [
              "all",
              "active",
              "inactive"
            ],
            "type": "string",
            "description": "Active (running now), inactive (ended) or both.",
            "default": "all"
          },
          "mediaType": {
            "title": "Media type",
            "enum": [
              "all",
              "image",
              "meme",
              "image_and_meme",
              "video",
              "none"
            ],
            "type": "string",
            "description": "Images, memes (images with text), images and memes, videos, or ads with no image or video (text only).",
            "default": "all"
          },
          "publisherPlatforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Keep ads that ran on at least one of the selected placements. Empty = any platform.",
            "items": {
              "type": "string",
              "enum": [
                "facebook",
                "instagram",
                "audience_network",
                "messenger",
                "whatsapp",
                "threads"
              ],
              "enumTitles": [
                "Facebook",
                "Instagram",
                "Audience Network",
                "Messenger",
                "WhatsApp",
                "Threads"
              ]
            }
          },
          "contentLanguages": {
            "title": "Ad languages",
            "type": "array",
            "description": "Language of the ad text (ISO 639-1). Empty = any language. Through the API any two-letter code or English language name is accepted.",
            "items": {
              "type": "string",
              "enum": [
                "en",
                "es",
                "fr",
                "de",
                "it",
                "pt",
                "nl",
                "pl",
                "ru",
                "uk",
                "tr",
                "ar",
                "he",
                "hi",
                "bn",
                "ur",
                "ta",
                "te",
                "mr",
                "gu",
                "id",
                "ms",
                "th",
                "vi",
                "tl",
                "ja",
                "ko",
                "zh",
                "sv",
                "da",
                "no",
                "fi",
                "cs",
                "sk",
                "hu",
                "ro",
                "bg",
                "el",
                "hr",
                "sr",
                "sl",
                "lt",
                "lv",
                "et",
                "fa",
                "sw",
                "af",
                "ca",
                "ka",
                "hy",
                "az",
                "kk",
                "uz",
                "km",
                "my",
                "si",
                "ne",
                "am",
                "ha",
                "yo",
                "ig",
                "zu",
                "so",
                "is",
                "ga",
                "cy",
                "eu",
                "gl",
                "mk",
                "sq",
                "bs",
                "mt",
                "lo",
                "mn",
                "ps",
                "ku"
              ],
              "enumTitles": [
                "English (en)",
                "Spanish (es)",
                "French (fr)",
                "German (de)",
                "Italian (it)",
                "Portuguese (pt)",
                "Dutch (nl)",
                "Polish (pl)",
                "Russian (ru)",
                "Ukrainian (uk)",
                "Turkish (tr)",
                "Arabic (ar)",
                "Hebrew (he)",
                "Hindi (hi)",
                "Bengali (bn)",
                "Urdu (ur)",
                "Tamil (ta)",
                "Telugu (te)",
                "Marathi (mr)",
                "Gujarati (gu)",
                "Indonesian (id)",
                "Malay (ms)",
                "Thai (th)",
                "Vietnamese (vi)",
                "Filipino (tl)",
                "Japanese (ja)",
                "Korean (ko)",
                "Chinese (zh)",
                "Swedish (sv)",
                "Danish (da)",
                "Norwegian (no)",
                "Finnish (fi)",
                "Czech (cs)",
                "Slovak (sk)",
                "Hungarian (hu)",
                "Romanian (ro)",
                "Bulgarian (bg)",
                "Greek (el)",
                "Croatian (hr)",
                "Serbian (sr)",
                "Slovenian (sl)",
                "Lithuanian (lt)",
                "Latvian (lv)",
                "Estonian (et)",
                "Persian (fa)",
                "Swahili (sw)",
                "Afrikaans (af)",
                "Catalan (ca)",
                "Georgian (ka)",
                "Armenian (hy)",
                "Azerbaijani (az)",
                "Kazakh (kk)",
                "Uzbek (uz)",
                "Khmer (km)",
                "Burmese (my)",
                "Sinhala (si)",
                "Nepali (ne)",
                "Amharic (am)",
                "Hausa (ha)",
                "Yoruba (yo)",
                "Igbo (ig)",
                "Zulu (zu)",
                "Somali (so)",
                "Icelandic (is)",
                "Irish (ga)",
                "Welsh (cy)",
                "Basque (eu)",
                "Galician (gl)",
                "Macedonian (mk)",
                "Albanian (sq)",
                "Bosnian (bs)",
                "Maltese (mt)",
                "Lao (lo)",
                "Mongolian (mn)",
                "Pashto (ps)",
                "Kurdish (ku)"
              ]
            }
          },
          "deliveredWithinDays": {
            "title": "Impressions within the last",
            "enum": [
              "any",
              "1",
              "7",
              "14",
              "30",
              "90",
              "365"
            ],
            "type": "string",
            "description": "The Ad Library \"Impressions by date\" filter: ads that were shown in this window (not ads that started in it). Any number of days works through the API.",
            "default": "any"
          },
          "deliveredAfter": {
            "title": "Impressions from (exact date)",
            "type": "string",
            "description": "Start of the impressions window (YYYY-MM-DD). Overrides the relative window."
          },
          "deliveredBefore": {
            "title": "Impressions to (exact date)",
            "type": "string",
            "description": "End of the impressions window (YYYY-MM-DD)."
          },
          "sortBy": {
            "title": "Sort",
            "enum": [
              "total_impressions_desc",
              "total_impressions_asc",
              "most_recent",
              "default"
            ],
            "type": "string",
            "description": "Order of results, exactly as the Ad Library offers it. Impressions sorting is most useful for political ads (where impressions are published).",
            "default": "default"
          },
          "isTargetedCountry": {
            "title": "Only ads targeted at the country",
            "type": "boolean",
            "description": "The Ad Library \"is_targeted_country\" switch: keep only ads whose advertiser targeted the selected country, rather than ads that merely reached people there.",
            "default": false
          },
          "bylines": {
            "title": "Paid for by (political)",
            "type": "array",
            "description": "Exact disclaimer labels, e.g. \"VOTEVETS\". Political ads only.",
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Delivery regions (political)",
            "type": "array",
            "description": "Region names as the Ad Library shows them, e.g. \"California\", \"Texas\". Political ads only.",
            "items": {
              "type": "string"
            }
          },
          "audienceSizeMin": {
            "title": "Estimated audience size, minimum",
            "minimum": 0,
            "type": "integer",
            "description": "Lower bound of the Ad Library audience-size buckets (100, 1000, 5000, 10000, 50000, 100000, 500000, 1000000). Political ads only."
          },
          "audienceSizeMax": {
            "title": "Estimated audience size, maximum",
            "minimum": 0,
            "type": "integer",
            "description": "Upper bound (1000, 5000, 10000, 50000, 100000, 500000, 1000000; leave empty for no upper bound). Political ads only."
          },
          "minDaysRunning": {
            "title": "Minimum days running",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only ads that have run at least this many days (inactive ads: their total run length). A quick \"proven winner\" filter. Free."
          },
          "minCollationCount": {
            "title": "Minimum creative reuse",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only ads whose creative is used by at least this many ads (the \"N ads use this creative and text\" number). Free."
          },
          "displayFormats": {
            "title": "Creative formats",
            "type": "array",
            "description": "Keep only these creative formats. DCO = dynamic creative, DPA = catalogue (product) ads.",
            "items": {
              "type": "string",
              "enum": [
                "IMAGE",
                "VIDEO",
                "CAROUSEL",
                "MULTI_IMAGES",
                "DCO",
                "DPA",
                "TEXT",
                "MULTI_VIDEOS",
                "EVENT"
              ]
            }
          },
          "mustIncludeText": {
            "title": "Ad text must contain",
            "type": "array",
            "description": "Keep ads whose text, title, caption, page name or link contains at least one of these (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "mustExcludeText": {
            "title": "Ad text must not contain",
            "type": "array",
            "description": "Drop ads containing any of these.",
            "items": {
              "type": "string"
            }
          },
          "excludePageIds": {
            "title": "Exclude pages",
            "type": "array",
            "description": "Page IDs or page URLs whose ads should be dropped.",
            "items": {
              "type": "string"
            }
          },
          "onlyActiveNow": {
            "title": "Drop inactive ads (post-filter)",
            "type": "boolean",
            "description": "Client-side safety net on top of the Active status filter.",
            "default": false
          },
          "maxAds": {
            "title": "Max ads (total)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on delivered, charged ads for the whole run. Honoured exactly: you never receive or pay for more. Through the API, 0 means no cap."
          },
          "maxAdsPerQuery": {
            "title": "Max ads per query",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap per keyword x country (or page x country). Defaults to the total cap."
          },
          "onlyTotalCount": {
            "title": "Only count matching ads (free)",
            "type": "boolean",
            "description": "Do not fetch ads: return one row per query with the Ad Library total (\">50,000\" shows as 50001). Free, so you can size a job before paying.",
            "default": false
          },
          "fetchAdDetails": {
            "title": "Fetch ad details",
            "type": "boolean",
            "description": "Adds the \"See ad details\" data per ad: advertiser profile (page likes, category, verification, Instagram handle and followers, lifetime spend by disclaimer), EU (DSA) transparency (reach by country, age and gender, targeting), political insights (age / gender and region distribution) and payer / beneficiary. $0.25 per 1,000 ads that got details."
          },
          "resolveLandingPages": {
            "title": "Resolve landing pages",
            "type": "boolean",
            "description": "Follows the ad link through redirects (l.facebook.com wrappers, shorteners, trackers) to the final URL and domain. $0.20 per 1,000 pages that answered. Facebook / Instagram destinations and catalogue templates are skipped."
          },
          "memoryName": {
            "title": "Memory name (only new ads on later runs)",
            "type": "string",
            "description": "Name this search, e.g. \"competitor-watch\". Ads delivered under that name are remembered in your account (key-value store \"ads-library-memory-<name>\") and never delivered or charged again. Schedule the run and you have a free change feed."
          },
          "emitKnownAds": {
            "title": "Also return already-known ads (free, flagged)",
            "type": "boolean",
            "description": "Re-send ads the memory already knows, marked isKnown = true with changeType DUPLICATE or UPDATED (status, dates, spend or creative changed). Never charged.",
            "default": false
          },
          "resetMemory": {
            "title": "Reset this memory first",
            "type": "boolean",
            "description": "Forget everything stored under the memory name before running.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Leave empty: the Actor uses Apify residential proxies for the Ad Library API calls (Meta blocks datacenter IPs) and a datacenter proxy for page loads. Set your own only if you know why."
          },
          "maxConcurrency": {
            "title": "Parallel queries",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many queries (keyword x country) run at the same time, each on its own IP. 3 is a good default; 6-8 for big multi-country jobs.",
            "default": 3
          },
          "maxIpRetries": {
            "title": "IP retries per query",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "Roughly half of residential IPs are rate-limited by the Ad Library; the Actor rotates to a fresh IP automatically. 6 tries gives above 99 % success.",
            "default": 6
          },
          "maxEmptyPages": {
            "title": "Stop after N empty pages",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Deep result pages get thin; after this many consecutive empty pages the query is marked partial and stops.",
            "default": 3
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}