# Facebook Ads Library to Video Scripts: Winning Ads + AI (`ingeniela/winning-ad-video-script-writer`) Actor

Find winning video ads on Meta (Facebook, Instagram), Google (YouTube) and TikTok, transcribe them with timestamps, get a contact sheet of each, break down hook, structure and CTA, and get original shoot-ready ad scripts for your product.

- **URL**: https://apify.com/ingeniela/winning-ad-video-script-writer.md
- **Developed by:** [Ingeniela](https://apify.com/ingeniela) (community)
- **Categories:** AI, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 winning ad studieds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Facebook Ads Library to Video Scripts: Winning Ads + AI

The best ad research is what competitors **keep paying for**. This Actor:

1. finds **winning video ads** in your niche on **Meta** (Facebook + Instagram Ad Library), **Google** (YouTube ads in the Ads Transparency Center) and **TikTok** (Creative Center top ads, ranked by CTR);
2. **transcribes what the videos say, with timestamps**, which the ad libraries don't show;
3. builds a **contact sheet** for each video ad: a grid of 12 timestamped frames plus a **timeline of what is said at each frame**, so you see the edit, the on-screen text and the pacing at a glance;
4. breaks each ad down into **hook → problem → demo → proof → offer → CTA**;
5. optionally writes **original, shoot-ready video ad scripts for your product**: scenes with timings, voiceover, on-screen text, **hooks to A/B test**, primary text, headline and a **brief for your UGC creator**. Turn this off to only review the winning ads.

### Platforms

| Platform | How ads are found | What "winning" means |
|---|---|---|
| Meta (Facebook, Instagram) | Niche keywords or a competitor's Ad Library page | Still active after 30+ days, more versions and placements |
| Google (YouTube) | Competitor domains or advertiser names (`theordinary.com`) | Days served and number of variations |
| TikTok | Niche keywords in the Creative Center top ads (7, 30 or 180 days) | Ranked by CTR (or impressions, conversion rate, 6-second view rate, likes) |

Each platform gets its own winners, so one can't crowd out the others.

### Remake one specific ad

Saw an ad that works? Paste its link in **Ad or video links** (a Facebook Ad Library ad, TikTok, Instagram, YouTube or a video file) and your **website** in **Your website or product page**. You get its transcript with timestamps, its **audio as MP3**, a contact sheet, the breakdown of hook and structure, and a **remix script for your product** that keeps the same pacing, using only the facts on your page.

### Weekly ad spy (Slack and email)

Add your competitors' Ad Library pages or keywords, turn on **Only ads not seen in earlier runs**, add a **Slack webhook** and/or **email addresses**, save it as a task and **schedule it weekly**. Every Monday you get your competitors' new winning ads, their hooks and fresh scripts for your product, without seeing the same ad twice. Use **Spy name** to keep one memory per brand or client.

### Tutorial (1 minute)

![Step-by-step tutorial: what to fill in, click Start, the real result and the price](https://api.apify.com/v2/key-value-stores/RXaOr7FspyrQ4JP88/records/ad-scripts-tutorial.gif)

### Who it is for

- **DTC and e-commerce brands** that need fresh video ad concepts every week.
- **Media buyers and creative strategists** who brief UGC creators.
- **Agencies** producing ads for many clients.
- **Founders** who shoot their own ads and need a script that follows proven structures.

### How "winning" is decided

An advertiser keeps paying only for ads that make money. By default the Actor studies ads that are **still active after 30+ days**, takes video ads first, and picks **at most 2 per advertiser** for variety. You can also paste a competitor's Ad Library page, or paste ad scripts you already know work.

Real run in Spanish:

- it studied 4 vitamin C serum video ads that had been running **190 to 223 days**, all transcribed;
- it found shared patterns, such as a hook that filters the audience in the first 4 seconds, a credible presenter talking to camera, and a simple routine shown step by step;
- it wrote 3 original scripts for a copper peptide serum: a 30 s UGC testimonial, a 15 s problem-solution demo and a 30 s founder talking head.

### What you get

**Scripts** (one row each):

- title, format, length, which winning pattern it follows, 3 hooks to test;
- scenes (time, shot, voiceover, on-screen text), CTA, primary text, headline, and a brief for the creator.

**Winning ads studied** (one row each):

- platform, advertiser, days running (Meta, Google) or CTR (TikTok), length, format;
- the **transcript** of what the video says, and the **contact sheet** image with its **timeline** (time → what is said);
- the breakdown (hook, hook type, angle, structure with second marks, proof, offer, CTA, why it works) and the source link.

**Report** (`REPORT`, HTML): the patterns, every script as a shooting table, and each winning ad with its contact sheet and timeline.

Real run across the 3 platforms: a Meta ad running for 224 days, a Google video ad from a big skincare group and a TikTok top ad with 0.73% CTR. Each one came back transcribed with timestamps and with a 12-frame contact sheet.

### How to use it

1. Describe **your product**: what it is, who it's for, what it does. Optionally add the **offer**, real **proof** you can use, and claims to **never** make. Only reviewing ads? Turn off **Write scripts** and leave the product empty.
2. Choose the **platforms**. Add **niche keywords** (Meta and TikTok), **competitor domains** (Google), a competitor's **Ad Library link**, or paste **ad scripts**.
3. Choose how many **scripts**, their **lengths** and **formats** (UGC testimonial, demo, founder, routine, myth vs fact…), and the language.
4. Click **Start**, open **REPORT**, and send the briefs to your creators.

### Input example

```json
{
  "yourProduct": "A copper peptide face serum for sensitive skin, for women 30-50 who want firmer skin without irritation.",
  "offer": "Free shipping on the first order",
  "avoidClaims": "Medical claims, cures, guaranteed results",
  "platforms": ["meta", "google", "tiktok"],
  "keywords": ["vitamin c serum", "anti aging serum"],
  "googleAdvertisers": ["theordinary.com"],
  "contactSheet": true,
  "country": "US",
  "adsToStudy": 6,
  "scriptsToWrite": 5,
  "durations": [15, 30, 45],
  "formats": ["UGC testimonial", "problem-solution demo", "founder talking head"],
  "language": "English"
}
```

### Pricing

| Event | Price |
|---|---|
| Winning ad studied | $0.01 |
| Video ad transcribed (built-in Whisper) | $0.01 |
| Ad breakdown (built-in AI) | $0.02 |
| Contact sheet (frames + timeline) | $0.01 |
| Script written (built-in AI) | $0.15 |

6 ads with contact sheets plus 5 scripts cost about **$1.05**. Reviewing only (no scripts): about **$0.05 per ad**. With your own OpenAI or OpenRouter key, transcription and AI are free.

Collecting the ads runs on your Apify account, with a spend limit you set:

- Meta: about US$0.00075 per ad;
- Google: about US$0.0019 per ad, plus about US$0.006 per MB to download the videos (a 30 s ad is about 2 MB at 360p);
- TikTok: about US$0.001 per ad.

### Good to know

- The scripts are **original**. The AI learns structure from the ads, and is told never to copy their sentences, claims or brand names, and never to invent results, prices or certifications you didn't give.
- Check every script against your platform's ad policies before running it, especially in health, beauty and finance.
- Each ad library shows ads from the country you choose. Run several countries to compare markets.
- Contact sheets and transcripts are for studying the ads. Don't re-upload other brands' ads.

# Actor input Schema

## `yourProduct` (type: `string`):

What it is, who it's for and what it does. Or just add your website below. Not needed to only review ads.

## `websiteUrl` (type: `string`):

The scripts use the facts on this page (benefits, offer, reviews) and never invent others.

## `offer` (type: `string`):

e.g. '20% off the first order', 'free shipping'.

## `proof` (type: `string`):

Real facts only: reviews, ratings, studies, awards. Nothing else is claimed.

## `avoidClaims` (type: `string`):

e.g. 'medical claims, cures, before/after promises'.

## `adUrls` (type: `array`):

Remake one ad for your product: a Facebook Ad Library ad link (facebook.com/ads/library/?id=…), a TikTok, Instagram or YouTube link, or a video file link. You get its transcript, audio (MP3), contact sheet, breakdown and a remix script. Leave the keywords below empty to study only these.

## `platforms` (type: `array`):

Each platform gets its own winners.

## `keywords` (type: `array`):

Searched in the Meta Ad Library and TikTok Creative Center.

## `googleAdvertisers` (type: `array`):

Google's ad library is searched by advertiser, e.g. 'theordinary.com'.

## `tiktokPeriod` (type: `string`):

Creative Center period.

## `tiktokOrderBy` (type: `string`):

What 'winning' means on TikTok.

## `adLibraryUrls` (type: `array`):

A competitor's page in the Ad Library, or any Ad Library search link.

## `adTexts` (type: `array`):

Ads you already know work: paste their text or transcript, one per line.

## `country` (type: `string`):

Two-letter code (US, ES, MX, BR…).

## `videoOnly` (type: `boolean`):

Video ads are transcribed: what they say is the script.

## `minDaysRunning` (type: `integer`):

Ads still paid for after 30+ days are usually profitable.

## `adsToStudy` (type: `integer`):

Max 2 per advertiser, for variety.

## `transcribeVideos` (type: `boolean`):

Whisper with timestamps, first 90 seconds of each video ad.

## `contactSheet` (type: `boolean`):

A grid of timestamped frames plus a timeline of what is said at each frame.

## `extractAudio` (type: `boolean`):

Download the voiceover and music of each ad as an MP3.

## `framesPerSheet` (type: `integer`):

12 = one frame every 2.5 s on a 30 s ad.

## `scraperMaxCostUsd` (type: `integer`):

Limit per platform: Meta ~US$0.00075/ad, Google ~US$0.0019/ad, TikTok ~US$0.001/ad, YouTube downloads ~US$0.006/MB.

## `writeScripts` (type: `boolean`):

Turn off to only review the winning ads (transcripts, contact sheets, breakdowns).

## `scriptsToWrite` (type: `integer`):

Each with scenes, voiceover, on-screen text, hooks to test and a creator brief.

## `durations` (type: `array`):

e.g. \[15, 30, 60].

## `formats` (type: `array`):

e.g. 'UGC unboxing', 'routine / get ready with me', 'myth vs fact'.

## `hooksPerScript` (type: `integer`):

Alternative opening lines for A/B tests.

## `language` (type: `string`):

Language of the scripts.

## `onlyNewAds` (type: `boolean`):

Schedule the Actor weekly (Saved tasks → Schedule) and each run studies only the new winning ads of your competitors.

## `monitorName` (type: `string`):

Keeps the memory of seen ads separate per brand or client, e.g. 'skincare-client'.

## `slackWebhookUrl` (type: `string`):

A Slack incoming webhook link (api.slack.com/messaging/webhooks). You get the winning ads, hooks and scripts with a link to the report.

## `emailTo` (type: `array`):

Email addresses that get the full report.

## `notifyWhenNothingNew` (type: `boolean`):

Off = you only hear from it when there are new winning ads.

## `aiProvider` (type: `string`):

Leave all keys empty to use the built-in AI (billed per AI event).

## `aiModel` (type: `string`):

Empty = a good default for the provider. Your OpenAI or OpenRouter key is also used for Whisper.

## `anthropicApiKey` (type: `string`):

With your own key (any provider) that provider bills you and AI events are not charged.

## `openaiApiKey` (type: `string`):

Your own key from platform.openai.com.

## `openrouterApiKey` (type: `string`):

Your own key from openrouter.ai/keys.

## `geminiApiKey` (type: `string`):

Your own key from aistudio.google.com/apikey.

## `xaiApiKey` (type: `string`):

Your own key from console.x.ai.

## `deepseekApiKey` (type: `string`):

Your own key from platform.deepseek.com.

## `mistralApiKey` (type: `string`):

Your own key from console.mistral.ai.

## Actor input object example

```json
{
  "yourProduct": "A copper peptide face serum for sensitive skin, for women 30-50 who want firmer skin without irritation.",
  "platforms": [
    "meta",
    "tiktok"
  ],
  "keywords": [
    "vitamin c serum"
  ],
  "tiktokPeriod": "30",
  "tiktokOrderBy": "ctr",
  "country": "US",
  "videoOnly": true,
  "minDaysRunning": 30,
  "adsToStudy": 6,
  "transcribeVideos": true,
  "contactSheet": true,
  "extractAudio": true,
  "framesPerSheet": 12,
  "scraperMaxCostUsd": 1,
  "writeScripts": true,
  "scriptsToWrite": 5,
  "durations": [
    15,
    30,
    45
  ],
  "formats": [
    "UGC testimonial",
    "problem-solution demo",
    "founder talking head"
  ],
  "hooksPerScript": 3,
  "language": "English",
  "onlyNewAds": false,
  "monitorName": "default",
  "notifyWhenNothingNew": false,
  "aiProvider": "auto"
}
```

# Actor output Schema

## `report` (type: `string`):

No description

## `scripts` (type: `string`):

No description

## `ads` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "yourProduct": "A copper peptide face serum for sensitive skin, for women 30-50 who want firmer skin without irritation.",
    "platforms": [
        "meta",
        "tiktok"
    ],
    "keywords": [
        "vitamin c serum"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ingeniela/winning-ad-video-script-writer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "yourProduct": "A copper peptide face serum for sensitive skin, for women 30-50 who want firmer skin without irritation.",
    "platforms": [
        "meta",
        "tiktok",
    ],
    "keywords": ["vitamin c serum"],
}

# Run the Actor and wait for it to finish
run = client.actor("ingeniela/winning-ad-video-script-writer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "yourProduct": "A copper peptide face serum for sensitive skin, for women 30-50 who want firmer skin without irritation.",
  "platforms": [
    "meta",
    "tiktok"
  ],
  "keywords": [
    "vitamin c serum"
  ]
}' |
apify call ingeniela/winning-ad-video-script-writer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ingeniela/winning-ad-video-script-writer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ueE8mFAEulzAHzri7/builds/cgmcBGW6TaYNQ9LjR/openapi.json
