{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Ads Library Scraper - Meta Ads, All Countries",
    "description": "Scrape the Facebook Ads Library by keyword, Page or Ad Library link, in any country: ad copy, images and videos, landing pages, CTAs, run dates, platforms and the advertiser Page with its likes. Political ad spend included. No login, no token. From $0.50 per 1,000 ads.",
    "version": "0.0",
    "x-build-id": "8IvR4Vd9XAomB4Ggt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/eiv~meta-ads-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-eiv-meta-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/eiv~meta-ads-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-eiv-meta-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/eiv~meta-ads-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-eiv-meta-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": {
          "searchQueries": {
            "title": "Search keywords or Ad Library links",
            "maxItems": 500,
            "type": "array",
            "description": "One per line: a keyword (e.g. running shoes) or any Ad Library address copied from your browser: a search with filters, a Page's ads (view_all_page_id=) or a single ad (?id=). Filters in a link override the ones below.",
            "items": {
              "type": "string"
            }
          },
          "pageUrls": {
            "title": "Facebook Pages",
            "maxItems": 200,
            "type": "array",
            "description": "Advertisers whose ads you want: a Page address (https://www.facebook.com/nike), its name (Nike) or its Page id. Every ad the Page runs or ran is returned, filtered by the options below.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Ad Library URLs (other scrapers' format)",
            "type": "array",
            "description": "The same as the first field, in the URL-list format other Ad Library scrapers use, so their saved inputs run unchanged. Use either field.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Where the ads were shown. All countries by default. Pick one or more to narrow it, e.g. US. (The official API source below returns ordinary ads only for EU countries.)",
            "items": {
              "type": "string",
              "enum": [
                "ALL",
                "US",
                "GB",
                "CA",
                "AU",
                "DE",
                "FR",
                "ES",
                "IT",
                "NL",
                "BR",
                "IN",
                "JP",
                "KR",
                "MX",
                "PL",
                "SE",
                "NO",
                "DK",
                "FI",
                "AT",
                "BE",
                "CH",
                "IE",
                "NZ",
                "PT",
                "IL",
                "AE",
                "SA",
                "SG",
                "HK",
                "TW",
                "PH",
                "TH",
                "ID",
                "MY",
                "VN",
                "AR",
                "CL",
                "CO",
                "PE",
                "ZA",
                "NG",
                "EG",
                "KE",
                "GH",
                "TR",
                "RU",
                "UA",
                "CZ",
                "RO",
                "HU",
                "BG",
                "HR",
                "RS",
                "SK",
                "SI",
                "LT",
                "LV",
                "EE",
                "IS",
                "LU",
                "MT",
                "CY",
                "GR",
                "GE",
                "AZ",
                "KZ",
                "UZ",
                "PK",
                "BD",
                "LK",
                "NP",
                "KH",
                "MM",
                "JO",
                "KW",
                "LB",
                "QA",
                "BH",
                "OM",
                "IQ",
                "DZ",
                "MA",
                "TN",
                "LY",
                "SN",
                "CM",
                "CI",
                "GN",
                "ML",
                "BF",
                "TG",
                "BJ",
                "NE",
                "GA",
                "CG",
                "CD",
                "AO",
                "MZ",
                "ET",
                "TZ",
                "UG",
                "RW",
                "ZM",
                "ZW",
                "BW",
                "NA",
                "MW",
                "MG",
                "MU",
                "SC",
                "DJ",
                "ER",
                "SO",
                "SS",
                "CF",
                "TD",
                "BI",
                "SL",
                "LR",
                "GQ",
                "ST",
                "CV",
                "GW",
                "KM",
                "MR",
                "GM",
                "GD",
                "LC",
                "VC",
                "KN",
                "DM",
                "AG",
                "BB",
                "BS",
                "JM",
                "TT",
                "GY",
                "SR",
                "BZ",
                "HN",
                "GT",
                "SV",
                "NI",
                "CR",
                "PA",
                "DO",
                "HT",
                "PR",
                "EC",
                "BO",
                "PY",
                "UY",
                "VE",
                "PF",
                "NC",
                "FJ",
                "PG",
                "SB",
                "VU",
                "WS",
                "TO",
                "KI",
                "MH",
                "FM",
                "PW",
                "TV",
                "NR",
                "TL",
                "BN",
                "MO",
                "MN",
                "BT",
                "LA",
                "MV",
                "AF",
                "TJ",
                "KG",
                "TM",
                "YE",
                "PS",
                "BA",
                "MK",
                "AL",
                "ME",
                "MD",
                "BY",
                "AM",
                "AD",
                "MC",
                "LI",
                "SM",
                "VA",
                "GI",
                "FO",
                "GL",
                "AX",
                "JE",
                "GG",
                "IM",
                "BM",
                "KY",
                "VG",
                "VI",
                "TC",
                "AI",
                "MS",
                "AW",
                "CW",
                "SX",
                "BQ",
                "MQ",
                "GP",
                "GF",
                "RE",
                "YT",
                "PM",
                "BL",
                "MF",
                "SH",
                "FK",
                "GS",
                "BV",
                "HM",
                "IO",
                "CX",
                "CC",
                "CK",
                "NU",
                "NF",
                "PN",
                "TK",
                "UM",
                "WF",
                "EH",
                "SJ",
                "AQ",
                "AN",
                "XK",
                "SY",
                "AS",
                "GU",
                "MP"
              ]
            }
          },
          "activeStatus": {
            "title": "Active Status",
            "enum": [
              "ALL",
              "ACTIVE",
              "INACTIVE"
            ],
            "type": "string",
            "description": "Running now, stopped, or both. An Ad Library link's own setting wins.",
            "default": "ALL"
          },
          "adType": {
            "title": "Ad category",
            "enum": [
              "ALL",
              "POLITICAL_AND_ISSUE_ADS",
              "HOUSING_ADS",
              "EMPLOYMENT_ADS",
              "CREDIT_ADS"
            ],
            "type": "string",
            "description": "All ads for competitor research. Political and issue ads add the spend and impressions ranges Meta publishes for them (null on ordinary ads: Meta does not publish what other advertisers spend).",
            "default": "ALL"
          },
          "searchType": {
            "title": "Keyword match",
            "enum": [
              "KEYWORD_UNORDERED",
              "KEYWORD_EXACT_PHRASE"
            ],
            "type": "string",
            "description": "Unordered finds ads with all the words in any order; exact phrase only that phrase.",
            "default": "KEYWORD_UNORDERED"
          },
          "mediaType": {
            "title": "Media type",
            "enum": [
              "ALL",
              "IMAGE",
              "VIDEO",
              "MEME",
              "IMAGE_AND_MEME",
              "NONE"
            ],
            "type": "string",
            "description": "Only ads with images, videos, memes, or no media.",
            "default": "ALL"
          },
          "publisherPlatforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Only ads shown on these Meta platforms. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "FACEBOOK",
                "INSTAGRAM",
                "AUDIENCE_NETWORK",
                "MESSENGER",
                "WHATSAPP",
                "OCULUS",
                "THREADS"
              ],
              "enumTitles": [
                "Facebook",
                "Instagram",
                "Audience Network",
                "Messenger",
                "WhatsApp",
                "Oculus",
                "Threads"
              ]
            },
            "default": []
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Only ads in these languages. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "English",
                "Spanish",
                "French",
                "German",
                "Portuguese",
                "Italian",
                "Dutch",
                "Russian",
                "Japanese",
                "Korean",
                "Chinese (Mandarin)",
                "Chinese (Cantonese)",
                "Arabic",
                "Hindi",
                "Bengali",
                "Turkish",
                "Polish",
                "Ukrainian",
                "Romanian",
                "Czech",
                "Swedish",
                "Norwegian",
                "Danish",
                "Finnish",
                "Greek",
                "Hungarian",
                "Thai",
                "Vietnamese",
                "Indonesian",
                "Malay",
                "Filipino",
                "Hebrew",
                "Persian",
                "Urdu",
                "Swahili",
                "Tamil",
                "Telugu",
                "Marathi",
                "Gujarati",
                "Kannada",
                "Malayalam",
                "Punjabi",
                "Burmese",
                "Khmer",
                "Lao",
                "Amharic",
                "Somali",
                "Hausa",
                "Yoruba",
                "Igbo",
                "Zulu",
                "Afrikaans",
                "Croatian",
                "Serbian",
                "Bosnian",
                "Slovak",
                "Slovenian",
                "Lithuanian",
                "Latvian",
                "Estonian",
                "Bulgarian",
                "Albanian",
                "Macedonian",
                "Montenegrin",
                "Georgian",
                "Armenian",
                "Azerbaijani",
                "Kazakh",
                "Uzbek",
                "Kyrgyz",
                "Turkmen",
                "Tajik",
                "Mongolian",
                "Nepali",
                "Sinhala",
                "Catalan",
                "Galician",
                "Basque",
                "Welsh",
                "Irish",
                "Icelandic",
                "Maltese",
                "Luxembourgish",
                "Malagasy"
              ],
              "enumTitles": [
                "English",
                "Spanish",
                "French",
                "German",
                "Portuguese",
                "Italian",
                "Dutch",
                "Russian",
                "Japanese",
                "Korean",
                "Chinese (Mandarin)",
                "Chinese (Cantonese)",
                "Arabic",
                "Hindi",
                "Bengali",
                "Turkish",
                "Polish",
                "Ukrainian",
                "Romanian",
                "Czech",
                "Swedish",
                "Norwegian",
                "Danish",
                "Finnish",
                "Greek",
                "Hungarian",
                "Thai",
                "Vietnamese",
                "Indonesian",
                "Malay",
                "Filipino",
                "Hebrew",
                "Persian",
                "Urdu",
                "Swahili",
                "Tamil",
                "Telugu",
                "Marathi",
                "Gujarati",
                "Kannada",
                "Malayalam",
                "Punjabi",
                "Burmese",
                "Khmer",
                "Lao",
                "Amharic",
                "Somali",
                "Hausa",
                "Yoruba",
                "Igbo",
                "Zulu",
                "Afrikaans",
                "Croatian",
                "Serbian",
                "Bosnian",
                "Slovak",
                "Slovenian",
                "Lithuanian",
                "Latvian",
                "Estonian",
                "Bulgarian",
                "Albanian",
                "Macedonian",
                "Montenegrin",
                "Georgian",
                "Armenian",
                "Azerbaijani",
                "Kazakh",
                "Uzbek",
                "Kyrgyz",
                "Turkmen",
                "Tajik",
                "Mongolian",
                "Nepali",
                "Sinhala",
                "Catalan",
                "Galician",
                "Basque",
                "Welsh",
                "Irish",
                "Icelandic",
                "Maltese",
                "Luxembourgish",
                "Malagasy"
              ]
            },
            "default": []
          },
          "adDeliveryDateMin": {
            "title": "Shown from",
            "type": "string",
            "description": "Only ads shown on or after this date (YYYY-MM-DD)."
          },
          "adDeliveryDateMax": {
            "title": "Shown until",
            "type": "string",
            "description": "Only ads shown on or before this date (YYYY-MM-DD)."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "RELEVANCE",
              "IMPRESSIONS",
              "NEWEST"
            ],
            "type": "string",
            "description": "The Ad Library's order: total impressions (its default, the ads seen most first) or most recent. With a low limit this decides which ads you get.",
            "default": "RELEVANCE"
          },
          "maxResults": {
            "title": "Max ads",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Total ads for the whole run, across all inputs. You pay per ad, so this is also your cost cap.",
            "default": 50
          },
          "maxResultsPerQuery": {
            "title": "Max ads per search or Page",
            "minimum": 0,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop each keyword, link or Page after this many ads, so one big advertiser cannot use the whole run. 0 = no limit per input.",
            "default": 0
          },
          "onlyTotalCount": {
            "title": "Only count ads",
            "type": "boolean",
            "description": "Return how many ads match each input instead of the ads (official API; counts EU and political ads only). Charged per count, not per ad.",
            "default": false
          },
          "dataSource": {
            "title": "Data source",
            "enum": [
              "website",
              "officialApi"
            ],
            "type": "string",
            "description": "Ad Library website (default): every country, ordinary and political ads, images, videos, landing pages. Official API: Meta's API, ordinary ads only if they ran in the EU, but adds EU reach, age/gender targeting and reach breakdowns.",
            "default": "website"
          },
          "proxyConfig": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed: the website source uses Apify residential addresses automatically (included in the price). Add your own proxy URLs only if you want them used instead."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}