{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Ad Library Scraper - Meta Ads Monitor & New Ads Alert",
    "description": "Facebook Ad Library scraper, competitor ad monitor and new ads alert for exact Meta Pages. Collect active Facebook and Instagram ads without login or an API key. Export ad copy, links, media and platforms, with verified new, stopped, resumed and asset-change events across runs.",
    "version": "0.1",
    "x-build-id": "6QdMW6cp6fceHB3pd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kamerozkan~facebook-ad-library-change-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kamerozkan-facebook-ad-library-change-monitor",
        "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/kamerozkan~facebook-ad-library-change-monitor/runs": {
      "post": {
        "operationId": "runs-sync-kamerozkan-facebook-ad-library-change-monitor",
        "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/kamerozkan~facebook-ad-library-change-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-kamerozkan-facebook-ad-library-change-monitor",
        "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": {
          "pageIds": {
            "title": "Facebook Page IDs, Page URLs, or Ad Library URLs (optional when keywords are set)",
            "maxItems": 20,
            "uniqueItems": true,
            "type": "array",
            "description": "Paste up to 20 Page targets. Accepted: a numeric Page ID (15087023444), an Ad Library URL that contains view_all_page_id, a Page URL such as https://www.facebook.com/nike, or a Page username. Usernames are resolved to the exact Page ID before monitoring, so unrelated advertisers are never mixed into a Page monitor. Leave empty when you only use keywords.",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 500
            }
          },
          "keywords": {
            "title": "Keywords (optional)",
            "maxItems": 10,
            "uniqueItems": true,
            "type": "array",
            "description": "Optional search terms such as a product, brand, or competitor name, up to 10. Each keyword becomes a new-launch feed of the active ads Meta ranks for that term in the selected country. Keyword results mix many advertisers and change ranking over time, so stopped-ad detection is never claimed for keyword targets.",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 100
            }
          },
          "keywordSearchType": {
            "title": "Keyword match",
            "enum": [
              "keyword_unordered",
              "keyword_exact_phrase"
            ],
            "type": "string",
            "description": "Broad match returns ads that contain all keyword words in any order. Exact phrase returns ads that contain the keyword as one phrase.",
            "default": "keyword_unordered"
          },
          "country": {
            "title": "Ad delivery country",
            "enum": [
              "ALL",
              "US",
              "GB",
              "CA",
              "AU",
              "DE",
              "FR",
              "ES",
              "IT",
              "NL",
              "BE",
              "CH",
              "AT",
              "IE",
              "SE",
              "NO",
              "DK",
              "FI",
              "PL",
              "PT",
              "CZ",
              "RO",
              "HU",
              "GR",
              "BG",
              "HR",
              "SK",
              "SI",
              "LT",
              "LV",
              "EE",
              "LU",
              "MT",
              "CY",
              "BR",
              "MX",
              "AR",
              "CL",
              "CO",
              "PE",
              "IN",
              "JP",
              "KR",
              "SG",
              "NZ",
              "ID",
              "MY",
              "PH",
              "TH",
              "VN",
              "TW",
              "HK",
              "PK",
              "BD",
              "AE",
              "SA",
              "IL",
              "EG",
              "ZA",
              "NG",
              "KE",
              "MA",
              "TR",
              "UA"
            ],
            "type": "string",
            "description": "Return ads that Meta reports as delivered in this country. All countries returns the complete active library of the Page. Monitor the same Page separately when you need several single-country views.",
            "default": "ALL"
          },
          "monitorName": {
            "title": "Monitor name",
            "pattern": "^[A-Za-z0-9._-]{3,64}$",
            "minLength": 3,
            "maxLength": 64,
            "type": "string",
            "description": "Stable name used to compare scheduled runs; keep it unchanged for one watchlist. The first observation of a monitor bills zero verified changes, so starting a new watchlist never charges for baseline events.",
            "default": "competitor-watch"
          },
          "mode": {
            "title": "Monitoring mode",
            "enum": [
              "AUTO",
              "FULL_LIFECYCLE",
              "NEW_LAUNCH_FEED"
            ],
            "type": "string",
            "description": "Auto uses full lifecycle when every page of results finishes and safely falls back to new-launch tracking for very large advertisers.",
            "default": "AUTO"
          },
          "maxAdsPerPage": {
            "title": "Maximum ads per Page or keyword",
            "minimum": 10,
            "maximum": 5000,
            "type": "integer",
            "description": "Safety and scan-cost cap for each Page or keyword target. At the default cap, scanning costs at most $0.45 per Page or keyword plus verified changes and the Actor start. Raise it up to 5,000 for very large advertisers; Auto mode switches to new-launch tracking when a complete active library exceeds this limit.",
            "default": 300
          },
          "outputMode": {
            "title": "Dataset output",
            "enum": [
              "CHANGES_ONLY",
              "ALL_CHECKED"
            ],
            "type": "string",
            "description": "Current ads plus changes is best for the first run and one-time exports. Changes only is best for scheduled alerts.",
            "default": "ALL_CHECKED"
          },
          "includeBaseline": {
            "title": "Label the first baseline as new",
            "type": "boolean",
            "description": "Advanced option for changes-only output. When enabled, the first successful run labels existing ads as NEW instead of creating a silent baseline. Current-ads output already returns them as CURRENT.",
            "default": false
          },
          "includeTentative": {
            "title": "Include first missing observation",
            "type": "boolean",
            "description": "Expose MISSING_ONCE rows before a second complete absence confirms that an ad stopped.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Meta rate-limits datacenter IP addresses, so the Actor uses Apify residential proxies by default. Proxy usage is included in the event price; keep the default unless you route traffic through your own proxies.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "failOnAllTargetsFailed": {
            "title": "Fail when no Page succeeds",
            "type": "boolean",
            "description": "No longer used, kept so older saved inputs still work. When every target fails, the run succeeds with a CRITICAL status message and the per-target errors in OUTPUT.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}