{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Group Posts & Comments Scraper",
    "description": "Scrape public Facebook group posts and, optionally, the people who COMMENT on them (repliers), with no login. Get post text, author, time, images, reactions, plus each commenter's name, profile link, text, and any phone number. Great for lead generation. Turn on Fetch comments to include repliers.",
    "version": "1.0",
    "x-build-id": "t1rmPyRQa0vpqsKYb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/swerve~fb-group-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-swerve-fb-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/swerve~fb-group-scraper/runs": {
      "post": {
        "operationId": "runs-sync-swerve-fb-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/swerve~fb-group-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-swerve-fb-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",
        "required": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "Group URLs",
            "type": "array",
            "description": "One or more Facebook group URLs (e.g. https://www.facebook.com/groups/123456789 or https://www.facebook.com/groups/some-slug — both work). For private/closed groups you must also paste cookies below, from an account that is a member of the group.",
            "items": {
              "type": "string"
            }
          },
          "resultsLimit": {
            "title": "Total posts across all groups (optional cap)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional cost cap on the total number of posts returned across every group combined. Leave this blank to return ALL matching posts from every group. If you set a number, the actor stops once it reaches that total. There is no upper limit, so on large groups a blank value can return a lot of posts (you pay per result). Example: set 500 to stop after 500 posts total."
          },
          "maxPostsPerGroup": {
            "title": "Max posts per group (optional cap)",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cost cap on how many posts to take from each single group. Leave this blank to scrape ALL available posts from every group. If you set a number, scraping of a group stops after that many posts. Combined with the total limit above, whichever is hit first wins. Big or active groups can hold thousands of posts, so a blank value can return a lot (you pay per result). Example: set 25 to take at most 25 posts per group."
          },
          "postedAfter": {
            "title": "Posted after",
            "type": "string",
            "description": "Optional. Only return posts published on or after this date. Accepts ISO format (YYYY-MM-DD). Useful for monitoring a group over time without re-scraping old posts."
          },
          "keyword": {
            "title": "Keyword filter",
            "type": "string",
            "description": "Optional. Only return posts whose text contains this string (case-insensitive). Useful for lead-gen, brand monitoring, or moderation use cases."
          },
          "fetchComments": {
            "title": "Fetch comments (repliers) - great for leads",
            "type": "boolean",
            "description": "OFF by default. Turn ON to also collect the people who COMMENT on each post, not just the post. Each post gets a 'comments' list: the commenter's name, profile link, comment text, any phone number in the text, timestamp, and reply depth. Perfect for lead generation, e.g. buyers/renters or interested customers replying to a listing. Cost note: this loads each post's page to read its comments, so it uses a bit more time and compute; to keep it cheap we automatically SKIP posts that have zero comments and only fetch the ones that actually have replies. No login needed.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post (optional cap)",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cap on how many comments to keep per post. Leave blank to keep all comments available on the post's page. Only applies when 'Fetch comments' is on. Example: 30."
          },
          "knownPostIds": {
            "title": "Known post ids (skip their comment fetch)",
            "type": "array",
            "description": "Posts you already ingested on a previous run (numeric post ids, or full post URLs - the numeric id is extracted either way). Known posts are still returned from the cheap group-feed fetch, but their page is NOT re-opened to read comments, which is the per-post cost driver. Use this when scanning the same groups on a schedule so you only pay comment fetches for posts you have never seen. Leave empty to fetch comments for every post. Example: [\"2174749456705215\"]."
          },
          "cookies": {
            "title": "Facebook cookies (for private/closed groups only)",
            "type": "string",
            "description": "ONLY needed for private or closed groups. Leave EMPTY for public groups.\n\nThe Facebook account you copy cookies from MUST already be a member of the target group — we cannot join groups on your behalf.\n\nHow to get them (Chrome/Edge/Brave):\n1. Open facebook.com in your browser and log in to the account that is a member of the group.\n2. Open the browser's developer tools: press F12 (or right-click anywhere → Inspect).\n3. Go to the 'Application' tab (Chrome/Edge) or 'Storage' tab (Firefox).\n4. In the left sidebar, expand 'Cookies' and click 'https://www.facebook.com'.\n5. Find the rows named: c_user, xs, datr, fr, sb. Copy each row's 'Value'.\n6. Paste them here as one line, separated by '; ', like: c_user=12345; xs=abcd; datr=efgh; fr=ijkl; sb=mnop\n\nEasier option: install a cookie-export browser extension (e.g. 'Cookie-Editor' or 'EditThisCookie'), open facebook.com, click the extension, choose 'Export as Header String', paste here. JSON exports from cookie extensions (e.g. 'Export as JSON' in Cookie-Editor) are also accepted.\n\nThese cookies give full access to your Facebook account. Treat them like a password. Apify stores this field as a secret."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}