{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Reels Scraper, MP4 & AI Transcripts",
    "description": "Scrape public Facebook Reels from pages or reel URLs with no login: play counts, HD MP4/audio URLs, native SRT transcripts + optional AI speech-to-text fallback, first-3s viral hooks, scene summaries, watchlist monitoring, Server API & MCP.",
    "version": "1.0",
    "x-build-id": "CJKUcvoBV3xchIfGr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/forlex~facebook-reels-transcript-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-forlex-facebook-reels-transcript-scraper",
        "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/forlex~facebook-reels-transcript-scraper/runs": {
      "post": {
        "operationId": "runs-sync-forlex-facebook-reels-transcript-scraper",
        "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/forlex~facebook-reels-transcript-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-forlex-facebook-reels-transcript-scraper",
        "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": "🔗 Facebook Page / Reels URLs",
            "type": "array",
            "description": "Facebook page URLs (e.g. https://www.facebook.com/Meta/reels/) or direct reel URLs in Apify Request List format.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "pageHandles": {
            "title": "👤 Facebook Page Handles or URLs",
            "type": "array",
            "description": "Optional Facebook page usernames or URLs (e.g. 'Meta', 'nike', 'https://www.facebook.com/Meta'). Automatically opens their /reels/ tab.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "reelUrls": {
            "title": "🎬 Direct Facebook Reel URLs",
            "type": "array",
            "description": "Optional list of direct facebook.com/reel/... , facebook.com/share/r/... , or fb.watch/... URLs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sourceDatasetId": {
            "title": "📦 Source Dataset ID",
            "type": "string",
            "description": "Optional Apify Dataset ID containing Facebook Reel or Page URLs."
          },
          "datasetUrlField": {
            "title": "🏷️ Dataset URL Field Name",
            "type": "string",
            "description": "Field name in each source dataset row containing the Facebook URL.",
            "default": "url"
          },
          "maxReelsPerPage": {
            "title": "📑 Max Reels Per Page",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum number of reels extracted from each Facebook Page's Reels tab.",
            "default": 10
          },
          "maxItems": {
            "title": "📊 Max Total Reels",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on total reel records returned across the entire run.",
            "default": 20
          },
          "includeTranscript": {
            "title": "📝 Extract Transcript & First-3s Hook (Paid Add-on When Delivered)",
            "type": "boolean",
            "description": "Fetch native Facebook SRT captions (and optionally run ASR fallback) to populate transcriptText, transcriptSrt, transcriptVtt, hookFirst3s, and CTA signals. Charges 'reel-transcript' only when a transcript is delivered.",
            "default": true
          },
          "captionLanguage": {
            "title": "🌍 Preferred Caption Language",
            "type": "string",
            "description": "Preferred ISO language code for native captions (e.g. 'en', 'es', 'id', 'auto').",
            "default": "en"
          },
          "transcribeAudioFallback": {
            "title": "🎙️ Enable AI Audio Transcription Fallback (No Native Captions)",
            "type": "boolean",
            "description": "When a reel has no native Facebook captions, download the audio track and transcribe via AI speech-to-text (built-in Apify OpenRouter or your optional Groq/OpenAI key).",
            "default": false
          },
          "maxAudioMinutes": {
            "title": "⏱️ Max Audio Minutes Per Reel (ASR Safety Cap)",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Skip AI audio transcription fallback if a reel exceeds this duration in minutes.",
            "default": 3
          },
          "analyzeHookWithAi": {
            "title": "🧠 AI Hook & Script Breakdown (Optional Paid Add-on)",
            "type": "boolean",
            "description": "Analyze the opening hook, creative angle, target audience, and script beats with an LLM. Charges 'ai-hook-breakdown' only when analysis succeeds.",
            "default": false
          },
          "outputMode": {
            "title": "📦 Output Mode",
            "enum": [
              "flat",
              "rag"
            ],
            "type": "string",
            "description": "Choose flat structured rows or include enriched ragText Markdown documents.",
            "default": "flat"
          },
          "minPlays": {
            "title": "👁️ Minimum Play Count",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only reels with at least this many plays (when playCount is reported).",
            "default": 0
          },
          "postedAfter": {
            "title": "📅 Posted After",
            "type": "string",
            "description": "Optional date cutoff (YYYY-MM-DD or relative such as '7 days')."
          },
          "keywordFilter": {
            "title": "🔎 Keyword Filter",
            "type": "array",
            "description": "Optional keywords; keeps only reels whose caption or transcript matches at least one keyword.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "watchlistId": {
            "title": "📌 Watchlist Store Name (Optional Delta Sync)",
            "type": "string",
            "description": "Named watchlist key to remember previously seen reel IDs across scheduled runs.",
            "default": ""
          },
          "newReelsOnly": {
            "title": "🆕 Emit Only New Reels Since Last Run",
            "type": "boolean",
            "description": "When Watchlist Store Name is set, skip reels already seen in previous runs.",
            "default": false
          },
          "asrApiKey": {
            "title": "Optional Groq / OpenAI / OpenRouter API Key (Secret)",
            "type": "string",
            "description": "Optional secret API key for Whisper ASR or LLM hook breakdown."
          },
          "asrBaseUrl": {
            "title": "Optional Custom ASR / LLM Base URL",
            "type": "string",
            "description": "Optional OpenAI-compatible base URL (e.g. https://api.groq.com/openai/v1).",
            "default": ""
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Number of Facebook URLs fetched concurrently.",
            "default": 3
          },
          "outputConnector": {
            "title": "Send Reels & Hooks to Notion / Slack / Todoist (MCP Connector)",
            "type": "string",
            "description": "Optional Apify MCP Connector for automated creative briefs delivery."
          },
          "deliverTarget": {
            "title": "Destination Target (Page / Channel ID)",
            "type": "string",
            "description": "Optional destination target for MCP connector delivery.",
            "default": ""
          },
          "deliverMode": {
            "title": "Connector Write Mode",
            "enum": [
              "summary",
              "perReel"
            ],
            "type": "string",
            "description": "Send a single creative brief summary or one item per reel.",
            "default": "summary"
          },
          "deliverMaxItems": {
            "title": "Max Reels to Deliver",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum reels included in connector delivery.",
            "default": 20
          },
          "proxyConfiguration": {
            "title": "Proxy Settings",
            "type": "object",
            "description": "Apify Proxy settings. Datacenter works for most public pages; Residential helps if Facebook rate-limits.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}