{
  "openapi": "3.0.1",
  "info": {
    "title": "Meta Ad Library Longevity, EU Reach & Spend Spy Pro",
    "description": "Extract active Facebook & Instagram ads from Meta Ad Library with 90+ day Evergreen Winner scoring, DCO clone deduplication, and EU DSA Beneficiary, Payer & Reach metrics — no login cookies required, $0.00 start fee, $1.50/1k base ads or $2.50/1k w/ EU DSA Detail.",
    "version": "1.0",
    "x-build-id": "icWmy6gWSPBgec1IL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/voxatools~meta-ad-library-longevity-spy-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-voxatools-meta-ad-library-longevity-spy-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/voxatools~meta-ad-library-longevity-spy-scraper/runs": {
      "post": {
        "operationId": "runs-sync-voxatools-meta-ad-library-longevity-spy-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/voxatools~meta-ad-library-longevity-spy-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-voxatools-meta-ad-library-longevity-spy-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": {
          "queries": {
            "title": "Target Brand Domains or Keywords",
            "type": "array",
            "description": "Brand domains or advertiser names to search in Meta Ad Library (e.g., ['zalando.de', 'hubspot.com', 'asos.com']). Max 50 targets per run.",
            "default": [
              "zalando.de",
              "hubspot.com",
              "asos.com"
            ],
            "items": {
              "type": "string"
            }
          },
          "pageIds": {
            "title": "Exact Facebook Page IDs (view_all_page_id)",
            "type": "array",
            "description": "Optional list of numeric Facebook Page IDs (e.g., ['20531316728']) for 100% exact advertiser extraction.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "adLibraryUrls": {
            "title": "Direct Meta Ad Library URLs",
            "type": "array",
            "description": "Optional direct https://www.facebook.com/ads/library/?... URLs. Non-Meta hosts or private IPs are strictly rejected.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "countryFilter": {
            "title": "Target Country ISO-2 Code (Default 'DE' for EU DSA Reach & Beneficiary)",
            "type": "string",
            "description": "2-letter ISO country code (e.g., 'DE', 'FR', 'NL', 'ES', 'IT', 'PL', 'SE', 'US', 'GB') or 'ALL'. Defaults to 'DE' so EU DSA Reach and Beneficiary/Payer data are immediately available.",
            "default": "DE"
          },
          "activeStatus": {
            "title": "Ad Delivery Status",
            "enum": [
              "ACTIVE",
              "INACTIVE",
              "ALL"
            ],
            "type": "string",
            "description": "Filter by active delivery status: ACTIVE, INACTIVE, or ALL.",
            "default": "ACTIVE"
          },
          "mediaType": {
            "title": "Creative Media Format",
            "enum": [
              "ALL",
              "VIDEO",
              "IMAGE",
              "MEME",
              "NONE"
            ],
            "type": "string",
            "description": "Filter by creative media format: ALL, VIDEO, IMAGE, MEME, or NONE.",
            "default": "ALL"
          },
          "publisherPlatforms": {
            "title": "Publisher Platforms Filter",
            "type": "array",
            "description": "Optional filter for publisher platforms: FACEBOOK, INSTAGRAM, AUDIENCE_NETWORK, MESSENGER.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minActiveDays": {
            "title": "Minimum Active Days Filter (Evergreen Winner Filter)",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Only return ads that have been continuously active for at least N days (e.g., 30, 60, or 90 days).",
            "default": 0
          },
          "maxAdsPerTarget": {
            "title": "Max Ads Per Target (Cost Guard)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum deduplicated ads to emit per target query/page. Defaults to 20 (3 targets = 60 ads, ~$0.15 with EU DSA enabled) to protect your budget.",
            "default": 20
          },
          "deduplicateCollationVariants": {
            "title": "Deduplicate Dynamic Creative (DCO) Collation Clones",
            "type": "boolean",
            "description": "Collapse identical Dynamic Creative Optimization (DCO) collation variants into a single representative record with collationVariantCount.",
            "default": true
          },
          "strictEntityIsolation": {
            "title": "Strict Brand / Entity Isolation Guard",
            "type": "boolean",
            "description": "Discard unrelated pages returned by broad keyword searches unless pageName, igUsername, or landing domain matches the target query.",
            "default": true
          },
          "includeEuDsaAndLongevityMetrics": {
            "title": "Include EU DSA Beneficiary/Payer, Reach & Illustrative Spend (+$1.00/1k 'detail')",
            "type": "boolean",
            "description": "Enables Step-3 GraphQL AdLibraryV3AdDetailsQuery to extract EU DSA Beneficiary, Payer, EU Total Reach, Age/Gender/Country breakdowns, and illustrative CPM spend bounds. Charges +$0.0010/ad ONLY when detailVerified === true.",
            "default": true
          },
          "advertiserSummaryMode": {
            "title": "B2B Advertiser Executive Dossier Mode ($2.80/1k 'advertiser' All-In)",
            "type": "boolean",
            "description": "Emit 1 consolidated B2B Advertiser Dossier per target page instead of individual ad rows. Strictly mutually exclusive with 'result', 'detail', and 'asset' events.",
            "default": false
          },
          "onlyNewAdsSinceLastRun": {
            "title": "Incremental Creative Launch & Deactivation Radar (Stateful KVS Diff)",
            "type": "boolean",
            "description": "Compare against the previous run's KVS checkpoint (keyed by 10-parameter scopeKey) and emit only newly launched or state-changed ads. Checkpoint writes only AFTER pushData.",
            "default": false
          },
          "downloadMediaAssets": {
            "title": "Save Verified Creative Image/Poster Binary to KVS (+$0.80/1k 'asset')",
            "type": "boolean",
            "description": "Downloads 1 primary creative image or video poster thumbnail per ad (1,001B–40,000B, JPEG/PNG/WebP magic-byte verified) via Direct Socket-Pinned CDN and writes 1 binary KVS key. Disabled automatically in advertiserSummaryMode.",
            "default": false
          },
          "maxChargedUsd": {
            "title": "Hard Run Budget Ceiling (USD)",
            "minimum": 0.01,
            "maximum": 1000,
            "type": "number",
            "description": "Maximum total USD to charge for this run across all PPE events. The Actor stops cleanly before exceeding this ceiling.",
            "default": 5
          },
          "allowApifyProxy": {
            "title": "Allow Apify Proxy Fallback on HTTP 429",
            "type": "boolean",
            "description": "Allow automatic fallback to Apify Proxy on Apify Cloud if direct Zero-Browser requests encounter HTTP 429. Hard-locked to false on Free Micro-Web Edge.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Optional Apify Proxy settings (only used when allowApifyProxy=true and direct Zero-Browser requests encounter rate limits).",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}