{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Comments Scraper - Replies, Reactions & Dates",
    "description": "Scrape public Facebook comments from any post, reel, video, photo or group post URL: text, commenter, date, reactions by type, reply count, replies threaded to their parent, and the post itself. Newest-first, date window, keyword filters and monitor mode for new comments only. No login or cookies.",
    "version": "0.1",
    "x-build-id": "dLnNtcNuA2N4xK1fb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/topapi~facebook-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-topapi-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/topapi~facebook-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-topapi-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/topapi~facebook-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-topapi-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",
        "properties": {
          "startUrls": {
            "title": "🔗 Facebook post URLs",
            "type": "array",
            "description": "Public post, reel, video, photo or group-post URLs, e.g. https://www.facebook.com/reel/1567627928372584 or a /share/p/ link. A bare post id works as https://www.facebook.com/<id>.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "sortBy": {
            "title": "🔀 Comment order",
            "enum": [
              "newest",
              "most_relevant",
              "all"
            ],
            "type": "string",
            "description": "\"Newest first\" returns every public comment in date order - use it with a date window or monitor mode. \"Most relevant\" is the default view a visitor sees; Facebook hides some comments in it.",
            "default": "newest"
          },
          "onlyCommentsNewerThan": {
            "title": "📅 Comments newer than",
            "type": "string",
            "description": "Keep comments posted on or after this date: absolute (2026-09-01) or relative (7 days, 12 hours, 2 months). Leave empty for no lower bound."
          },
          "onlyCommentsOlderThan": {
            "title": "📅 Comments older than",
            "type": "string",
            "description": "Keep comments posted before this date, e.g. 2026-10-01 or 1 day. Combine with 'Comments newer than' for a window."
          },
          "keywordFilter": {
            "title": "🔤 Keywords",
            "type": "string",
            "description": "Keep only comments whose text contains at least one of these words, comma-separated, case-insensitive, e.g. \"price, refund, broken\". Leave empty to keep all."
          },
          "minReactions": {
            "title": "❤️ Minimum reactions",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep only comments with at least this many reactions (likes, loves, hahas... combined), e.g. 5. 0 keeps all.",
            "default": 0
          },
          "withTextOnly": {
            "title": "📝 Only comments with text",
            "type": "boolean",
            "description": "Skip comments that are only a sticker, GIF or photo with no words (about 2-18% of comments on the posts we measured).",
            "default": false
          },
          "includeReplies": {
            "title": "💬 Include replies",
            "type": "boolean",
            "description": "Also save the replies under each saved comment (two levels deep, as Facebook shows them). Each reply is one row and counts toward 'Max comments per post'.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "↩️ Max replies per comment",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Cap the replies saved under one comment, e.g. 10. 0 = every reply Facebook shows.",
            "default": 0
          },
          "monitorMode": {
            "title": "🔁 Only new comments (monitor mode)",
            "type": "boolean",
            "description": "Remember every comment delivered, per post, and return only new ones next run. With 'Newest first' a run stops at the first page of already-seen comments, so a quiet post costs one request.",
            "default": false
          },
          "monitorStoreName": {
            "title": "🗂️ Monitor memory name",
            "type": "string",
            "description": "Name of the key-value store that holds what was already delivered, e.g. \"brand-posts\". Use one name per schedule; a new name starts from scratch.",
            "default": "facebook-comments-monitor"
          },
          "maxCommentsPerPost": {
            "title": "🔢 Max comments per post",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Comments (and replies, when included) saved per post, e.g. 500. 0 = every comment Facebook serves (up to 20,000 per post). Facebook serves 10 per request.",
            "default": 100
          },
          "maxItems": {
            "title": "🧮 Max comments in total",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stop the whole run after this many rows across all posts, e.g. 1000. 0 = no total cap.",
            "default": 0
          },
          "compact": {
            "title": "🤖 Compact output",
            "type": "boolean",
            "description": "Core fields only (comment id and URL, text, date, author, reactions, replies, post URL) - smaller rows for AI agents, MCP clients and spreadsheets.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy",
            "type": "object",
            "description": "Apify Proxy (default) gives every post a fresh IP; when Facebook refuses three of them the run retries the post on a residential IP. Direct egress also works.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "⚡ Posts in parallel",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many posts are read at the same time, e.g. 3. Comments of one post are always read in order.",
            "default": 2
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}