{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Search Scraper: Posts by Keyword & Hashtag",
    "description": "Search Facebook posts by keyword, phrase or hashtag. Export text, author, date, reactions, comments, shares and media, with date and location filters.",
    "version": "0.1",
    "x-build-id": "LMnZqavdd80pMEfjE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fetch_cat~facebook-post-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fetch_cat-facebook-post-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/fetch_cat~facebook-post-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fetch_cat-facebook-post-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/fetch_cat~facebook-post-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fetch_cat-facebook-post-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": [
          "query"
        ],
        "properties": {
          "query": {
            "title": "Search query",
            "minLength": 1,
            "maxLength": 100,
            "type": "string",
            "description": "Keyword, phrase or hashtag. Facebook may match the post text, author or related context."
          },
          "resultsCount": {
            "title": "Maximum posts",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum new unique posts to save in this run (1–200). With continuation memory, previous batches do not count against this batch. An ended Facebook search does not prove that every matching post was returned.",
            "default": 20
          },
          "searchType": {
            "title": "Search ranking",
            "enum": [
              "top",
              "latest"
            ],
            "type": "string",
            "description": "Top uses Facebook relevance. Latest selects Facebook's recent-posts filter; results are not guaranteed to be strictly chronological.",
            "default": "top"
          },
          "startDate": {
            "title": "From date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Inclusive publication date in YYYY-MM-DD. Applied to the returned post, not the original of a reshare."
          },
          "endDate": {
            "title": "Through date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Inclusive publication date in YYYY-MM-DD."
          },
          "location": {
            "title": "Facebook location",
            "maxLength": 100,
            "type": "string",
            "description": "Place name or exact numeric Facebook place ID. The resolved place is included in output. A completed lookup with no geographic matches returns zero posts with a warning and run-summary reason; no unfiltered search is performed. Ambiguous names and lookup failures still fail."
          },
          "continuationStoreName": {
            "title": "Continuation memory name",
            "pattern": "^[a-zA-Z0-9-]{1,63}$",
            "type": "string",
            "description": "Optional NEW backfill memory (letters, digits, hyphens). Requires fixed startDate and endDate spanning at most 366 days. Searches the full window, then each UTC day, preserving delivered IDs and unfinished pages across bounded NEW runs. Reuse the same name and search settings sequentially; never overlap or branch batches. No old run or private dataset is imported. A completed pass is not an exhaustive archive. Separate runs have separate time/cost limits. Up to 50,000 remembered IDs; reaching that bound remains incomplete."
          },
          "excludePostIds": {
            "title": "Public post IDs already collected",
            "maxItems": 50000,
            "uniqueItems": true,
            "type": "array",
            "description": "Optional numeric public post IDs from your retained exports, to skip without saving or charging again. Requires continuationStoreName. Keep this list unchanged for the same memory name. Only IDs are supplied; no access to old runs, cookies or private stores is requested. Excluded IDs are not counted as newly collected results.",
            "items": {
              "type": "string",
              "pattern": "^[0-9]{1,40}$"
            }
          },
          "includeComments": {
            "title": "Include preview comments",
            "type": "boolean",
            "description": "Add up to 10 comments that Facebook shows under each post in search results (commenter name and ID, text, time) as topComments. They come with the search results, so there are no extra requests and no extra charge; rows get larger. These are Facebook's preview comments, not all comments.",
            "default": false
          },
          "includeExtraFields": {
            "title": "Additional fields",
            "type": "boolean",
            "description": "Add extra fields that come with the search results: videoViewCount for video posts, and the post's group and tagged place when Facebook includes them. Off by default, so default rows and CSV columns stay unchanged. No extra requests or charges.",
            "default": false
          },
          "maxRunSeconds": {
            "title": "Maximum processing time",
            "minimum": 30,
            "maximum": 600,
            "type": "integer",
            "description": "Maximum processing time in seconds. Reaching this budget finishes successfully with partial results and a clear time-limit reason. Source, network and storage failures still fail the run. The platform timeout may shorten the available processing time.",
            "default": 110
          },
          "proxyConfiguration": {
            "title": "Connection",
            "type": "object",
            "description": "Automatic connection (omitted field or useApifyProxy: true alone) uses a direct anonymous bootstrap followed by US residential search, retaining the same anonymous session. Proxy usage adds platform costs. Explicit managed groups or country are preserved without switching pools; useApifyProxy: false and an empty configuration remain direct, without paid fallback. Facebook may deny these explicitly selected routes. Custom proxy URLs are not supported. Invalid settings fail before searching. Explicit standard managed routes may refresh their connection at most twice within the same selected groups and country. Residential and Unblocker routes do not rotate automatically. A routing notice is included in automatic run summaries."
          },
          "keyword": {
            "title": "Legacy query confirmation",
            "minLength": 1,
            "maxLength": 100,
            "type": "string",
            "description": "Optional compatibility field. Must exactly match query; query remains required. Prefer query alone."
          },
          "results_limit": {
            "title": "Legacy result limit confirmation",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Optional compatibility field. Must exactly match an explicitly supplied resultsCount. Prefer resultsCount alone."
          },
          "search_type": {
            "title": "Legacy content type",
            "enum": [
              "posts"
            ],
            "type": "string",
            "description": "Optional compatibility field for existing integrations. Only posts is supported; searchType independently controls top or latest ranking."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}