{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Ad Library Byline & Advertiser Ad Finder",
    "description": "Pull Facebook Ad Library ads by advertiser Page ID, keyword, Ad ID, or \"Paid for by\" byline, with ad text, media, run dates, creative-reuse counts, and spend or impression ranges for political ads.",
    "version": "1.0",
    "x-build-id": "m9SEVLoISWJhDLniO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nimbryxo-studio~facebook-ad-library-byline-and-advertiser-ad/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nimbryxo-studio-facebook-ad-library-byline-and-advertiser-ad",
        "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/nimbryxo-studio~facebook-ad-library-byline-and-advertiser-ad/runs": {
      "post": {
        "operationId": "runs-sync-nimbryxo-studio-facebook-ad-library-byline-and-advertiser-ad",
        "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/nimbryxo-studio~facebook-ad-library-byline-and-advertiser-ad/run-sync": {
      "post": {
        "operationId": "run-sync-nimbryxo-studio-facebook-ad-library-byline-and-advertiser-ad",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "",
              "search",
              "byPage",
              "byAdId",
              "byByline"
            ],
            "type": "string",
            "description": "What to scrape. Leave empty to process every target list you filled in (searchTerms, pageIds, adIds, bylines) in one run.",
            "default": ""
          },
          "searchTerms": {
            "title": "Search Terms",
            "type": "array",
            "description": "Keywords to search for in the Ad Library, one search per term. Example: [\"coffee\", \"nike\"].",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "pageIds": {
            "title": "Page IDs / Advertiser Search",
            "type": "array",
            "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.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "adIds": {
            "title": "Direct Ad IDs",
            "type": "array",
            "description": "Ad Library IDs to fetch directly (numeric IDs or Ads Library URLs containing ?id=). All other filters are ignored in this mode.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "bylines": {
            "title": "Search by \"Paid for by\" name",
            "type": "array",
            "description": "Funding-entity / committee names from the \"Paid for by\" disclaimer on political and issue ads. The actor tries the exact-cased name, retries the original casing, and re-checks each returned ad's byline client-side. Non-EU targets search the political & issue archive; EU/EEA targets use the all-ad-types EU DSA stream (the political archive returns zero there) and may return no byline match because Meta does not always expose it.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "country": {
            "title": "Country",
            "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"
            ],
            "type": "string",
            "description": "Country to search ads in, or ALL for every country. Ignored when the Countries multi-select below is set.",
            "default": "ALL"
          },
          "countries": {
            "title": "Countries (multi-select)",
            "uniqueItems": true,
            "type": "array",
            "description": "One or more country codes, searched together as a union (unlike the single Country field). Takes precedence over Country when set.",
            "items": {
              "type": "string",
              "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"
              ]
            },
            "default": []
          },
          "adActiveStatus": {
            "title": "Ad Status",
            "enum": [
              "all",
              "active",
              "inactive"
            ],
            "type": "string",
            "description": "Filter by ad active status.",
            "default": "active"
          },
          "adType": {
            "title": "Ad Type",
            "enum": [
              "all",
              "political_and_issue_ads",
              "housing",
              "employment",
              "credit"
            ],
            "type": "string",
            "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).",
            "default": "all"
          },
          "mediaType": {
            "title": "Media Type",
            "enum": [
              "all",
              "image",
              "video",
              "meme",
              "none"
            ],
            "type": "string",
            "description": "Filter by the ad's creative media type. `meme` is applied server-side only; Meta's payload has no meme marker, so output `media_type` is always image, video or none.",
            "default": "all"
          },
          "publisherPlatforms": {
            "title": "Publisher Platforms",
            "uniqueItems": true,
            "type": "array",
            "description": "Only return ads shown on these platforms. Leave empty for all platforms.",
            "items": {
              "type": "string",
              "enum": [
                "FACEBOOK",
                "INSTAGRAM",
                "MESSENGER",
                "AUDIENCE_NETWORK",
                "WHATSAPP",
                "THREADS"
              ],
              "enumTitles": [
                "Facebook",
                "Instagram",
                "Messenger",
                "Audience Network",
                "WhatsApp",
                "Threads"
              ]
            },
            "default": []
          },
          "contentLanguages": {
            "title": "Ad Content Languages",
            "uniqueItems": true,
            "type": "array",
            "description": "Only return ads whose creative is written in one of these languages. 2-letter ISO 639-1 codes; leave empty for every language.",
            "items": {
              "type": "string",
              "enum": [
                "aa",
                "ab",
                "ae",
                "af",
                "ak",
                "am",
                "an",
                "ar",
                "as",
                "av",
                "ay",
                "az",
                "ba",
                "be",
                "bg",
                "bi",
                "bm",
                "bn",
                "bo",
                "br",
                "bs",
                "ca",
                "ce",
                "ch",
                "co",
                "cr",
                "cs",
                "cu",
                "cv",
                "cy",
                "da",
                "de",
                "dv",
                "dz",
                "ee",
                "el",
                "en",
                "eo",
                "es",
                "et",
                "eu",
                "fa",
                "ff",
                "fi",
                "fj",
                "fo",
                "fr",
                "fy",
                "ga",
                "gd",
                "gl",
                "gn",
                "gu",
                "gv",
                "ha",
                "he",
                "hi",
                "ho",
                "hr",
                "ht",
                "hu",
                "hy",
                "hz",
                "ia",
                "id",
                "ie",
                "ig",
                "ii",
                "ik",
                "io",
                "is",
                "it",
                "iu",
                "ja",
                "jv",
                "ka",
                "kg",
                "ki",
                "kj",
                "kk",
                "kl",
                "km",
                "kn",
                "ko",
                "kr",
                "ks",
                "ku",
                "kv",
                "kw",
                "ky",
                "la",
                "lb",
                "lg",
                "li",
                "ln",
                "lo",
                "lt",
                "lu",
                "lv",
                "mg",
                "mh",
                "mi",
                "mk",
                "ml",
                "mn",
                "mr",
                "ms",
                "mt",
                "my",
                "na",
                "nb",
                "nd",
                "ne",
                "ng",
                "nl",
                "nn",
                "no",
                "nr",
                "nv",
                "ny",
                "oc",
                "oj",
                "om",
                "or",
                "os",
                "pa",
                "pi",
                "pl",
                "ps",
                "pt",
                "qu",
                "rm",
                "rn",
                "ro",
                "ru",
                "rw",
                "sa",
                "sc",
                "sd",
                "se",
                "sg",
                "si",
                "sk",
                "sl",
                "sm",
                "sn",
                "so",
                "sq",
                "sr",
                "ss",
                "st",
                "su",
                "sv",
                "sw",
                "ta",
                "te",
                "tg",
                "th",
                "ti",
                "tk",
                "tl",
                "tn",
                "to",
                "tr",
                "ts",
                "tt",
                "tw",
                "ty",
                "ug",
                "uk",
                "ur",
                "uz",
                "ve",
                "vi",
                "vo",
                "wa",
                "wo",
                "xh",
                "yi",
                "yo",
                "za",
                "zh",
                "zu"
              ],
              "enumTitles": [
                "Afar",
                "Abkhazian",
                "Avestan",
                "Afrikaans",
                "Akan",
                "Amharic",
                "Aragonese",
                "Arabic",
                "Assamese",
                "Avaric",
                "Aymara",
                "Azerbaijani",
                "Bashkir",
                "Belarusian",
                "Bulgarian",
                "Bislama",
                "Bambara",
                "Bengali",
                "Tibetan",
                "Breton",
                "Bosnian",
                "Catalan",
                "Chechen",
                "Chamorro",
                "Corsican",
                "Cree",
                "Czech",
                "Church Slavic",
                "Chuvash",
                "Welsh",
                "Danish",
                "German",
                "Divehi",
                "Dzongkha",
                "Ewe",
                "Greek",
                "English",
                "Esperanto",
                "Spanish",
                "Estonian",
                "Basque",
                "Persian",
                "Fulah",
                "Finnish",
                "Fijian",
                "Faroese",
                "French",
                "Western Frisian",
                "Irish",
                "Scottish Gaelic",
                "Galician",
                "Guarani",
                "Gujarati",
                "Manx",
                "Hausa",
                "Hebrew",
                "Hindi",
                "Hiri Motu",
                "Croatian",
                "Haitian Creole",
                "Hungarian",
                "Armenian",
                "Herero",
                "Interlingua",
                "Indonesian",
                "Interlingue",
                "Igbo",
                "Sichuan Yi",
                "Inupiaq",
                "Ido",
                "Icelandic",
                "Italian",
                "Inuktitut",
                "Japanese",
                "Javanese",
                "Georgian",
                "Kongo",
                "Kikuyu",
                "Kuanyama",
                "Kazakh",
                "Kalaallisut",
                "Khmer",
                "Kannada",
                "Korean",
                "Kanuri",
                "Kashmiri",
                "Kurdish",
                "Komi",
                "Cornish",
                "Kyrgyz",
                "Latin",
                "Luxembourgish",
                "Ganda",
                "Limburgish",
                "Lingala",
                "Lao",
                "Lithuanian",
                "Luba-Katanga",
                "Latvian",
                "Malagasy",
                "Marshallese",
                "Maori",
                "Macedonian",
                "Malayalam",
                "Mongolian",
                "Marathi",
                "Malay",
                "Maltese",
                "Burmese",
                "Nauru",
                "Norwegian Bokmal",
                "North Ndebele",
                "Nepali",
                "Ndonga",
                "Dutch",
                "Norwegian Nynorsk",
                "Norwegian",
                "South Ndebele",
                "Navajo",
                "Chichewa",
                "Occitan",
                "Ojibwa",
                "Oromo",
                "Oriya",
                "Ossetian",
                "Punjabi",
                "Pali",
                "Polish",
                "Pashto",
                "Portuguese",
                "Quechua",
                "Romansh",
                "Rundi",
                "Romanian",
                "Russian",
                "Kinyarwanda",
                "Sanskrit",
                "Sardinian",
                "Sindhi",
                "Northern Sami",
                "Sango",
                "Sinhala",
                "Slovak",
                "Slovenian",
                "Samoan",
                "Shona",
                "Somali",
                "Albanian",
                "Serbian",
                "Swati",
                "Southern Sotho",
                "Sundanese",
                "Swedish",
                "Swahili",
                "Tamil",
                "Telugu",
                "Tajik",
                "Thai",
                "Tigrinya",
                "Turkmen",
                "Tagalog",
                "Tswana",
                "Tonga",
                "Turkish",
                "Tsonga",
                "Tatar",
                "Twi",
                "Tahitian",
                "Uyghur",
                "Ukrainian",
                "Urdu",
                "Uzbek",
                "Venda",
                "Vietnamese",
                "Volapuk",
                "Walloon",
                "Wolof",
                "Xhosa",
                "Yiddish",
                "Yoruba",
                "Zhuang",
                "Chinese",
                "Zulu"
              ]
            },
            "default": []
          },
          "searchType": {
            "title": "Keyword Match",
            "enum": [
              "keyword_unordered",
              "keyword_exact_phrase"
            ],
            "type": "string",
            "description": "How keyword search terms are matched (mode=search only).",
            "default": "keyword_unordered"
          },
          "startDate": {
            "title": "Start Date",
            "type": "string",
            "description": "Only include ads that had impressions on or after this date (YYYY-MM-DD). Combined with End Date it forms a delivery window."
          },
          "endDate": {
            "title": "End Date",
            "type": "string",
            "description": "Only include ads that had impressions on or before this date (YYYY-MM-DD)."
          },
          "sortBy": {
            "title": "Sort By",
            "enum": [
              "relevance",
              "total_impressions"
            ],
            "type": "string",
            "description": "Order results by relevance (Facebook's default) or by total impressions.",
            "default": "relevance"
          },
          "resultsPerSearch": {
            "title": "Results Per Search Term",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of ads to extract per search term / page / ad / byline.",
            "default": 50
          },
          "maxItems": {
            "title": "Max Ads (global)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop the whole run after this many ads, across all search targets.",
            "default": 1000
          },
          "includeEuDetails": {
            "title": "Include EU Transparency & Advertiser Details",
            "type": "boolean",
            "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.",
            "default": true
          },
          "rehostMedia": {
            "title": "Rehost Media URLs",
            "type": "boolean",
            "description": "Copy each ad's primary media (up to 15 MB) 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; media_rehost_status records rehosted/disabled/too_large/download_failed/kv_failed. Arrays, carousel cards and Page profile/cover URLs stay signed.",
            "default": true
          },
          "onlyTotal": {
            "title": "Only Total Results",
            "type": "boolean",
            "description": "Skip ad scraping and return one total per search target per country (one lightweight page request per country, 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 or direct ad-ID targets, which get an unsupported_total diagnostic.",
            "default": false
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}