{
  "openapi": "3.0.1",
  "info": {
    "title": "DEPRECATED - Do Not Use",
    "description": "Deprecated. Do not use this actor. It is pending monetization and store-state correction.",
    "version": "0.0",
    "x-build-id": "5Igb7K0HEOMDK6Q57"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bigdotdata~meta-ad-library-facebook-instagram-messenger/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bigdotdata-meta-ad-library-facebook-instagram-messenger",
        "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/bigdotdata~meta-ad-library-facebook-instagram-messenger/runs": {
      "post": {
        "operationId": "runs-sync-bigdotdata-meta-ad-library-facebook-instagram-messenger",
        "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/bigdotdata~meta-ad-library-facebook-instagram-messenger/run-sync": {
      "post": {
        "operationId": "run-sync-bigdotdata-meta-ad-library-facebook-instagram-messenger",
        "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",
        "required": [
          "preset"
        ],
        "properties": {
          "preset": {
            "title": "What do you want to do?",
            "enum": [
              "QUICK_START",
              "CREATIVE_SNAPSHOT",
              "CHANGE_MONITOR",
              "CUSTOM"
            ],
            "type": "string",
            "description": "Choose one job. Quick Start is the safest first run. Creative Snapshot gives you a capped ad sample with full asset/data packs on by default. Change Monitor is for recurring DELTA checks. Custom unlocks manual workflow tuning.",
            "default": "QUICK_START"
          },
          "mode": {
            "title": "Workflow",
            "enum": [
              "COUNT",
              "SNAPSHOT",
              "DELTA"
            ],
            "type": "string",
            "description": "Only for Custom. Count = one summary row per target. Snapshot = capped ads. Delta = monitoring against a baseline.",
            "default": "COUNT"
          },
          "startUrls": {
            "title": "Start URLs (fastest start)",
            "type": "array",
            "description": "Paste one or more Meta Ad Library URLs here. Use this when you already have the exact search or page open in Meta Ad Library and want the actor to follow it.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "pageIds": {
            "title": "Alternative: Page IDs",
            "type": "array",
            "description": "Use this only when you already know the numeric Facebook Page ID. It can be faster and more reliable than URL parsing, but it is not the best starting point for most users.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Alternative: Keywords",
            "type": "array",
            "description": "Best first-run option if you do not have a URL yet. Type one or more plain search terms like a brand name. Each term becomes one keyword target.",
            "items": {
              "type": "string"
            }
          },
          "targets": {
            "title": "Advanced: typed targets JSON",
            "type": "array",
            "description": "For advanced automation only. Use this when you need to send exact typed targets through the API or mix target types in a single run.",
            "items": {
              "type": "object",
              "required": [
                "type",
                "value"
              ],
              "properties": {
                "type": {
                  "title": "Target Type",
                  "type": "string",
                  "enum": [
                    "AD_LIBRARY_URL",
                    "PAGE_ID",
                    "PAGE_URL",
                    "KEYWORD_QUERY"
                  ],
                  "description": "How to interpret the target value."
                },
                "value": {
                  "title": "Target Value",
                  "type": "string",
                  "description": "PAGE_ID, page URL, keyword query, or a full Ad Library URL (depending on Target Type)."
                }
              }
            }
          },
          "searchOptions": {
            "title": "Search Setup",
            "type": "object",
            "description": "Choose the market and Meta surface you actually want to search before you run. Strict platform labels only is optional and removes rows unless Meta explicitly exposed platform labels on the ad row.",
            "properties": {
              "country": {
                "title": "Country",
                "type": "string",
                "description": "Market to search in. Leave this as `US` unless you intentionally want a different country.",
                "editor": "textfield",
                "default": "US"
              },
              "publisherPlatform": {
                "title": "Platform",
                "type": "string",
                "description": "Choose the Meta surface you want to search. Use All for the broadest Meta Ad Library result set, or pick Facebook, Instagram, Messenger, or Audience Network explicitly.",
                "editor": "select",
                "default": "ALL",
                "enum": [
                  "ALL",
                  "FACEBOOK",
                  "INSTAGRAM",
                  "MESSENGER",
                  "AUDIENCE_NETWORK"
                ],
                "enumTitles": [
                  "All platforms",
                  "Facebook",
                  "Instagram",
                  "Messenger",
                  "Audience Network"
                ]
              },
              "activeStatus": {
                "title": "Ad Status",
                "type": "string",
                "description": "Active = currently running ads, Inactive = older ads, All = both. Presets provide defaults, but you can still set the search you want here.",
                "editor": "select",
                "default": "ACTIVE",
                "enum": [
                  "ACTIVE",
                  "INACTIVE",
                  "ALL"
                ],
                "enumTitles": [
                  "Active ads only",
                  "Inactive ads only",
                  "All ads"
                ]
              },
              "mediaType": {
                "title": "Media Type",
                "type": "string",
                "description": "Optional. Keep All for the normal result set, or narrow the search to image-led or video-led ads.",
                "editor": "select",
                "default": "ALL",
                "enum": [
                  "ALL",
                  "IMAGE",
                  "VIDEO"
                ],
                "enumTitles": [
                  "All media types",
                  "Image ads",
                  "Video ads"
                ]
              },
              "sinceDate": {
                "title": "Since Date",
                "type": "string",
                "description": "Optional. Narrow the run to a more recent window with `YYYY-MM-DD`. Leave blank for the normal full search.",
                "editor": "textfield",
                "default": ""
              },
              "untilDate": {
                "title": "Until Date",
                "type": "string",
                "description": "Optional. Pair with Since Date to create a bounded date window using `YYYY-MM-DD`.",
                "editor": "textfield",
                "default": ""
              },
              "strictObservedPlatformsOnly": {
                "title": "Strict platform labels only",
                "type": "boolean",
                "description": "Keep only ads where Meta explicitly exposed platform labels on the row. Leave this off if you want the fuller filtered result set.",
                "editor": "checkbox",
                "default": false
              }
            },
            "default": {
              "country": "US",
              "publisherPlatform": "ALL",
              "activeStatus": "ACTIVE",
              "mediaType": "ALL",
              "sinceDate": "",
              "untilDate": "",
              "strictObservedPlatformsOnly": false
            }
          },
          "dataOptions": {
            "title": "Data To Extract",
            "type": "object",
            "description": "Turn individual extraction packs on or off. Creative Snapshot and Change Monitor default to richer data, but you can trim the output here if needed.",
            "properties": {
              "includeCopyFields": {
                "title": "Ad Copy",
                "type": "boolean",
                "description": "Include body text, headline, description, and CTA when available.",
                "editor": "checkbox",
                "default": true
              },
              "includeAssetUrls": {
                "title": "Asset URLs",
                "type": "boolean",
                "description": "Include image, video, thumbnail, and carousel-linked asset URLs when Meta exposes them.",
                "editor": "checkbox",
                "default": true
              },
              "includeLandingPages": {
                "title": "Landing Pages",
                "type": "boolean",
                "description": "Include detected destination URLs when they can be extracted.",
                "editor": "checkbox",
                "default": true
              },
              "includeDeliveryInsights": {
                "title": "Delivery Data",
                "type": "boolean",
                "description": "Include estimated audience size, impressions, spend, and any demographic or regional transparency fields Meta exposes.",
                "editor": "checkbox",
                "default": true
              },
              "demoMode": {
                "title": "Demo Mode",
                "type": "boolean",
                "description": "Return deterministic sample rows without hitting Meta. Use this to test workflows, tables, and automations before a live run.",
                "editor": "checkbox",
                "default": false
              }
            },
            "default": {
              "includeCopyFields": true,
              "includeAssetUrls": true,
              "includeLandingPages": true,
              "includeDeliveryInsights": true,
              "demoMode": false
            }
          },
          "maxTargets": {
            "title": "Max Targets",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Only relevant in Custom. Maximum number of targets the actor will process before stopping.",
            "default": 1
          },
          "maxAdsPerTarget": {
            "title": "Max Ads Per Target",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Only relevant in Custom. Maximum number of ads returned per target in Snapshot or Delta mode.",
            "default": 10
          },
          "deltaBaseline": {
            "title": "Delta Baseline",
            "enum": [
              "LAST_RUN",
              "DATASET_ID"
            ],
            "type": "string",
            "description": "Last Run = compare against the actor's saved previous state. Dataset ID = compare against a specific dataset you provide.",
            "default": "LAST_RUN"
          },
          "baselineDatasetId": {
            "title": "Advanced: Baseline Dataset ID",
            "type": "string",
            "description": "Only fill this in when Delta Baseline = Dataset ID. Paste the dataset you want Delta to compare against.",
            "default": ""
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional. Use this if you want a webhook after the run finishes with summary and run-report information.",
            "default": ""
          },
          "debug": {
            "title": "Advanced: Debug Logging",
            "type": "boolean",
            "description": "Turn this on only when you are diagnosing blocking, rate limits, or a support issue.",
            "default": false
          },
          "schemaVersion": {
            "title": "Advanced: Schema Version",
            "type": "string",
            "description": "Leave this at the default unless your automation explicitly pins a schema version.",
            "default": "1.0.0"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Recommended for better success rates. If Meta blocks or rate-limits the run, try Residential proxy or lower caps.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}