{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Group Posts & Comments Scraper",
    "description": "Facebook Group Post Scraper extracts posts from public Facebook groups, capturing text, images, videos, author details, timestamps, reactions, comments, and share data. Ideal for community research, trend analysis, social listening, and automating structured Facebook group post insights.",
    "version": "0.1",
    "x-build-id": "qk9Z0wRVn7uxAKmNU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/simpleapi~facebook-group-post-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-simpleapi-facebook-group-post-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/simpleapi~facebook-group-post-scraper/runs": {
      "post": {
        "operationId": "runs-sync-simpleapi-facebook-group-post-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/simpleapi~facebook-group-post-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-simpleapi-facebook-group-post-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 Group URLs",
            "type": "array",
            "description": "One or more Facebook group URLs, vanity names, or numeric group IDs. Each row is tagged with its source group. Example: https://www.facebook.com/groups/cheapmealideas",
            "items": {
              "type": "string"
            }
          },
          "groupUrl": {
            "title": "🔗 Single Group URL (legacy)",
            "type": "string",
            "description": "Optional single-group input, kept for backward compatibility. If both are set, this is merged with the list above. Example: https://www.facebook.com/groups/cheapmealideas"
          },
          "count": {
            "title": "📊 Max Posts",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of PARENT posts to collect across all groups. Comments/replies are additional and do NOT count against this limit. Set 0 for unlimited. Example: 50.",
            "default": 20
          },
          "sortType": {
            "title": "🔀 Sort Posts By",
            "enum": [
              "new_posts",
              "most_relevant",
              "recent_activity"
            ],
            "type": "string",
            "description": "How Facebook orders the feed. 🆕 New posts = newest first (enables date early-stop). ⭐ Most relevant = top by engagement. 🔥 Recent activity = recently commented.",
            "default": "new_posts"
          },
          "scrapeUntil": {
            "title": "📅 Only Posts Newer Than",
            "type": "string",
            "description": "Keep only posts created on/after this date. Accepts an absolute date (2026-01-15 or 2026-01-15T00:00:00Z) or a relative value (\"7 days\", \"2 weeks\", \"3 months\"). On 🆕 New posts sort, pagination stops early once older posts are reached. Leave empty to scrape all. UTC."
          },
          "includeComments": {
            "title": "💬 Include Comments",
            "type": "boolean",
            "description": "Fetch each post's comments as separate CHILD rows (type=comment, isChild=true), interleaved right after the parent post and mirrored to a per-run comments dataset.",
            "default": false
          },
          "maxComments": {
            "title": "💬 Max Comments per Post",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Cap of comments fetched per post via the comments pagination API. 0 = none (unless Include Comments is on, then unlimited). Example: maxComments=10 → up to 10 comments per post.",
            "default": 0
          },
          "maxReplies": {
            "title": "↩️ Max Replies per Comment",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Cap of replies fetched per comment (type=reply, isChild=true, parentId=comment). 0 = skip replies. Example: maxComments=10 + maxReplies=3 → up to 10 comments and up to 30 replies per post.",
            "default": 0
          },
          "keywords": {
            "title": "🔍 Include Keywords",
            "type": "array",
            "description": "Keep only posts whose text contains at least one of these terms (case-insensitive OR). Leave empty to keep all. Example: [\"recipe\", \"cheap\"].",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "🚫 Exclude Keywords",
            "type": "array",
            "description": "Drop posts whose text contains any of these terms (case-insensitive). Example: [\"giveaway\", \"spam\"].",
            "items": {
              "type": "string"
            }
          },
          "postType": {
            "title": "📺 Post Type Filter",
            "enum": [
              "any",
              "text",
              "photo",
              "video",
              "link"
            ],
            "type": "string",
            "description": "Keep only posts of this media type. 'text' keeps posts with no attachment.",
            "default": "any"
          },
          "minReactions": {
            "title": "👍 Minimum Reactions",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only posts with at least this many reactions. 0 = no minimum. Example: 5.",
            "default": 0
          },
          "minDelay": {
            "title": "⏳ Min Delay (seconds)",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "Minimum delay between paginated requests, in seconds, to reduce rate-limiting. Example: minDelay=1 + maxDelay=3 → random 1–3s pause between feed pages. Default 1.",
            "default": 1
          },
          "maxDelay": {
            "title": "⏳ Max Delay (seconds)",
            "minimum": 0,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum delay between paginated requests, in seconds. Must be ≥ Min Delay. Default 3.",
            "default": 3
          },
          "cookie": {
            "title": "🔑 Cookie (experimental)",
            "type": "string",
            "description": "Optional raw Cookie header from a logged-in Facebook session, to access closed groups you are a member of. Experimental: public groups do not need it. Format: \"c_user=...; xs=...; datr=...\"."
          },
          "proxy": {
            "title": "🌐 Proxy",
            "type": "object",
            "description": "Proxy configuration. Residential proxy is strongly recommended — Facebook blocks datacenter IPs for group feeds.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}