{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Group Posts & Details Scraper : Comment & Engagement",
    "description": "Scrape Facebook Group posts and full post details at scale. Collect text, images, timestamps, reactions, comments, authors, and engagement metrics. Ideal for community research, sentiment analysis, lead generation, and trend tracking. Export structured data in JSON, CSV, or Excel.",
    "version": "0.1",
    "x-build-id": "PhlI4EHGWwY8k22yJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scraper-engine~facebook-group-posts-and-details-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scraper-engine-facebook-group-posts-and-details-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/scraper-engine~facebook-group-posts-and-details-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scraper-engine-facebook-group-posts-and-details-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/scraper-engine~facebook-group-posts-and-details-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scraper-engine-facebook-group-posts-and-details-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",
        "required": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "🔗 Facebook Group URLs or Identifiers",
            "type": "array",
            "description": "📋 Enter one or more Facebook group URLs or group identifiers.\n\n💡 Examples:\n• Full URL: https://www.facebook.com/groups/germtheory.vs.terraintheory\n• Group ID: germtheory.vs.terraintheory\n\n✨ You can add multiple groups to scrape their posts, comments/replies, and engagement analytics in one run!",
            "items": {
              "type": "string"
            }
          },
          "maxPosts": {
            "title": "📊 Maximum Posts (total across all groups)",
            "minimum": 10,
            "type": "integer",
            "description": "🎯 **Global cap** across the whole run.\n\nWith **multiple** `startUrls`, the cap is split across groups and results are merged, then capped at this value.\n\n📌 Minimum: **10**.\n💡 Example: `maxPosts: 50` with 2 groups → ~25 posts per group, ≤50 total posts (comments/replies are additional, see below).",
            "default": 10
          },
          "sortOrder": {
            "title": "🔄 Sort Order",
            "enum": [
              "RECENT_POSTS",
              "TOP_POSTS",
              "RECENT_ACTIVITY",
              "CHRONOLOGICAL"
            ],
            "type": "string",
            "description": "Sorting strategy for the group feed.",
            "default": "RECENT_ACTIVITY"
          },
          "startDate": {
            "title": "📅 Filter Posts by Date",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
            "type": "string",
            "description": "🗓️ Only scrape posts newer than the selected date.\n\n📝 Format: YYYY-MM-DD (e.g., 2025-02-20)\n\n💡 Leave empty to scrape all available posts regardless of date."
          },
          "monitoringMode": {
            "title": "👁️ Monitoring Mode (only new posts)",
            "type": "boolean",
            "description": "🔔 **Track only fresh content**.\n\nWhen enabled, the Actor remembers which post IDs it has already seen and **skips duplicates in future runs**.\n\n🗂️ Uses Apify Key-Value Store under the hood to persist seen post IDs.",
            "default": false
          },
          "includeComments": {
            "title": "💬 Include Comments & Replies",
            "type": "boolean",
            "description": "🔎 Fetches each collected post's permalink once and extracts its comments + nested replies (author, text, date, likes, reply count, threading depth) into a separate **child dataset**, tagged `type: \"comment\"` / `\"reply\"` with `parentId` linking back to the post/parent comment.\n\n⚠️ Comment volume per post reflects what Facebook renders/returns to an anonymous viewer — some posts may have 0 comments, which is a genuine result, not a failure.",
            "default": true
          },
          "maxCommentsPerPost": {
            "title": "🔢 Max Comments Per Post",
            "minimum": 0,
            "type": "integer",
            "description": "🎯 Caps how many **top-level** comments are collected per post when **Include Comments & Replies** is on. Replies are additional — see **Max Replies Per Comment** below.\n\n📌 Minimum: 0 (0 = feature effectively off even if the toggle above is on).\n💡 Example: `maxCommentsPerPost: 20` + `maxRepliesPerComment: 5` → up to 20 comments and up to 100 replies per post.",
            "default": 20
          },
          "maxRepliesPerComment": {
            "title": "↩️ Max Replies Per Comment",
            "minimum": 0,
            "type": "integer",
            "description": "🎯 Caps how many nested replies are collected **per top-level comment**. Ignored when **Include Comments & Replies** is off.\n\n📌 Minimum: 0 (0 = top-level comments only, no replies).",
            "default": 5
          },
          "commentsSortOrder": {
            "title": "🔀 Comments Sort Order",
            "enum": [
              "all",
              "newest",
              "most_relevant"
            ],
            "type": "string",
            "description": "Order to keep top-level comments in before applying the Max Comments Per Post cap.",
            "default": "all"
          },
          "includeEngagementAnalytics": {
            "title": "📈 Include Engagement Analytics",
            "type": "boolean",
            "description": "📊 Adds one summary row per group (`type: \"analytics\"`) computed locally from this run's own collected data: `topContributors` (post count per author), `postingCadenceEstimate` (posts/day implied by the collected timestamp spread), `totalCommentsCollected`, and `commentsPerPost`. No AI, no extra requests.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy",
            "type": "object",
            "description": "Proxy settings. Your selection is used for every request this Actor makes (group pages, post permalinks, comment pages). Leave default for residential proxy, which tends to be most reliable for Facebook."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}