{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Ads Analyzer: hooks, offers, CTAs + synthesis brief",
    "description": "Paste an advertiser's page: AI tears down their real Meta ads (hook, offer, CTA, pacing, on-screen text) and writes a brief of what works plus 3 angles to test, on your key. Free preview fetches the actual ads, no key needed.",
    "version": "0.1",
    "x-build-id": "gS89O1biDr3ae4dQD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/frameprobe~ad-teardown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-frameprobe-ad-teardown",
        "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/frameprobe~ad-teardown/runs": {
      "post": {
        "operationId": "runs-sync-frameprobe-ad-teardown",
        "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/frameprobe~ad-teardown/run-sync": {
      "post": {
        "operationId": "run-sync-frameprobe-ad-teardown",
        "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": {
          "startUrls": {
            "title": "Advertiser page or Ad Library URL (one-step)",
            "type": "array",
            "description": "The one-step input: paste a Facebook Page URL (facebook.com/nike) or an Ad Library URL. This Actor runs apify/facebook-ads-scraper for you and analyzes what it finds. The fetch is billed to YOUR Apify account at that scraper's price for your tier (roughly $0.006 per ad on the free tier, as of Aug 2026); this Actor's own events are listed separately under Pricing.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "advertiserName": {
            "title": "Advertiser name (alternative to a URL)",
            "type": "string",
            "description": "A brand or page name, like 'nike'. It is turned into a page-URL guess and the run log confirms which page it resolved to; if that is the wrong advertiser, use the exact page URL in the field above instead."
          },
          "datasetId": {
            "title": "Dataset from an ads scraper run you already made",
            "type": "string",
            "description": "Already ran apify/facebook-ads-scraper? Pick its dataset here (or paste the run ID; the Actor resolves it). Chain immediately after the scraper finishes: Meta media URLs expire within hours."
          },
          "mediaUrls": {
            "title": "Direct media file URLs",
            "type": "array",
            "description": "Direct https links to video or image files, analyzed as ad creatives. Page links do not belong here: put facebook.com pages in the one-step field above.",
            "items": {
              "type": "string"
            }
          },
          "maxCreatives": {
            "title": "Maximum creatives",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Hard stop on how many creatives this run analyzes. At $0.04 per video ad and $0.02 per image ad, 50 creatives is at most a $2.00 ceiling on this Actor's events (your model provider bills separately).",
            "default": 20
          },
          "synthesisBrief": {
            "title": "Produce the synthesis brief",
            "type": "boolean",
            "description": "After the per-ad records, one cross-ad brief: recurring hooks, repeated offers, CTA patterns, what the winners share, and 3 angles to test. $0.15 per brief, charged only when it is produced, and only when at least 5 creatives analyzed successfully.",
            "default": true
          },
          "framesPerVideo": {
            "title": "Frames per video ad",
            "minimum": 2,
            "maximum": 12,
            "type": "integer",
            "description": "How many stills are sampled from each VIDEO creative and sent to the vision model. Image ads always use exactly one. More frames means a more accurate read and a higher bill from your model provider.",
            "default": 6
          },
          "includeOnScreenText": {
            "title": "Extract on-screen text",
            "type": "boolean",
            "description": "Transcribe the text visible in the creative into the onScreenText field. Matters most for image ads, where the overlay text usually carries the offer.",
            "default": true
          },
          "language": {
            "title": "Output language",
            "type": "string",
            "description": "The language for the written fields (hookNotes, whyItWorks, the synthesis brief). Classification values such as hookStyle stay in English so they can be filtered and counted.",
            "default": "en"
          },
          "visionApiKey": {
            "title": "Your vision model API key",
            "type": "string",
            "description": "Your own Anthropic API key, from console.anthropic.com/settings/keys. Analysis runs on your account and you pay Anthropic directly, at their rates. The key is used for the run and never stored or logged. Leave this empty for a free preview: the ads are still fetched (the fetch bills at the scraper's normal price) and the first 3 get their measured structure, with no model called and none of this Actor's per-creative events charged."
          },
          "visionProvider": {
            "title": "Provider",
            "enum": [
              "anthropic"
            ],
            "type": "string",
            "description": "Which API your key belongs to. v1 supports Anthropic only; more providers are planned.",
            "default": "anthropic"
          },
          "visionModel": {
            "title": "Model (optional)",
            "type": "string",
            "description": "Leave blank for claude-sonnet-5, the balanced default. Set claude-opus-5 for the most capable read, or claude-haiku-4-5 to lower your own inference bill. The id is checked against your account before the run starts."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}