{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Groups Posts & Comments Scraper",
    "description": "Gather high-quality data from public Facebook groups—posts, comments, reactions, images, and contextual metadata. Designed for researchers, brands, and developers needing accurate, scalable group insights for analytics or automation.",
    "version": "0.1",
    "x-build-id": "jdiffdNmBhBeYu4Hi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/simpleapi~Facebook-Groups-Scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-simpleapi-Facebook-Groups-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-Groups-Scraper/runs": {
      "post": {
        "operationId": "runs-sync-simpleapi-Facebook-Groups-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-Groups-Scraper/run-sync": {
      "post": {
        "operationId": "run-sync-simpleapi-Facebook-Groups-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",
            "type": "array",
            "description": "Public Facebook group URLs to scrape. Example: https://www.facebook.com/groups/cheapmealideas/. Group numeric IDs also work.",
            "items": {
              "type": "string"
            }
          },
          "resultsLimit": {
            "title": "📊 Max posts (parents)",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of top-level POSTS to scrape. Comments are additional and are NOT counted against this limit. Example: 20. Default is 20.",
            "default": 20
          },
          "viewOption": {
            "title": "🔄 Sort / feed order",
            "enum": [
              "CHRONOLOGICAL",
              "RECENT_ACTIVITY",
              "TOP_POSTS",
              "CHRONOLOGICAL_LISTINGS"
            ],
            "type": "string",
            "description": "How the group feed is ordered. CHRONOLOGICAL = oldest→newest, RECENT_ACTIVITY = most active, TOP_POSTS = most engaging, CHRONOLOGICAL_LISTINGS = Buy/Sell listings.",
            "default": "CHRONOLOGICAL"
          },
          "keywords": {
            "title": "🔤 Include keywords",
            "type": "array",
            "description": "Keep only posts whose text contains at least one of these words (case-insensitive). Leave empty to keep all posts. Example: [\"recipe\", \"vegan\"].",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchGroupKeyword": {
            "title": "🔍 Group search term",
            "type": "string",
            "description": "Client-side search by letter/word inside the group. Without login, single/double letters work best. Example: \"a\".",
            "default": ""
          },
          "searchGroupYear": {
            "title": "📅 Year filter",
            "type": "string",
            "description": "Keep only posts from a specific year, e.g. \"2024\". Best combined with the search term above.",
            "default": ""
          },
          "excludeKeywords": {
            "title": "🚫 Exclude keywords",
            "type": "array",
            "description": "Drop posts whose text contains any of these words (case-insensitive). Example: [\"spam\", \"giveaway\"].",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minLikes": {
            "title": "👍 Minimum likes/reactions",
            "minimum": 0,
            "type": "integer",
            "description": "Drop posts with fewer likes/reactions than this. Example: 10. Default 0 (no minimum).",
            "default": 0
          },
          "minComments": {
            "title": "💬 Minimum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Drop posts with fewer comments than this. Default 0 (no minimum).",
            "default": 0
          },
          "minShares": {
            "title": "🔁 Minimum shares",
            "minimum": 0,
            "type": "integer",
            "description": "Drop posts with fewer shares than this. Default 0 (no minimum).",
            "default": 0
          },
          "onlyPostsNewerThan": {
            "title": "📅 Only posts newer than",
            "pattern": "^$|^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Keep only posts on/after this date. Absolute (2024-01-15) or relative (\"2 weeks\", \"30 days\", \"1 month\")."
          },
          "onlyPostsOlderThan": {
            "title": "📅 Only posts older than",
            "pattern": "^$|^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Keep only posts on/before this date. Absolute (2024-01-15) or relative (\"3 months\", \"1 year\"). Combine with 'newer than' for a date range."
          },
          "includeComments": {
            "title": "💬 Include comments",
            "type": "boolean",
            "description": "When on, collect the available comments for each scraped post. Comments are additional to the post limit and capped by 'Max comments per post'.",
            "default": false
          },
          "maxComments": {
            "title": "🔢 Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Cap the number of comments collected per post. Example: 10. Set 0 for no per-post cap. Default 10.",
            "default": 10
          },
          "aiEnhancement": {
            "title": "🤖 Enable AI enrichment",
            "type": "boolean",
            "description": "When on AND an API key is provided, each post text is classified. Off by default.",
            "default": false
          },
          "aiModel": {
            "title": "🤖 AI model / provider",
            "enum": [
              "claude-haiku-4-5",
              "claude-sonnet-5",
              "claude-opus-4-8",
              "claude-fable-5",
              "gpt-4o-mini",
              "gpt-4o",
              "gpt-4.1-mini",
              "gpt-4.1",
              "o3-mini",
              "o1",
              "gemini-2.0-flash-lite",
              "gemini-2.0-flash",
              "gemini-2.5-flash",
              "gemini-2.5-pro",
              "grok-3-mini",
              "grok-3",
              "deepseek-chat",
              "deepseek-reasoner",
              "sonar",
              "sonar-pro",
              "mistral-small-latest",
              "mistral-large-latest"
            ],
            "type": "string",
            "description": "Provider auto-detected from the name: claude-*=Anthropic, gpt-*/o1/o3=OpenAI, gemini-*=Google, grok-*=xAI, deepseek-*=DeepSeek, sonar*=Perplexity, mistral-*=Mistral. Cheaper mini/flash/haiku models are recommended for classification.",
            "default": "claude-haiku-4-5"
          },
          "aiApiKey": {
            "title": "🔑 AI API key",
            "type": "string",
            "description": "Your LLM provider API key (secret). Used only when AI enrichment is enabled. Env-var fallbacks per provider: ANTHROPIC_API_KEY / OPENAI_API_KEY / GEMINI_API_KEY / XAI_API_KEY / DEEPSEEK_API_KEY / PERPLEXITY_API_KEY / MISTRAL_API_KEY."
          },
          "maxRequestRetries": {
            "title": "🔁 Max request retries",
            "minimum": 0,
            "type": "integer",
            "description": "Retries per GraphQL request before giving up. Example: 3. Default 3.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy configuration",
            "type": "object",
            "description": "Proxy used for requests. Your choice is honored. If left unset, Apify residential proxy is used by default (recommended — Facebook blocks datacenter IPs)."
          },
          "cookieString": {
            "title": "🍪 Facebook cookie string",
            "type": "string",
            "description": "Optional logged-in session cookies (must include c_user + xs) to improve reliability and access closed/private groups. Format: c_user=...; xs=...; datr=...; fr=.... Use a secondary 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}