{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Posts Scraper⚡",
    "description": "Facebook Posts Scraper returns Reactions, HD/SD video URLs, attached story, attachment accessibility captions, attachment count, attachment target urls, attachment types, attachments, cache id, can viewer see menu, captions urls, client view config, comet sections, comment count total for every row.",
    "version": "1.0",
    "x-build-id": "z7b2nbIhH3yb4Cc6m"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/premiumscraper~facebook-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-premiumscraper-facebook-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/premiumscraper~facebook-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-premiumscraper-facebook-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/premiumscraper~facebook-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-premiumscraper-facebook-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": {
          "username": {
            "title": "Facebook Username(s)",
            "type": "array",
            "description": "Enter one or more Facebook usernames such as Cristiano, IamSRK, or nike. Each username is automatically converted into a profile or page URL.",
            "items": {
              "type": "string"
            }
          },
          "facebook_urls": {
            "title": "Facebook URLs",
            "type": "array",
            "description": "Add one or more Facebook profile, page, or direct post URLs. Supported formats:\n• Username: Cristiano\n• Profile URL: https://www.facebook.com/Cristiano\n• People URL: https://www.facebook.com/people/Page-Name/123456789/\n• Short path: people/Page-Name/123456789\n• Direct post URL: https://www.facebook.com/Cristiano/posts/pfbid0Dp9Wrmv1NAkFX1nSkKwLEKftjMSHbDYNBZE7L43y8JnTs77USeJ7cpC5FoGgm3inl\n• Direct video URL: https://www.facebook.com/netflix/videos/2445344335530649/\n• Direct photo URL: https://www.facebook.com/photo/?fbid=10123456789012345&set=a.2012345678901234\n• Share-style URL: https://www.facebook.com/share/p/1aocP4P5eR/\n\nDirect post, video, photo, and share URLs are processed only when Direct Post URL Scraping is enabled.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "posts_count": {
            "title": "Timeline Posts Per Profile/Page",
            "minimum": 1,
            "type": "integer",
            "description": "How many timeline posts to request from each profile or page. The actor keeps paginating until this limit is reached or Facebook exposes no more public posts.",
            "default": 10
          },
          "post_types": {
            "title": "🎯 Post Type Filter",
            "type": "array",
            "description": "Filter timeline posts by type. Leave on 'All post types' to scrape every kind of post. If a specific type (e.g. 'Reels only' or 'Carousel / Multi-image posts') is selected, the actor will continue paginating until your requested target count of that specific post type is collected.",
            "items": {
              "type": "string",
              "enum": [
                "all",
                "reel",
                "image",
                "carousel"
              ],
              "enumTitles": [
                "All post types (Default)",
                "Reels only",
                "Single Image posts",
                "Carousel / Multi-image posts"
              ]
            },
            "default": [
              "all"
            ]
          },
          "proxyCountry": {
            "title": "Connection Exit Country",
            "enum": [
              "US",
              "GB",
              "CA",
              "DE",
              "FR",
              "AU",
              "BR",
              "IN",
              "JP",
              "MX"
            ],
            "type": "string",
            "description": "Select country location for Apify Residential connection exit nodes.",
            "default": "US"
          },
          "include_individual_posts": {
            "title": "🔗 Enable Direct Post URL Scraping ($)",
            "type": "boolean",
            "description": "Turn on to scrape direct Facebook post, video, photo, and share URLs from the Facebook URLs field. Extra charge per direct post scraped.",
            "default": false
          },
          "include_comments": {
            "title": "💬 Include Comments ($)",
            "type": "boolean",
            "description": "Turn on to add top-level public comments in comment_details for each post. Charged per visible top-level comment returned.",
            "default": false
          },
          "comments_limit": {
            "title": "💬 Top-Level Comments Limit",
            "minimum": 1,
            "type": "integer",
            "description": "Requested number of top-level public comments to include per post when comment collection is enabled.",
            "default": 20
          },
          "comment_filter": {
            "title": "🧮 Comment Ordering",
            "enum": [
              "most_relevant",
              "newest",
              "all_comments"
            ],
            "type": "string",
            "description": "Choose the public Facebook comment ordering used while paginating top-level comments.",
            "default": "most_relevant"
          },
          "include_comment_replies": {
            "title": "↪️ Include Comment Replies ($)",
            "type": "boolean",
            "description": "Turn on to expand public replies under each collected top-level comment. Charged per visible reply returned.",
            "default": false
          },
          "comment_replies_limit": {
            "title": "↪️ Replies Per Comment Limit",
            "minimum": 1,
            "type": "integer",
            "description": "Requested number of visible replies to include under each top-level comment when reply expansion is enabled.",
            "default": 10
          },
          "include_post_share_person_details": {
            "title": "🔁 Include People Who Shared This Post ($)",
            "type": "boolean",
            "description": "Turn on to add public reshare stories from Facebook's People who shared this post overlay. Charged per visible reshare story returned.",
            "default": false
          },
          "share_people_limit": {
            "title": "🔁 People Who Shared Limit",
            "minimum": 1,
            "type": "integer",
            "description": "Requested number of visible public reshare stories to include per post when share-detail collection is enabled.",
            "default": 10
          },
          "posts_newer_than": {
            "title": "📅 Posts Newer Than",
            "type": "string",
            "description": "Only scrape posts created after this date."
          },
          "posts_older_than": {
            "title": "📅 Posts Older Than",
            "type": "string",
            "description": "Only scrape posts created before this date."
          },
          "keyValueStorePrefix": {
            "title": "🏷️ Key-Value Store Name / Prefix",
            "type": "string",
            "description": "Enter a custom Key-Value Store Name (e.g. `Cristiano` or `my-store_1`). ⚠️ RULES: Only letters (a-z, A-Z), numbers (0-9), hyphens (-) and underscores (_), max 63 characters. Leave empty to use the default unnamed store."
          },
          "storePhotos": {
            "title": "📸 Store Photos in Storage ($)",
            "type": "boolean",
            "description": "If ON, high-resolution photos from single image and carousel posts are saved to Apify Key-Value Storage with permanent non-expiring public download URLs. Charged per photo saved.",
            "default": false
          },
          "storeVideo": {
            "title": "💾 Store Reels & Music in Storage ($)",
            "type": "boolean",
            "description": "If ON, reel/video streams (HD) and companion audio tracks are saved to Apify Key-Value Storage with permanent non-expiring public download URLs. Charged per media asset saved.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}