{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Ads Scraper Pro",
    "description": "Extract Facebook Ad Library data: creatives, targeting & metrics. $0.40 = 1,000 Successful Ad scrapeds * cheaper & more complete. 📱",
    "version": "0.3",
    "x-build-id": "7MbiPRvyd3HRG0hk3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dz_omar~facebook-ads-scraper-pro/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dz_omar-facebook-ads-scraper-pro",
        "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/dz_omar~facebook-ads-scraper-pro/runs": {
      "post": {
        "operationId": "runs-sync-dz_omar-facebook-ads-scraper-pro",
        "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/dz_omar~facebook-ads-scraper-pro/run-sync": {
      "post": {
        "operationId": "run-sync-dz_omar-facebook-ads-scraper-pro",
        "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": {
          "URLAds": {
            "title": "🔗 Facebook Ad Library URLs (optional)",
            "type": "array",
            "description": "Paste Facebook Ad Library URLs to scrape directly. The actor will parse each URL and run the search automatically. If provided, URLs are processed first, followed by any Search Keywords and Advertisers below.\n\n**💡 How it works:**\n- Copy a URL from [Facebook Ad Library](https://www.facebook.com/ads/library/) and paste it here\n- All filters from the URL (country, language, date range, media type, etc.) are extracted automatically\n- `Max Results Per Search` controls how many ads are collected per URL\n- You can mix URLs with manual search fields — all run sequentially\n\n**📌 Single ad links supported:**\n- URLs like `?id=xxxxxxxxxxxx` will fetch that specific ad directly\n- Works with the enrichment toggle to get full ad details",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchQueries": {
            "title": "🔍 Search Keywords",
            "type": "array",
            "description": "**Search terms to find Facebook ads** 🎯\n\nEnter keywords, phrases, or brand names to search for in Facebook's Ad Library:\n\n**Examples:**\n- Brand names: \"Nike\", \"Apple\", \"Coca-Cola\"\n- Product categories: \"fitness app\", \"crypto wallet\", \"online course\"\n- Industry terms: \"digital marketing\", \"e-commerce\", \"SaaS\"\n- Campaign themes: \"Black Friday\", \"back to school\", \"summer sale\"\n\n**💡 Tips:**\n- Use specific terms for better results\n- Mix broad and specific keywords\n- Each query runs separately and results are combined\n- Empty queries will be skipped",
            "items": {
              "type": "string"
            }
          },
          "searchAdvertisers": {
            "title": "🏢 Search Advertisers",
            "type": "array",
            "description": "**Search by specific advertiser/page names or Page IDs** 🎯\n\nEnter advertiser names or Facebook Page IDs to fetch ads from specific pages:\n\n**Examples:**\n- Advertiser names: \"Nike\", \"Nike Football\", \"Apple\"\n- Page IDs: \"15087023444\", \"51212153078\"\n- Mixed: [\"Nike\", \"15087023444\"]\n\n**💡 How it works:**\n- **Name match**: If you enter \"Nike Football\", the scraper will find ALL Facebook pages with exactly that name and fetch ads from each\n- **Page ID**: If you enter a numeric ID like \"15087023444\", it goes directly to that page\n- **Multiple matches**: Some names like \"Nike Football\" may match multiple pages - ads will be fetched from ALL matching pages\n\n**⚠️ Important:**\n- Each advertiser query uses your `maxResultsPerQuery` limit **per matching page**\n- Example: \"Nike Football\" matches 3 pages + maxResults=100 = 300 ads total\n- Names must match exactly (case-insensitive)\n\n**🔍 Tips:**\n- Use specific names for better matching\n- Check Facebook Ad Library to verify exact page names\n- Use Page IDs for precise targeting\n- Leave empty to skip advertiser search",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerQuery": {
            "title": "📊 Max Results Per Search",
            "minimum": 10,
            "type": "integer",
            "description": "**Maximum ads to collect per search** 📈\n\nThis limit applies to **every search source** in your run:\n- 📌 **Per URL** — each Ad Library URL collects up to this many ads\n- 🔍 **Per keyword** — each search query collects up to this many ads\n- 🏢 **Per advertiser page** — each resolved advertiser page collects up to this many ads\n\n**Example:** 2 URLs + 3 keywords + 2 advertisers with `maxResultsPerQuery = 50`\n→ Up to 50 ads × 7 sources = up to **350 ads total**\n\n- **Default: 10** — Good for quick tests\n- **50–200** — Recommended for most use cases\n- **💡 Note:** Actual results may be lower if Facebook has fewer matching ads",
            "default": 10
          },
          "enrichWithAdDetails": {
            "title": "🔍 Enrich with Ad Details",
            "type": "boolean",
            "description": "**Fetch full ad details for each result** 📊\n\nWhen enabled, the scraper makes an additional request per ad to fetch rich advertiser and targeting data:\n\n**Extra data included:**\n- 🏢 **Advertiser info**: page about text, category, likes, profile photo, cover photo, verification status\n- 📷 **Instagram**: username, followers, verification\n- 🎯 **Targeting (EU)**: location audience, age/gender breakdown, total reach\n- 💰 **Payer/Beneficiary**: who paid for and benefits from the ad\n- ⚠️ **Violations**: any policy violation types\n\n**⚠️ Note:** Enabling this will slow down scraping since each ad requires an extra API call. Recommended for smaller result sets (< 200 ads).",
            "default": false
          },
          "sortBy": {
            "title": "📊 Sort Results By",
            "enum": [
              "SORT_BY_TOTAL_IMPRESSIONS",
              "SORT_BY_RELEVANCY_MONTHLY_GROUPED"
            ],
            "type": "string",
            "description": "**Order search results** 📈\n\n- **Impressions (High to Low)**: Most viewed ads first (recommended)\n- **Most Recent**: Newest ads first\n\n**💡 Tip:** Sort by impressions to see the most successful/popular ads",
            "default": "SORT_BY_TOTAL_IMPRESSIONS"
          },
          "countries": {
            "title": "🌍 Target Countries",
            "enum": [
              "ALL",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BQ",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "VG",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CW",
              "CY",
              "CZ",
              "CD",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "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",
              "MK",
              "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",
              "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",
              "SZ",
              "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",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW",
              "AF"
            ],
            "type": "string",
            "description": "**Filter ads by country targeting** 🗺️\n\n**Popular Options:**\n- **US** - United States (largest ad market)\n- **CA** - Canada\n- **GB** - United Kingdom\n- **AU** - Australia\n- **DE** - Germany\n- **FR** - France\n- **ES** - Spain\n- **IT** - Italy\n- **BR** - Brazil\n- **IN** - India\n- **JP** - Japan\n\n**💡 Use ISO 2-letter country codes** (e.g., US, CA, GB)"
          },
          "contentLanguages": {
            "title": "🗣️ Content Languages",
            "type": "array",
            "description": "**Filter ads by content language** 🔤\n\n**Common Languages:**\n- **en** - English\n- **es** - Spanish\n- **fr** - French\n- **de** - German\n- **it** - Italian\n- **pt** - Portuguese\n- **ja** - Japanese\n- **ko** - Korean\n- **zh** - Chinese\n- **ar** - Arabic\n\n**💡 Use ISO 2-letter language codes**",
            "items": {
              "type": "string",
              "enum": [
                "",
                "en",
                "es",
                "fr",
                "de",
                "it",
                "pt",
                "ja",
                "ko",
                "zh",
                "ar",
                "ru",
                "hi",
                "tr",
                "pl",
                "nl",
                "sv",
                "da",
                "no",
                "fi",
                "el",
                "he",
                "th",
                "vi",
                "id",
                "ms",
                "tl",
                "uk",
                "cs",
                "sk",
                "hu",
                "ro",
                "bg",
                "hr",
                "sr",
                "sl",
                "et",
                "lv",
                "lt",
                "mt",
                "ga",
                "cy",
                "is",
                "fo",
                "lb",
                "rm",
                "eu",
                "ca",
                "gl",
                "oc",
                "br",
                "kw",
                "gd",
                "gv",
                "nn",
                "se",
                "be",
                "mk",
                "sq",
                "bs",
                "me",
                "xk",
                "sm",
                "ad",
                "li",
                "mc",
                "va"
              ],
              "enumTitles": [
                "All languages 🌐",
                "English 🇺🇸",
                "Spanish 🇪🇸",
                "French 🇫🇷",
                "German 🇩🇪",
                "Italian 🇮🇹",
                "Portuguese 🇵🇹",
                "Japanese 🇯🇵",
                "Korean 🇰🇷",
                "Chinese 🇨🇳",
                "Arabic 🇸🇦",
                "Russian 🇷🇺",
                "Hindi 🇮🇳",
                "Turkish 🇹🇷",
                "Polish 🇵🇱",
                "Dutch 🇳🇱",
                "Swedish 🇸🇪",
                "Danish 🇩🇰",
                "Norwegian 🇳🇴",
                "Finnish 🇫🇮",
                "Greek 🇬🇷",
                "Hebrew 🇮🇱",
                "Thai 🇹🇭",
                "Vietnamese 🇻🇳",
                "Indonesian 🇮🇩",
                "Malay 🇲🇾",
                "Filipino 🇵🇭",
                "Ukrainian 🇺🇦",
                "Czech 🇨🇿",
                "Slovak 🇸🇰",
                "Hungarian 🇭🇺",
                "Romanian 🇷🇴",
                "Bulgarian 🇧🇬",
                "Croatian 🇭🇷",
                "Serbian 🇷🇸",
                "Slovenian 🇸🇮",
                "Estonian 🇪🇪",
                "Latvian 🇱🇻",
                "Lithuanian 🇱🇹",
                "Maltese 🇲🇹",
                "Irish 🇮🇪",
                "Welsh 🏴",
                "Icelandic 🇮🇸",
                "Faroese 🇫🇴",
                "Luxembourgish 🇱🇺",
                "Romansh 🇨🇭",
                "Basque 🏴",
                "Catalan 🏴",
                "Galician 🏴",
                "Occitan 🇫🇷",
                "Breton 🇫🇷",
                "Cornish 🏴",
                "Scottish Gaelic 🏴",
                "Manx 🇮🇲",
                "Norwegian Nynorsk 🇳🇴",
                "Northern Sami 🇳🇴",
                "Belarusian 🇧🇾",
                "Macedonian 🇲🇰",
                "Albanian 🇦🇱",
                "Bosnian 🇧🇦",
                "Montenegrin 🇲🇪",
                "Kosovo 🇽🇰",
                "San Marino 🇸🇲",
                "Andorran 🇦🇩",
                "Liechtenstein 🇱🇮",
                "Monaco 🇲🇨",
                "Vatican 🇻🇦"
              ]
            }
          },
          "publisherPlatforms": {
            "title": "📱 Publisher Platforms",
            "type": "array",
            "description": "**Select which platforms to search for ads** 🎯\n\n**Available Platforms:**\n- **Facebook** - Main Facebook feed ads\n- **Instagram** - Instagram feed and story ads\n- **Audience Network** - Third-party apps and websites\n- **Messenger** - Facebook Messenger ads\n- **WhatsApp** - WhatsApp Business ads\n- **Threads** - Threads social platform ads\n\n**💡 Tips:**\n- Leave empty to search all platforms\n- Select multiple platforms for broader coverage\n- Instagram and Facebook are the most common",
            "items": {
              "type": "string",
              "enum": [
                "FACEBOOK",
                "INSTAGRAM",
                "AUDIENCE_NETWORK",
                "MESSENGER",
                "WHATSAPP",
                "THREADS"
              ],
              "enumTitles": [
                "📘 Facebook",
                "📷 Instagram",
                "🌐 Audience Network",
                "💬 Messenger",
                "📞 WhatsApp",
                "🧵 Threads"
              ]
            }
          },
          "activeStatus": {
            "title": "📊 Ad Status Filter",
            "enum": [
              "ALL",
              "ACTIVE",
              "INACTIVE"
            ],
            "type": "string",
            "description": "**Filter by ad activity status** 🔄\n\n- **All**: Both active and inactive ads (recommended)\n- **Active**: Only currently running ads\n- **Inactive**: Only stopped/ended ads\n\n**💡 'All' gives the most comprehensive data**",
            "default": "ALL"
          },
          "adType": {
            "title": "📂 Ad Category Filter",
            "enum": [
              "ALL",
              "POLITICAL_AND_ISSUE_ADS",
              "HOUSING_ADS",
              "EMPLOYMENT_ADS",
              "CREDIT_ADS"
            ],
            "type": "string",
            "description": "**Filter by Facebook ad category** 🎯\n\n- **All ads**: Every type of advertisement (recommended)\n- **Politics**: Political and issue-based ads\n- **Housing**: Real estate and housing ads\n- **Employment**: Job and employment ads\n- **Financial**: Credit and financial service ads\n\n**💡 Different categories may have different data availability**",
            "default": "ALL"
          },
          "mediaType": {
            "title": "🎨 Media Type Filter",
            "enum": [
              "ALL",
              "IMAGE",
              "MEME",
              "IMAGE_AND_MEME",
              "VIDEO",
              "NONE"
            ],
            "type": "string",
            "description": "**Filter by ad media content** 📱\n\n- **All**: Every ad type (recommended)\n- **Video**: Only video ads\n- **Image**: Only image ads\n- **Meme**: Images with text, e.g., 'marketing'\n- **Image & Meme**: Both image types\n- **None**: Text-only ads (no image or video)\n\n**💡 Video ads often have higher engagement data**",
            "default": "ALL"
          },
          "startDate": {
            "title": "📅 From Date",
            "type": "string",
            "description": "**Earliest date to search for ads** 📆\n\nSelect the earliest publication date for ads in your search results."
          },
          "endDate": {
            "title": "📅 To Date",
            "type": "string",
            "description": "**Latest date to search for ads** 📆\n\nSelect the latest publication date. Leave empty to include all ads up to today."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}