{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Page Posts & Comments Scraper",
    "description": "Scrape public Facebook Page, profile, and Group posts with comments and replies. Bulk URLs, date filters, no login. Structured JSON for brand monitoring, sentiment, and research.",
    "version": "1.0",
    "x-build-id": "UBNlkQmPH5o1cc7Ii"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/devil_port369-owner~facebook-page-posts-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-devil_port369-owner-facebook-page-posts-comments-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/devil_port369-owner~facebook-page-posts-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-devil_port369-owner-facebook-page-posts-comments-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/devil_port369-owner~facebook-page-posts-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-devil_port369-owner-facebook-page-posts-comments-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": "Pages, profiles, groups, or post URLs (bulk)",
            "type": "array",
            "description": "Facebook handles or full URLs. Accepts Pages (ronaldo), profile links, public Groups, or single post/reel/permalink URLs. Deduplicated automatically.",
            "items": {
              "type": "string"
            }
          },
          "pageOrUrl": {
            "title": "Single target (optional)",
            "type": "string",
            "description": "Optional single handle or URL (merged with startUrls)."
          },
          "maxPosts": {
            "title": "Max posts per feed",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Recent posts to scrape per Page/profile/Group. Ignored for single post URLs and when afterDate is set.",
            "default": 3
          },
          "maxComments": {
            "title": "Max top-level comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Stop comment pagination after N top-level comments per post. Empty = no limit (can be slow on viral posts)."
          },
          "profile": {
            "title": "Comment depth profile",
            "enum": [
              "tops_only",
              "default",
              "full_replies"
            ],
            "type": "string",
            "description": "tops_only = comments without nested replies (faster). default = replies when FB count is under ~1500. full_replies = always fetch replies.",
            "default": "tops_only"
          },
          "postsOnly": {
            "title": "Posts only (skip comments)",
            "type": "boolean",
            "description": "Discover posts with timestamps and engagement counts; do not scrape comment threads.",
            "default": false
          },
          "linearOutput": {
            "title": "Linear rows (post + comment)",
            "type": "boolean",
            "description": "If enabled, push one dataset row per post and per comment (best for CSV/Excel and CRM). If disabled, push nested post bundles.",
            "default": true
          },
          "includeRepliesInLinear": {
            "title": "Include replies as comment rows",
            "type": "boolean",
            "description": "When linear output is on, also emit nested replies as type=comment with isReply=true.",
            "default": true
          },
          "afterDate": {
            "title": "Posts on or after",
            "type": "string",
            "description": "YYYY-MM-DD. Keep posts from this day onward (inclusive) in dateTimezone. Requires this field when filtering by date."
          },
          "beforeDate": {
            "title": "Posts before",
            "type": "string",
            "description": "YYYY-MM-DD exclusive upper bound in dateTimezone."
          },
          "dateTimezone": {
            "title": "Date timezone",
            "type": "string",
            "description": "UTC, +3, +03:00, or IANA name (e.g. Asia/Kathmandu).",
            "default": "UTC"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Residential proxy recommended. If a public target returns 0 posts, change proxy country and retry.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "engine": {
            "title": "Engine",
            "enum": [
              "async",
              "threads"
            ],
            "type": "string",
            "description": "async (recommended on Apify) or threads.",
            "default": "async"
          },
          "workers": {
            "title": "Workers",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "Override concurrent workers from the profile (1–8)."
          },
          "replyFbCap": {
            "title": "Reply FB cap",
            "type": "integer",
            "description": "Fetch replies only when Facebook comment_count is below this. 0 = tops only."
          },
          "minIntervalSec": {
            "title": "Min interval seconds",
            "type": "number",
            "description": "Pause between comment page requests per worker.",
            "default": 1
          },
          "megaThreshold": {
            "title": "Mega threshold",
            "type": "integer",
            "description": "Pin the heaviest post to a dedicated worker when set."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}