{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Search Scraper - Posts, Pages & Places",
    "description": "Search publicly indexed Facebook posts, pages, profiles and places by keyword. Supports location and date filters without a Facebook login, cookies or account pool.",
    "version": "1.0",
    "x-build-id": "gKYQToGXqOoU6vZeB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/thirdwatch~facebook-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-thirdwatch-facebook-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/thirdwatch~facebook-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-thirdwatch-facebook-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/thirdwatch~facebook-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-thirdwatch-facebook-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "page_posts",
              "group_posts",
              "post_comments",
              "page_details",
              "search"
            ],
            "type": "string",
            "description": "Page posts, public group posts, post comments and replies, public page details, or keyword search over the public web index.",
            "default": "page_posts"
          },
          "pageUrls": {
            "title": "Page URLs or usernames",
            "maxItems": 100,
            "type": "array",
            "description": "Used by Page posts and Page details. Accepts https://www.facebook.com/nasa, a bare username like nasa, or a profile.php?id=... URL.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "default": []
          },
          "groupUrls": {
            "title": "Public group URLs",
            "maxItems": 100,
            "type": "array",
            "description": "Used by Group posts. Example: https://www.facebook.com/groups/pygame/. Private, closed and members-only groups are not readable without a login; they are reported as a failure rather than returned empty.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "default": []
          },
          "postUrls": {
            "title": "Post URLs",
            "maxItems": 100,
            "type": "array",
            "description": "Used by Post comments. Accepts Page post URLs (/posts/..., including the pfbid form), public group post URLs (/groups/<group>/posts/<id>/), /photo/?fbid=..., /videos/... and permalink.php URLs. Reels (/reel/...) are not supported - Facebook renders no comment payload for a logged-out reel viewer.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 900
            },
            "default": []
          },
          "maxResults": {
            "title": "Maximum posts or pages",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum records for Page posts, Group posts and Page details, shared across all supplied sources.",
            "default": 10
          },
          "maxCommentsPerPost": {
            "title": "Maximum comments per post",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Used by Post comments. Caps TOP-LEVEL comments per post; replies are returned in addition, capped separately by the replies limit below. Facebook serves anonymous visitors only part of a busy thread - roughly 30 comments on a post whose counter reads 87 - so a run can finish below this cap because the source stopped serving.",
            "default": 50
          },
          "includeReplies": {
            "title": "Include reply threads",
            "type": "boolean",
            "description": "Fetch the replies under each top-level comment. Replies carry parent_comment_id so threads can be rebuilt.",
            "default": true
          },
          "maxRepliesPerComment": {
            "title": "Maximum replies per comment",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Cap on replies fetched under each top-level comment.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Leave as-is for the tested defaults: residential exits for Page posts and Group posts, the shared pool for Post comments and Page details. Facebook returns a login shell for public Group pages to datacenter IPs, and rate-limits Page timeline pagination there. Choosing a group, a country or your own proxy URLs overrides the default.",
            "default": {
              "useApifyProxy": true
            }
          },
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "Search mode only. Keyword or phrase to find in public Facebook results."
          },
          "search_type": {
            "title": "Search type",
            "enum": [
              "posts",
              "pages",
              "places",
              "global"
            ],
            "type": "string",
            "description": "Search mode only. Search public posts, pages/profiles, places, or all indexed Facebook result types.",
            "default": "posts"
          },
          "max_posts": {
            "title": "Maximum search results",
            "minimum": 5,
            "maximum": 1000,
            "type": "integer",
            "description": "Search mode only. Maximum number of unique results across all queries. The minimum of 5 protects the Actor's per-run economics; public search-index depth varies by keyword.",
            "default": 50
          },
          "recent_posts": {
            "title": "Recent posts only",
            "type": "boolean",
            "description": "Search mode only. For post searches, prefer results indexed during the past week. Explicit dates take precedence.",
            "default": false
          },
          "location": {
            "title": "Location",
            "type": "string",
            "description": "Search mode only. Optional city, region or country added to the search, for example Austin, Texas or London, UK."
          },
          "start_date": {
            "title": "Date from",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Search mode only. Optional earliest index date in YYYY-MM-DD format."
          },
          "end_date": {
            "title": "Date to",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Search mode only. Optional latest index date in YYYY-MM-DD format."
          },
          "queries": {
            "title": "Additional queries",
            "maxItems": 19,
            "type": "array",
            "description": "Search mode only. Optional additional search terms processed in the same run.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            },
            "default": []
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}