{
  "openapi": "3.0.1",
  "info": {
    "title": "Ecom Ad Radar — Brand Watchlist & Creative Diff",
    "description": "Monitor competitor Meta ads over time: detect NEW / STOPPED / CHANGED creatives, winner longevity radar, and offer signals. For ecommerce agencies — not a one-shot Ad Library dump.",
    "version": "1.0",
    "x-build-id": "omfxvqFiW4giJniLn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ngoctramtong~ecom-ad-radar/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ngoctramtong-ecom-ad-radar",
        "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/ngoctramtong~ecom-ad-radar/runs": {
      "post": {
        "operationId": "runs-sync-ngoctramtong-ecom-ad-radar",
        "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/ngoctramtong~ecom-ad-radar/run-sync": {
      "post": {
        "operationId": "run-sync-ngoctramtong-ecom-ad-radar",
        "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": {
          "runMode": {
            "title": "Run mode",
            "enum": [
              "monitor",
              "scrape"
            ],
            "type": "string",
            "description": "monitor = diff vs previous snapshot (new/stopped/changed) — the paid product. scrape = one-shot dump only.",
            "default": "monitor"
          },
          "watchlist": {
            "title": "Brand watchlist (Page IDs)",
            "type": "array",
            "description": "Monitor multiple competitor Page IDs in one run. This is the agency workflow.",
            "items": {
              "type": "string"
            }
          },
          "pageId": {
            "title": "Facebook Page ID (single)",
            "type": "string",
            "description": "Optional single Page ID (merged into watchlist). Example: 559929417490965 (Kylie Cosmetics)."
          },
          "pageUrl": {
            "title": "Facebook Page URL",
            "type": "string",
            "description": "Optional label only."
          },
          "keyword": {
            "title": "Keyword search",
            "type": "string",
            "description": "Used only when watchlist/pageId are empty (broader, noisier). Diff/snapshots require page IDs."
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "ISO country code for Ad Library.",
            "default": "US"
          },
          "activeStatus": {
            "title": "Active status",
            "enum": [
              "active",
              "inactive",
              "all"
            ],
            "type": "string",
            "description": "Filter by ad status. Use active for monitor mode (stopped ads are inferred from snapshot gaps).",
            "default": "active"
          },
          "mediaType": {
            "title": "Media type",
            "enum": [
              "all",
              "image",
              "video",
              "meme",
              "image_and_meme"
            ],
            "type": "string",
            "description": "Filter by creative media.",
            "default": "all"
          },
          "maxAds": {
            "title": "Max ads per brand",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum ads to keep per Page ID.",
            "default": 50
          },
          "scrollRounds": {
            "title": "Scroll rounds",
            "minimum": 0,
            "maximum": 40,
            "type": "integer",
            "description": "Pagination depth (GraphQL responses are also captured).",
            "default": 8
          },
          "maxAttempts": {
            "title": "Max attempts",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Retries with a fresh residential proxy when Meta blocks or returns 0 ads.",
            "default": 3
          },
          "winnerMinDays": {
            "title": "Winner min longevity (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Ads active at least this many days can be flagged as winners.",
            "default": 14
          },
          "winnerMinScore": {
            "title": "Winner min creative score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Minimum creativeScore to flag a winner.",
            "default": 70
          },
          "snapshotStoreName": {
            "title": "Snapshot store name",
            "type": "string",
            "description": "Named Apify Key-Value Store used to persist brand snapshots between monitor runs.",
            "default": "ecom-ad-radar-snap-v3"
          },
          "webhookUrl": {
            "title": "Slack / webhook URL",
            "type": "string",
            "description": "Optional. Slack Incoming Webhook or any HTTPS endpoint. Sends NEW/STOPPED/CHANGED alerts after each monitor run."
          },
          "notifyOnlyOnChanges": {
            "title": "Notify only when creatives change",
            "type": "boolean",
            "description": "If true, skip webhook when there are no new/stopped/changed ads (baseline still notifies once).",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy settings. Residential required — Meta blocks datacenter IPs.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}