{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Comments Scraper (Reaction Breakdown & Engagement)",
    "description": "💬 Facebook Comments Scraper (Reaction Breakdown & Engagement) extracts comments from public posts—text, author, time, reactions & replies. 📥 Export CSV/JSON. 📊 Perfect for social listening, sentiment analysis & community management. ⚡ Fast, reliable, scalable.",
    "version": "0.1",
    "x-build-id": "OMA6Ik5qCqJGJQQ2V"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scraply~facebook-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scraply-facebook-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/scraply~facebook-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scraply-facebook-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/scraply~facebook-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scraply-facebook-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",
        "required": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "Facebook post / video links",
            "type": "array",
            "description": "One URL per line. Works with typical post, photo, and reel permalinks from facebook.com.",
            "items": {
              "type": "string"
            }
          },
          "commentSettings": {
            "title": "Comments limits & sort order",
            "type": "object",
            "description": "Max comments, reply depth, and sort order.",
            "properties": {
              "maxComments": {
                "title": "Max comments per post",
                "type": "integer",
                "description": "Hard cap on top-level comments per URL.",
                "editor": "number",
                "default": 10,
                "minimum": 1
              },
              "maxRepliesPerComment": {
                "title": "Max replies per comment",
                "type": "integer",
                "description": "Replies to keep per top-level comment (from the post page's own first page of replies).",
                "editor": "number",
                "default": 2,
                "minimum": 0
              },
              "commentsSortOrder": {
                "title": "Comment order",
                "type": "string",
                "description": "Ordering applied locally after comments are fetched.",
                "editor": "select",
                "enum": [
                  "most_relevant",
                  "newest",
                  "all"
                ],
                "enumTitles": [
                  "Most relevant",
                  "Newest first",
                  "All / original order"
                ],
                "default": "all"
              }
            }
          },
          "onlyCommentsNewerThan": {
            "title": "Extract comments that are newer than",
            "type": "string",
            "description": "Pick an absolute date (e.g. 2024-01-15) or a relative window (e.g. 1 day, 2 weeks, 3 months). Only comments/replies posted after this point are kept. Leave blank to disable."
          },
          "reactionEngagementSettings": {
            "title": "Reaction & engagement analytics options",
            "type": "object",
            "description": "Controls for this variant's own added data: per-comment reaction-type breakdown and derived engagement analytics.",
            "properties": {
              "includeReactionBreakdown": {
                "title": "Include per-comment reaction-type breakdown",
                "type": "boolean",
                "description": "Adds a `reactions` field per comment/reply with raw reaction ids + counts and a best-effort id-to-name map (LIKE/LOVE/HAHA/WOW/SAD/ANGRY/CARE). Unmapped ids keep name=null rather than a guessed name.",
                "editor": "checkbox",
                "default": true
              },
              "computeEngagementAnalytics": {
                "title": "Compute engagement analytics",
                "type": "boolean",
                "description": "Adds `engagementScore`/`engagementRatePercent` per row, a per-post engagement summary row (with best-effort post date + comment velocity), and a run-level top-commenter leaderboard.",
                "editor": "checkbox",
                "default": true
              },
              "topCommentersLimit": {
                "title": "Top commenters to include in the leaderboard",
                "type": "integer",
                "description": "How many ranked commenter rows to save at the end of the run (ranked by total engagement across the whole run).",
                "editor": "number",
                "default": 10,
                "minimum": 1,
                "maximum": 200
              }
            }
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Informational only - the scraper always routes through Apify residential proxy at runtime regardless of what is selected here."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}