{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Posts Search Scraper: Top Engagement Posts",
    "description": "Find public Facebook posts from search results using keywords, hashtags, or topics. This Apify actor extracts post text, authors, timestamps, links, and engagement signals. Great for trend monitoring, audience research, brand tracking, and competitor analysis in structured data.",
    "version": "0.1",
    "x-build-id": "QMxHgsncrXBE4PcKT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scraper-engine~facebook-posts-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scraper-engine-facebook-posts-search-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/scraper-engine~facebook-posts-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scraper-engine-facebook-posts-search-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/scraper-engine~facebook-posts-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scraper-engine-facebook-posts-search-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": {
          "topics": {
            "title": "🔎 Search Topics",
            "type": "array",
            "description": "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n💡 Keywords to search for on Facebook.\n\nExamples: football • cricket • tech news • recipes • travel\n\n🎯 Each topic = a separate search → more posts discovered.\n(Accepts legacy `searchQueries` input too.)",
            "items": {
              "type": "string"
            }
          },
          "postLimit": {
            "title": "📈 Posts per Topic",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n📊 How many posts to collect per topic?\n\n🎚️ Range: 1 → 5,000\n(Accepts legacy `maxPosts` input too.)"
          },
          "recencyWindow": {
            "title": "⏱️ Recency Window",
            "enum": [
              "",
              "24h",
              "7d",
              "30d",
              "90d"
            ],
            "type": "string",
            "description": "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n📅 Only keep posts published within this window. Posts outside the window are excluded from the dataset (not just the summary log).\n\n⏳ All time (default) • 24h • 7d • 30d • 90d\n(Accepts legacy `postTimeRange` input too.)"
          },
          "includeReactionBreakdown": {
            "title": "❤️ Include Reaction-Type Breakdown",
            "type": "boolean",
            "description": "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n😂 When ON, fetch a per-post breakdown of reaction types (like, love, haha, wow, sad, angry) via Facebook's reactions GraphQL endpoint, sampled from a page of real reactors per post.\n\n⚠️ Slower — adds one or more extra requests per post. Off by default (base behavior).",
            "default": false
          },
          "reactionSampleSize": {
            "title": "🔬 Reaction Sample Size per Post",
            "minimum": 10,
            "maximum": 500,
            "type": "integer",
            "description": "How many individual reactions to sample (via GraphQL pagination) to build the like/love/haha/wow/sad/angry breakdown for each post. Higher = more accurate breakdown, slower run.",
            "default": 50
          },
          "fbSessionCUser": {
            "title": "🍪 Facebook c_user Cookie (optional)",
            "type": "string",
            "description": "Optional Facebook session cookie `c_user`, used only for the reaction-breakdown GraphQL request. Without it (and `fbSessionXs`), reaction breakdown is attempted unauthenticated and returns null if Facebook requires login."
          },
          "fbSessionXs": {
            "title": "🍪 Facebook xs Cookie (optional)",
            "type": "string",
            "description": "Optional Facebook session cookie `xs`, used only for the reaction-breakdown GraphQL request. Without it (and `fbSessionCUser`), reaction breakdown is attempted unauthenticated and returns null if Facebook requires login."
          },
          "includeSentiment": {
            "title": "🧠 Include Sentiment Tag",
            "type": "boolean",
            "description": "When ON, tags each post's `text` as positive / negative / neutral / mixed using a lexicon-based scorer, plus a numeric `sentimentScore` (-1..1). Off by default (base behavior).",
            "default": false
          },
          "targetCountry": {
            "title": "🌍 Target Country",
            "enum": [
              "",
              "us",
              "gb",
              "ca",
              "au",
              "in",
              "de",
              "fr",
              "es",
              "it",
              "br",
              "mx",
              "ng",
              "za",
              "ae",
              "sg",
              "ph",
              "id",
              "nl",
              "se"
            ],
            "type": "string",
            "description": "Bias the search toward a country's results (SERP `gl` param). Leave blank for no country bias (default).",
            "default": ""
          },
          "targetLanguage": {
            "title": "🗣️ Target Language",
            "enum": [
              "",
              "en",
              "es",
              "fr",
              "de",
              "pt",
              "ar",
              "hi",
              "id",
              "tl",
              "zh-CN",
              "ja",
              "ko",
              "ru",
              "it",
              "nl",
              "sv"
            ],
            "type": "string",
            "description": "Language for the search UI/results (SERP `hl` param). Leave blank to use the default (English).",
            "default": ""
          },
          "enableContactLookup": {
            "title": "📇 Enable Page Contact Lookup",
            "type": "boolean",
            "description": "When ON, fetches each post's Facebook Page and extracts public email / phone / website / address from the page's own intro/contact card, attached as `contact` on the row. Off by default (no extra page fetches). Missing fields are `null`, never fabricated.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "💬 Max Comments per Post",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of top-level comments to fetch per post, saved to a separate `comments-<runId>` dataset (not charged). Set to 0 (default) to disable comment fetching entirely.",
            "default": 0
          },
          "proxySettings": {
            "title": "🌐 Proxy Configuration",
            "type": "object",
            "description": "Optional proxy settings for Facebook requests."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}