{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook & Meta Ads Library Scraper + Tracker",
    "description": "Scrape Facebook and Meta Ads Library creatives, copy, CTAs and landing links. Track competitor ads and detect new, updated and safely ended ads.",
    "version": "0.1",
    "x-build-id": "E7XW2NPSsPoQuuQ54"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/luminar~meta-ads-library-creative-changefeed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-luminar-meta-ads-library-creative-changefeed",
        "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/luminar~meta-ads-library-creative-changefeed/runs": {
      "post": {
        "operationId": "runs-sync-luminar-meta-ads-library-creative-changefeed",
        "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/luminar~meta-ads-library-creative-changefeed/run-sync": {
      "post": {
        "operationId": "run-sync-luminar-meta-ads-library-creative-changefeed",
        "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": {
          "productLevel": {
            "title": "🎯 What do you want back?",
            "enum": [
              "BASELINE",
              "CHANGES"
            ],
            "type": "string",
            "description": "<b>Baseline</b> returns the ads running right now. <b>Changes</b> returns the same data plus what is NEW, UPDATED, UNCHANGED or ENDED since your previous run of the same query. Start with Baseline.",
            "default": "BASELINE"
          },
          "searchTerms": {
            "title": "🔍 Search terms",
            "minItems": 1,
            "maxItems": 25,
            "type": "array",
            "description": "Keywords to search across the Meta Ad Library. A run accepts up to 25 total targets across all input lists.",
            "items": {
              "type": "string"
            }
          },
          "pageUrls": {
            "title": "📘 Facebook page or brand URLs",
            "minItems": 1,
            "maxItems": 25,
            "type": "array",
            "description": "Track specific advertisers. Ad Library URLs containing a numeric page ID use the low-memory primary path and can be batched. An uncached handle such as <code>facebook.com/nike</code> may require optional browser continuity; that layer is disabled under the current three-event price and fails closed, so use a numeric-page-ID Ad Library URL instead.",
            "items": {
              "type": "string"
            }
          },
          "maxAdsPerTarget": {
            "title": "💯 Max ads per target",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Verified upper limit of ads collected for each search term or page. Use multiple targets for large batches; you are billed per delivered result.",
            "default": 100
          },
          "country": {
            "title": "🌍 Country",
            "enum": [
              "ALL",
              "US",
              "GB",
              "DE",
              "FR",
              "ES",
              "IT",
              "CA",
              "AU",
              "BR",
              "IN",
              "JP",
              "MX",
              "NL",
              "AE",
              "AR",
              "AT",
              "BA",
              "BE",
              "BG",
              "CH",
              "CZ",
              "DK",
              "EG",
              "FI",
              "GR",
              "HR",
              "HU",
              "IE",
              "IL",
              "KR",
              "ME",
              "NO",
              "NZ",
              "PL",
              "PT",
              "RO",
              "RS",
              "SA",
              "SE",
              "SG",
              "SI",
              "SK",
              "TR",
              "UA",
              "ZA"
            ],
            "type": "string",
            "description": "Which country's ad delivery to read. Meta only offers <i>All countries</i> for political and issue ads — for ordinary commercial ads the run uses United States and reports it honestly in the output.",
            "default": "US"
          },
          "startUrls": {
            "title": "Ad Library URL",
            "minItems": 1,
            "maxItems": 25,
            "type": "array",
            "description": "Already built the search you want on <a href='https://www.facebook.com/ads/library' target='_blank'>facebook.com/ads/library</a>? Paste the URL here and the Actor reads your filters out of it.",
            "items": {
              "type": "string"
            }
          },
          "activeStatus": {
            "title": "Active status",
            "enum": [
              "ALL",
              "ACTIVE",
              "INACTIVE"
            ],
            "type": "string",
            "description": "Only ads currently running, only ads already stopped, or both.",
            "default": "ALL"
          },
          "mediaType": {
            "title": "Creative format",
            "enum": [
              "ALL",
              "IMAGE",
              "VIDEO",
              "MEME"
            ],
            "type": "string",
            "description": "Restrict to a single creative format.",
            "default": "ALL"
          },
          "adType": {
            "title": "Ad category",
            "enum": [
              "ALL",
              "POLITICAL_AND_ISSUE_ADS"
            ],
            "type": "string",
            "description": "Political and issue ads unlock Meta's global all-country scope and its public reach and spend disclosures. Commercial ads do not carry those figures.",
            "default": "ALL"
          },
          "dateFrom": {
            "title": "Ads first shown on or after",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string",
            "description": "Leave empty for no lower bound."
          },
          "dateTo": {
            "title": "Ads first shown on or before",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string",
            "description": "Leave empty for no upper bound."
          },
          "maxPaginationPages": {
            "title": "Max pagination pages per target",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Advanced safety ceiling after the first response. The default is verified for the 100-result per-target limit. Setting it lower on purpose can report coverage as PARTIAL.",
            "default": 20
          },
          "maxNetworkGb": {
            "title": "Network budget (GB)",
            "minimum": 0.005,
            "maximum": 0.08,
            "type": "number",
            "description": "Advanced hard network ceiling for the whole run. The Actor stops further collection and reports partial coverage instead of exceeding it.",
            "default": 0.05
          },
          "browserFallbackPolicy": {
            "title": "Browser continuity policy",
            "enum": [
              "AUTO_GUARDED",
              "HTTP_ONLY"
            ],
            "type": "string",
            "description": "AUTO_GUARDED permits one bounded browser-continuity step only when its separate fixed PPE event is active at a safe runtime price and the run has at least 2048 MB memory. Under the current three-event price the event is absent, so the Actor fails closed before browser work. HTTP_ONLY always disables continuity.",
            "default": "AUTO_GUARDED"
          },
          "timeoutSeconds": {
            "title": "Timeout (seconds)",
            "minimum": 60,
            "maximum": 900,
            "type": "integer",
            "description": "Maximum wall-clock run time.",
            "default": 900
          },
          "blockMediaDownloads": {
            "title": "Skip downloading image and video files",
            "type": "boolean",
            "description": "Creative URLs are read from the page data, so downloading the files themselves costs bandwidth and adds nothing. Leave on.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}