{
  "openapi": "3.0.1",
  "info": {
    "title": "Meta & Facebook Ad Library Scraper — No Login",
    "description": "Facebook and Instagram ads from the Meta Ad Library with no token: paste Ad Library links, search keywords or advertisers, bulk lists, advertiser profiles (followers, category), EU reach and audience, advertiser check mode and a new-ads monitor. No login or cookies. MCP-ready for AI agents.",
    "version": "1.0",
    "x-build-id": "b0wYshB8drjhhExmN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fortuitous_pirate~meta-facebook-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fortuitous_pirate-meta-facebook-ad-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/fortuitous_pirate~meta-facebook-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fortuitous_pirate-meta-facebook-ad-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/fortuitous_pirate~meta-facebook-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fortuitous_pirate-meta-facebook-ad-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": {
          "urls": {
            "title": "Ad Library URLs",
            "type": "array",
            "description": "Paste Meta Ad Library links straight from your browser: keyword searches, a page's 'See all ads' view, or a single ad (?id=). Filters in the link (country, active status, media type, platforms, dates) are applied. Facebook page URLs work too.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Search ad text across ALL advertisers, one keyword or phrase per line.",
            "items": {
              "type": "string"
            }
          },
          "pages": {
            "title": "Advertisers (pages)",
            "type": "array",
            "description": "Brand names, @handles, page IDs, facebook.com page URLs or website domains (nike.com resolves to the Nike page). Returns every ad that page runs.",
            "items": {
              "type": "string"
            }
          },
          "listUrl": {
            "title": "Import a list (CSV, TXT or Google Sheet link)",
            "type": "string",
            "description": "First column of each row is read. Use it for hundreds or thousands of advertisers or keywords."
          },
          "listType": {
            "title": "List contains",
            "enum": [
              "pages",
              "keywords"
            ],
            "type": "string",
            "description": "What the imported list holds.",
            "default": "pages"
          },
          "mode": {
            "title": "What to return",
            "enum": [
              "ads",
              "advertiserCheck"
            ],
            "type": "string",
            "description": "Ads: one row per ad. Advertiser check: one row per advertiser with whether it is advertising, active ad count, formats, platforms and page profile (followers, category). Built for qualifying lead lists.",
            "default": "ads"
          },
          "searchType": {
            "title": "Keyword match",
            "enum": [
              "any",
              "exact"
            ],
            "type": "string",
            "description": "Keyword searches only.",
            "default": "any"
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter code where the ads ran (US, GB, DE, FR, ...). Empty means all countries."
          },
          "activeStatus": {
            "title": "Active status",
            "enum": [
              "",
              "ACTIVE",
              "INACTIVE",
              "ALL"
            ],
            "type": "string",
            "description": "Ads currently running, stopped, or both."
          },
          "adType": {
            "title": "Ad category",
            "enum": [
              "",
              "ALL",
              "POLITICAL_AND_ISSUE_ADS"
            ],
            "type": "string",
            "description": "All ads, or only political and issue ads (these include spend and impressions ranges)."
          },
          "mediaType": {
            "title": "Media type",
            "enum": [
              "all",
              "image",
              "video",
              "meme",
              "none"
            ],
            "type": "string",
            "description": "Filter by creative type.",
            "default": "all"
          },
          "platforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Only ads shown on these platforms. Empty means all.",
            "items": {
              "type": "string",
              "enum": [
                "facebook",
                "instagram",
                "messenger",
                "audience_network",
                "threads"
              ],
              "enumTitles": [
                "Facebook",
                "Instagram",
                "Messenger",
                "Audience Network",
                "Threads"
              ]
            }
          },
          "languages": {
            "title": "Ad languages",
            "type": "array",
            "description": "Two-letter language codes (en, es, de...). Empty means all.",
            "items": {
              "type": "string"
            }
          },
          "startDate": {
            "title": "Running on or after",
            "type": "string",
            "description": "YYYY-MM-DD. Keeps ads still running on or after this date."
          },
          "endDate": {
            "title": "Started on or before",
            "type": "string",
            "description": "YYYY-MM-DD. Keeps ads that started on or before this date."
          },
          "sortBy": {
            "title": "Sort",
            "enum": [
              "relevancy",
              "impressions"
            ],
            "type": "string",
            "description": "Order Meta returns ads in.",
            "default": "relevancy"
          },
          "includePageInfo": {
            "title": "Add advertiser profile",
            "type": "boolean",
            "description": "Adds the page's category, likes, verification, Instagram handle and followers, and about text. One extra lookup per advertiser, not per ad.",
            "default": true
          },
          "includeAdDetails": {
            "title": "Add EU/UK transparency details",
            "type": "boolean",
            "description": "Per-ad lookup of the transparency panel (EU/UK reach, audience, beneficiary and payer where Meta publishes them). Slower: one extra request per ad.",
            "default": false
          },
          "onlyNewAds": {
            "title": "Monitor: return only new ads",
            "type": "boolean",
            "description": "Remembers every ad seen in earlier runs with the same monitor ID and returns only new ones. Schedule it for competitor alerts. The first run returns current ads.",
            "default": false
          },
          "monitorId": {
            "title": "Monitor ID",
            "type": "string",
            "description": "Name for the monitor's memory. One ID per watch list.",
            "default": "default"
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Total rows for the run.",
            "default": 10
          },
          "maxAdsPerTarget": {
            "title": "Max ads per URL / keyword / advertiser",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap per target so one big advertiser does not use the whole run.",
            "default": 200
          },
          "raw": {
            "title": "Include raw Meta record",
            "type": "boolean",
            "description": "Adds the unmodified Ad Library record under 'raw' for every ad.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Without one, cloud runs use Apify residential proxy (Meta rate-limits datacenter IPs)."
          },
          "searchTerms": {
            "title": "Search terms (legacy)",
            "type": "string",
            "description": "Kept for existing integrations; same as one keyword."
          },
          "pageId": {
            "title": "Page ID (legacy)",
            "type": "string",
            "description": "Kept for existing integrations; same as one advertiser."
          },
          "adReachedCountries": {
            "title": "Countries (legacy)",
            "type": "array",
            "description": "Kept for existing integrations; the first country is used.",
            "items": {
              "type": "string"
            }
          },
          "minDate": {
            "title": "Min date (legacy)",
            "type": "string",
            "description": "Same as 'Running on or after'."
          },
          "maxDate": {
            "title": "Max date (legacy)",
            "type": "string",
            "description": "Same as 'Started on or before'."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}