{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Post & Comment Scraper for Pages, Groups and Profiles",
    "description": "Scrape public Facebook posts from pages, groups, and profiles with best-effort comment extraction. Collect post text, post IDs, permalinks, likes, shares, comment counts, profile data, media URLs, and comment samples. Built for Apify with fallback scraping and proxy suppor",
    "version": "0.0",
    "x-build-id": "HGagGy9l5sIx9J5xc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/thescrapelab~Apify-Facebook-Post-Scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-thescrapelab-Apify-Facebook-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/thescrapelab~Apify-Facebook-Post-Scraper/runs": {
      "post": {
        "operationId": "runs-sync-thescrapelab-Apify-Facebook-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/thescrapelab~Apify-Facebook-Post-Scraper/run-sync": {
      "post": {
        "operationId": "run-sync-thescrapelab-Apify-Facebook-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": "Start URLs",
            "type": "array",
            "description": "Public Facebook page/group/profile URLs to scrape (backward-compatible field).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "targets": {
            "title": "Targets (URL, page, or group name)",
            "type": "array",
            "description": "Use this field to pass Facebook URLs, page names, or group names (for example: NASA, Coca-Cola, groups/apify).",
            "items": {
              "type": "string"
            }
          },
          "maxPosts": {
            "title": "Max posts per URL",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of posts to output for each URL.",
            "default": 20
          },
          "maxScrollRounds": {
            "title": "Max scroll rounds (optional)",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "Override automatic scrolling rounds for dynamic pages. Higher values may reveal more posts but increase runtime.",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many targets to scrape in parallel. Higher values are faster but require more container memory.",
            "default": 3
          },
          "performanceMode": {
            "title": "Performance mode",
            "enum": [
              "fast",
              "balanced",
              "maxCoverage"
            ],
            "type": "string",
            "description": "Choose speed vs coverage tradeoff.",
            "default": "fast"
          },
          "enrichmentMode": {
            "title": "Enrichment mode",
            "enum": [
              "none",
              "basic",
              "deep"
            ],
            "type": "string",
            "description": "Add deeper post/page metadata in the same Actor run. Deep mode also extracts comment text samples from post permalinks (best-effort).",
            "default": "none"
          },
          "maxEnrichedPosts": {
            "title": "Max enriched posts per URL",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "How many collected posts per URL should get enrichment processing.",
            "default": 20
          },
          "maxCommentsPerPost": {
            "title": "Max comment samples per post",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "Used in Deep enrichment mode to limit extracted comment text samples.",
            "default": 10
          },
          "maxCommentExpansionRounds": {
            "title": "Max comment expansion rounds",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Used in Deep enrichment mode to keep expanding comments and replies before extraction. Higher values may recover more comments but increase runtime.",
            "default": 6
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "When enabled, Deep enrichment also clicks reply-expansion controls and includes visible replies in recovered comment samples.",
            "default": true
          },
          "emitCommentItems": {
            "title": "Emit comment items",
            "type": "boolean",
            "description": "When enabled, extracted deep-mode comment samples are also pushed as separate dataset items with itemType=comment.",
            "default": false
          },
          "failOnCommentBlock": {
            "title": "Fail when comments are blocked",
            "type": "boolean",
            "description": "In deep mode, fail the run when Facebook login-wall blocking prevents comment extraction for enriched posts.",
            "default": false
          },
          "useMbasicFallback": {
            "title": "Use mbasic.facebook.com fallback",
            "type": "boolean",
            "description": "When enabled, the scraper will also try mbasic.facebook.com — Facebook's static HTML version that works without JavaScript. This greatly improves coverage for anonymous requests and on blocked IPs.",
            "default": true
          },
          "sessionRotationOnBlock": {
            "title": "Rotate proxy session on block",
            "type": "boolean",
            "description": "When enabled and a proxy is configured, the scraper will automatically rotate to a fresh proxy session when Facebook returns a login-wall or access-denied response.",
            "default": true
          },
          "facebookCookieHeader": {
            "title": "Facebook cookie header (optional)",
            "type": "string",
            "description": "Raw Cookie header from a logged-in Facebook browser session (for example c_user=...; xs=...). Improves coverage when Facebook blocks anonymous timelines."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration (optional)",
            "type": "object",
            "description": "Use Apify Proxy (preferably RESIDENTIAL) or custom proxies to reduce Facebook login-wall blocking."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}