{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Comments & Conversation Scraper",
    "description": "Extract public Facebook comments and replies from posts, photos, videos, and reels. Get clean datasets with comment text, author details, timestamps, engagement counts, and thread fields for social listening, research, reporting, and AI workflows.",
    "version": "0.1",
    "x-build-id": "ixnDMYvTok1HMs8No"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/qaseemiqbal~facebook-comments-conversation-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-qaseemiqbal-facebook-comments-conversation-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/qaseemiqbal~facebook-comments-conversation-scraper/runs": {
      "post": {
        "operationId": "runs-sync-qaseemiqbal-facebook-comments-conversation-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/qaseemiqbal~facebook-comments-conversation-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-qaseemiqbal-facebook-comments-conversation-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 URLs",
            "minItems": 1,
            "type": "array",
            "description": "Facebook post, photo, video, or reel URLs to scrape.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "additionalProperties": true,
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL",
                  "description": "Facebook post, photo, video, or reel URL.",
                  "pattern": "^(https?://)?((www|m|mobile|web)\\.)?(facebook\\.com|fb\\.watch)/.+"
                }
              }
            }
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of total comment/reply records to save across all input URLs.",
            "default": 1000
          },
          "maxCommentsPerPost": {
            "title": "Maximum top-level comments per post",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum top-level comments to extract from each Facebook URL.",
            "default": 500
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Expand and save replies to top-level comments.",
            "default": true
          },
          "maxRepliesPerComment": {
            "title": "Maximum replies per comment",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum replies to extract for each top-level comment.",
            "default": 50
          },
          "maxThreadDepth": {
            "title": "Maximum thread depth",
            "minimum": 0,
            "maximum": 2,
            "type": "integer",
            "description": "0 = top-level comments only, 1 = comments and replies, 2 = comments, replies, and nested replies.",
            "default": 2
          },
          "sortOrder": {
            "title": "Comment sorting",
            "enum": [
              "MOST_RELEVANT",
              "RECENT_ACTIVITY",
              "ALL_COMMENTS"
            ],
            "type": "string",
            "description": "Order in which comments are loaded. Date filtering automatically uses newest-first sorting.",
            "default": "MOST_RELEVANT"
          },
          "onlyCommentsNewerThan": {
            "title": "Only comments newer than",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2}|\\d{4}-\\d{2}-\\d{2}T.*Z?|\\d+\\s*(minute|minutes|hour|hours|day|days|week|weeks|month|months|year|years))$",
            "type": "string",
            "description": "Optional date filter. Use YYYY-MM-DD, ISO timestamp, or relative values like '1 day', '2 months', '3 years', or '1 hour'."
          },
          "onlyCommentsOlderThan": {
            "title": "Only comments older than",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2}|\\d{4}-\\d{2}-\\d{2}T.*Z?|\\d+\\s*(minute|minutes|hour|hours|day|days|week|weeks|month|months|year|years))$",
            "type": "string",
            "description": "Optional upper date bound. Use YYYY-MM-DD, ISO timestamp, or a relative date."
          },
          "includePostMetadata": {
            "title": "Include post metadata",
            "type": "boolean",
            "description": "Include post title/text, post ID, canonical URL, and source URL fields where visible.",
            "default": true
          },
          "includeAuthorProfile": {
            "title": "Include author profile metadata",
            "type": "boolean",
            "description": "Include public author name, profile ID, and profile URL where visible.",
            "default": true
          },
          "includeProfilePicture": {
            "title": "Include profile picture URL",
            "type": "boolean",
            "description": "Include public profile picture URL where visible.",
            "default": true
          },
          "includeAdLibraryStatus": {
            "title": "Include page Ad Library status",
            "type": "boolean",
            "description": "Attempt to include page Ad Library activity status when available.",
            "default": false
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "FLAT",
              "FLAT_AND_THREADS"
            ],
            "type": "string",
            "description": "Save flat dataset only, or also save nested thread trees to the key-value store.",
            "default": "FLAT"
          },
          "deduplicate": {
            "title": "Deduplicate comments",
            "type": "boolean",
            "description": "Avoid saving duplicate comment records caused by repeated pagination or retries.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Select proxies for stable scraping. Apify Proxy with residential proxies is recommended for Facebook."
          },
          "maxConcurrency": {
            "title": "Maximum concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of browser pages processed in parallel.",
            "default": 3
          },
          "maxRequestsPerMinute": {
            "title": "Maximum requests per minute",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Rate limit for crawler requests.",
            "default": 60
          },
          "maxRequestRetries": {
            "title": "Maximum request retries",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum retries for failed requests before marking the URL as failed.",
            "default": 3
          },
          "debugMode": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Enable verbose logs and extra diagnostics.",
            "default": false
          },
          "saveHtmlSnapshots": {
            "title": "Save failed page snapshots",
            "type": "boolean",
            "description": "Save HTML and screenshots for failed pages to the key-value store.",
            "default": false
          },
          "failOnPostError": {
            "title": "Fail run on post error",
            "type": "boolean",
            "description": "If enabled, the Actor fails when any input URL fails. Otherwise, failed URLs are reported in the summary.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}