{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Group Posts & Detail Scraper: Keyword & Content Filter",
    "description": "Automate the extraction of Facebook Group posts and detailed engagement data. Retrieve text, media, comment counts, reactions, authors, and posting frequency. Useful for social listening, competitor research, and community analytics.",
    "version": "0.1",
    "x-build-id": "G3gNuYeJ4Dw9BqVcN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/api-empire~facebook-group-posts-and-details-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-api-empire-facebook-group-posts-and-details-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/api-empire~facebook-group-posts-and-details-scraper/runs": {
      "post": {
        "operationId": "runs-sync-api-empire-facebook-group-posts-and-details-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/api-empire~facebook-group-posts-and-details-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-api-empire-facebook-group-posts-and-details-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 Group URLs or Identifiers",
            "type": "array",
            "description": "📋 Enter one or more Facebook group URLs or group identifiers to scrape directly.\n\n💡 Examples:\n• Full URL: https://www.facebook.com/groups/germtheory.vs.terraintheory\n• Group ID: germtheory.vs.terraintheory\n\n✨ Optional when Discovery Keywords (below) is used instead — combine both to merge explicit groups with keyword-discovered ones in a single run.",
            "items": {
              "type": "string"
            }
          },
          "monitoringMode": {
            "title": "👁️ Monitoring Mode (only new posts)",
            "type": "boolean",
            "description": "🔔 **Track only fresh content**.\n\nWhen enabled, the Actor remembers which post IDs it has already seen and **skips duplicates in future runs**.\nPerfect for monitoring active groups every day without re‑processing old posts.\n\n🗂️ Uses Apify Key‑Value Store under the hood to persist seen post IDs.",
            "default": false
          },
          "maxPosts": {
            "title": "📊 Maximum Posts (total across all groups)",
            "minimum": 10,
            "type": "integer",
            "description": "🎯 **Global cap** across the whole run, across BOTH explicit groups (startUrls) and keyword-discovered groups.\n\nThe cap is **split** across all resolved groups and results are merged, then capped at this value.\n\n📌 Minimum: **10**.\n💡 Example: `maxPosts: 50` with 5 resolved groups → ~10 posts per group, **≤50** total in the dataset.",
            "default": 10
          },
          "sortOrder": {
            "title": "🔄 Sort Order",
            "enum": [
              "RECENT_POSTS",
              "TOP_POSTS",
              "RECENT_ACTIVITY",
              "CHRONOLOGICAL"
            ],
            "type": "string",
            "description": "Sorting strategy for the group feed.",
            "default": "RECENT_ACTIVITY"
          },
          "startDate": {
            "title": "📅 Filter Posts by Date",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
            "type": "string",
            "description": "🗓️ Only scrape posts newer than the selected date.\n\n📝 Format: YYYY-MM-DD (e.g., 2025-02-20)\n\n💡 Leave empty to scrape all available posts regardless of date\n✨ Useful for getting only recent content or posts from a specific time period"
          },
          "discoveryKeywords": {
            "title": "🔎 Discovery Keywords",
            "type": "array",
            "description": "📋 Enter one or more keywords/topics. Each keyword is resolved to a set of MATCHING groups, all matches across every keyword are deduped, and the merged group list is fed into the same fetch used for Facebook Group URLs above.\n\n💡 Example: [\"cheap meal ideas\", \"cooking recipes\", \"budget cooking\"] → resolves each keyword to its own matching groups, then scrapes posts from every distinct group found.\n\n✨ Leave empty to only use the group URLs/IDs from Facebook Group URLs or Identifiers above. A per-keyword discovery-coverage summary (which keyword found which groups) is saved to this run's key-value store as `DISCOVERY_COVERAGE_SUMMARY`.",
            "items": {
              "type": "string"
            }
          },
          "maxGroupsPerKeyword": {
            "title": "🔢 Max Groups Per Keyword",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "🎯 Caps how many matching groups are kept PER keyword during discovery (only applies when Discovery Keywords is used).\n\n💡 Example: 3 keywords × maxGroupsPerKeyword=5 → up to 15 distinct groups feed into the run (fewer if the same group surfaces for more than one keyword). Default is 5.",
            "default": 5
          },
          "keywords": {
            "title": "✅ Include Posts Containing Keywords",
            "type": "array",
            "description": "🔍 Only keep posts whose text contains AT LEAST ONE of these keywords (case-insensitive). Applied uniformly to every post in the run, whether its group came from Facebook Group URLs or Discovery Keywords.\n\n💡 Example: [\"recipe\", \"meal prep\"] → only posts mentioning \"recipe\" or \"meal prep\" survive.\n\n✨ Leave empty to keep posts regardless of content.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "🚫 Exclude Posts Containing Keywords",
            "type": "array",
            "description": "🙅 Drop any post whose text contains ANY of these keywords (case-insensitive).\n\n💡 Example: [\"for sale\", \"selling\"] → removes sales-pitch posts from the results.\n\n✨ Leave empty to disable.",
            "items": {
              "type": "string"
            }
          },
          "minPostLength": {
            "title": "📏 Minimum Post Length (characters)",
            "minimum": 0,
            "type": "integer",
            "description": "📐 Only keep posts whose text is at least this many characters long — filters out low-signal one-liners.\n\n💡 Example: 40 → drops short posts like \"Yes!\" or \"Thanks\".\n\n✨ Default is 0 (no minimum).",
            "default": 0
          },
          "contentMode": {
            "title": "🖼️ Content Mode",
            "enum": [
              "ALL",
              "TEXT_ONLY",
              "ATTACHMENT_ONLY"
            ],
            "type": "string",
            "description": "🎛️ Narrow results by content type:\n• All posts — no filtering by content type\n• Text-only — only posts that have real post text\n• Attachment-only — only posts that have an image/media attachment",
            "default": "ALL"
          },
          "authorIdFilter": {
            "title": "👤 Filter By Author ID",
            "type": "string",
            "description": "🎯 Only keep posts from ONE specific member — enter their numeric `postAuthorId` (visible in this actor's own output). Useful for tracking a single member's activity across one or more groups.\n\n💡 Example: 100003819380079\n\n✨ Leave empty to keep posts from every author."
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy",
            "type": "object",
            "description": "Configure the proxy used to fetch group and post data. Defaults to Apify's residential proxy group when left blank, which is recommended for reliability."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}