{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Pages + Posts Scraper",
    "description": "Scrape Facebook Pages and posts together. Extract Page details, contacts, followers, captions, reactions, comments, shares, photos, videos, reels, links, and engagement data. Supports Page URLs, direct posts, mixed lists, date filters, and optional encrypted cookies.",
    "version": "0.1",
    "x-build-id": "5mLEaTSoftLdY0Qj8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/trakk~facebook-pages-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-trakk-facebook-pages-posts-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/trakk~facebook-pages-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-trakk-facebook-pages-posts-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/trakk~facebook-pages-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-trakk-facebook-pages-posts-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 URLs",
            "maxItems": 1000,
            "type": "array",
            "description": "Add Facebook Page, profile, post, photo, video, reel, or fb.watch URLs. Pages + Posts mode automatically handles mixed URL lists.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "scrapeType": {
            "title": "🎯 What to scrape",
            "enum": [
              "PAGES_AND_POSTS",
              "PAGES_ONLY",
              "POSTS_ONLY",
              "DIRECT_POSTS"
            ],
            "type": "string",
            "description": "Pages + Posts is the universal default. Focused modes are useful when you need only one record type.",
            "default": "PAGES_AND_POSTS"
          },
          "maxPostsPerPage": {
            "title": "📝 Maximum posts per Page",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum matching posts saved for each Page URL. Direct post URLs always return at most one post.",
            "default": 20
          },
          "startDate": {
            "title": "From date",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional earliest publication date in YYYY-MM-DD format, for example 2026-01-01."
          },
          "endDate": {
            "title": "To date",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional latest publication date in YYYY-MM-DD format."
          },
          "captionText": {
            "title": "Caption contains",
            "maxLength": 500,
            "type": "string",
            "description": "Optional case-insensitive text filter for post captions.",
            "default": ""
          },
          "maxItems": {
            "title": "💯 Maximum total results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard run-wide limit across Page and post rows. The Actor stops saving and requesting more data after this limit or the maximum charge is reached.",
            "default": 500
          },
          "facebookCookies": {
            "title": "🔐 Facebook cookies (optional)",
            "type": "string",
            "description": "Optional encrypted cookies for content visible to your Facebook account. An authenticated session must include c_user and xs. Accepts a Cookie header, JSON browser export, or Netscape cookies.txt. Values are never written to logs or results."
          },
          "cookieFormat": {
            "title": "Cookie format",
            "enum": [
              "AUTO",
              "HEADER",
              "JSON",
              "NETSCAPE"
            ],
            "type": "string",
            "description": "Automatic detection supports the common export formats. Choose a format only if detection is ambiguous.",
            "default": "AUTO"
          },
          "includeRawJson": {
            "title": "Include raw Facebook JSON",
            "type": "boolean",
            "description": "Adds rawJson as a JSON string for advanced integrations. Disabled by default because rows become much larger.",
            "default": false
          },
          "includePageMedia": {
            "title": "📸 Include Page photo & video fallback",
            "type": "boolean",
            "description": "When Facebook limits timeline pagination, fill the remaining post limit with public photo and video publications from the Page's media tabs.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Residential proxy is recommended for reliable Facebook pagination. Cookie mode keeps one account-specific sticky proxy session; avoid changing its country between runs.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          },
          "maxConcurrency": {
            "title": "Maximum concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Number of input URLs processed in parallel. Use 1–2 with Facebook cookies to reduce account warnings.",
            "default": 3
          },
          "requestTimeoutSec": {
            "title": "Request timeout",
            "minimum": 10,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time for one Facebook request.",
            "default": 35
          },
          "maxRetries": {
            "title": "Request retries",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Attempts after temporary blocks or network errors. Public mode can rotate proxy sessions; cookie mode stays on its account-specific sticky session.",
            "default": 3
          },
          "maxPaginationPages": {
            "title": "Maximum pagination requests",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Safety limit per Page. The result limit normally stops pagination first.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}