{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Groups Scraper",
    "description": "Collect posts from multiple Facebook groups in one run. Filter by keyword, date, or engagement, export posts and comments to CSV or JSON, and schedule repeat collections with Apify Tasks.",
    "version": "0.2",
    "x-build-id": "3JdSqYjcmfeHQqpJf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mo_khairy~fb-multi-group-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mo_khairy-fb-multi-group-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/mo_khairy~fb-multi-group-scraper/runs": {
      "post": {
        "operationId": "runs-sync-mo_khairy-fb-multi-group-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/mo_khairy~fb-multi-group-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-mo_khairy-fb-multi-group-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": {
          "cookie": {
            "title": "Cookies",
            "type": "array",
            "description": "Optional. Exported facebook.com cookies from Cookie-Editor."
          },
          "groupUrls": {
            "title": "Group URLs",
            "type": "array",
            "description": "Primary multi-group input. Example: https://www.facebook.com/groups/1636991833121307",
            "items": {
              "type": "string"
            }
          },
          "scrapeGroupPosts.groupUrl": {
            "title": "Legacy single group URL",
            "type": "string",
            "description": "Backward compatibility field. You can use this or groupUrls."
          },
          "groupOverrides": {
            "title": "Per-group overrides",
            "type": "array",
            "description": "Optional. Array of { url, count?, cursor?, sortType?, scrapeUntil? }."
          },
          "count": {
            "title": "Default post limit per group",
            "minimum": 1,
            "type": "integer",
            "description": "Leave empty to keep scraping until no new posts are found."
          },
          "cursor": {
            "title": "Default start cursor",
            "type": "string",
            "description": "Optional default cursor. Group override cursor has priority.",
            "default": ""
          },
          "sortType": {
            "title": "Default sort type",
            "enum": [
              "most_relevant",
              "recent_activity",
              "new_posts"
            ],
            "type": "string",
            "description": "Default feed sorting mode used when group override does not set sortType.",
            "default": "new_posts"
          },
          "scrapeUntil": {
            "title": "Default scrape-until date",
            "type": "string",
            "description": "Only keep posts newer than this date. Supports YYYY-MM-DD, ISO timestamp, or relative values like \"30 days\"."
          },
          "outputProfile": {
            "title": "Output profile",
            "enum": [
              "compact",
              "analytics",
              "full"
            ],
            "type": "string",
            "description": "Controls response payload size and detail level for pushed dataset items.",
            "default": "analytics"
          },
          "commentsMode": {
            "title": "Comments mode",
            "enum": [
              "top",
              "full"
            ],
            "type": "string",
            "description": "Choose between fast top comments extraction or full comment pagination.",
            "default": "top"
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Used only when commentsMode is full.",
            "default": 50
          },
          "includeReactionBreakdown": {
            "title": "Include reaction breakdown",
            "type": "boolean",
            "description": "When enabled, include per-reaction counts (like/love/haha/wow/sad/angry/care) when available.",
            "default": true
          },
          "keywordInclude": {
            "title": "Keyword include list",
            "type": "array",
            "description": "If set, only posts containing at least one keyword are kept.",
            "items": {
              "type": "string"
            }
          },
          "keywordExclude": {
            "title": "Keyword exclude list",
            "type": "array",
            "description": "Posts containing any excluded keyword are skipped.",
            "items": {
              "type": "string"
            }
          },
          "minEngagement": {
            "title": "Minimum engagement",
            "type": "object",
            "description": "Optional object with reactions/comments/shares minimum thresholds."
          },
          "incrementalMode": {
            "title": "Incremental mode",
            "enum": [
              "off",
              "new_only",
              "refresh_recent"
            ],
            "type": "string",
            "description": "Controls whether to emit all posts, only new posts, or refresh recent posts.",
            "default": "new_only"
          },
          "refreshWindowDays": {
            "title": "Refresh window days",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Used with incrementalMode=refresh_recent.",
            "default": 7
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional. Run-complete summary webhook destination."
          },
          "maxGroupsConcurrency": {
            "title": "Max groups concurrency",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "Maximum number of group feeds processed in parallel. Keep low for stability.",
            "default": 1
          },
          "emitTrends": {
            "title": "Emit trends report",
            "type": "boolean",
            "description": "If enabled, writes GROUP_TRENDS analytics report to Key-Value Store.",
            "default": false
          },
          "trendWindowDays": {
            "title": "Trend window days",
            "minimum": 7,
            "maximum": 180,
            "type": "integer",
            "description": "Lookback window (days) used for optional trend analytics output.",
            "default": 30
          },
          "enrichmentMode": {
            "title": "Enrichment mode",
            "enum": [
              "off",
              "ocr",
              "scoring",
              "ocr_scoring"
            ],
            "type": "string",
            "description": "Optional enrichment mode. Core scraping works independently when set to off.",
            "default": "off"
          },
          "maxAiItemsPerRun": {
            "title": "Max AI items per run",
            "minimum": 1,
            "type": "integer",
            "description": "Soft guardrail for maximum number of items sent to enrichment."
          },
          "maxAiCostUsd": {
            "title": "Max AI cost USD",
            "minimum": 0.01,
            "type": "number",
            "description": "Soft guardrail for estimated enrichment spend per run."
          },
          "minDelay": {
            "title": "Minimum wait duration (seconds)",
            "minimum": 1,
            "type": "integer",
            "description": "Minimum delay between feed scrolls.",
            "default": 1
          },
          "maxDelay": {
            "title": "Maximum wait duration (seconds)",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum delay between feed scrolls.",
            "default": 10
          },
          "proxy": {
            "title": "Proxy",
            "type": "object",
            "description": "Recommended for reliability. If using cookies, prefer a proxy in the same country as your Facebook account."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}