{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Posts Scraper⚡",
    "description": "📊Scrape public Facebook posts from Pages, Profiles, and direct post, video, photo, or share URLs. Get text, media, reactions, comment and share counts, HD/SD video URLs, captions, timestamps, optional comments, replies, share details, date filters, and multi-profile support⚡Facebook Posts Scraper⚡",
    "version": "1.0",
    "x-build-id": "sNzALP3LtSbHY9LIj"
  },
  "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
          },
          "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. When off, those direct URLs are skipped. Returned direct URLs are billed as individual posts.",
            "default": false
          },
          "include_comments": {
            "title": "💬 Include Comments",
            "type": "boolean",
            "description": "Turn on to add top-level public comments in comment_details for each post. There is no charge just for enabling this switch; billing applies only to visible comments that are actually returned. When off, comment_details returns a guidance object while top-level Facebook comment counts can still appear when available.",
            "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. Returned comments appear in comment_details.all_comments. If Facebook exposes fewer comments than requested, comment_details.request explains that.",
            "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. This applies only when comment collection is enabled. Most relevant has no surcharge. Newest and All comments add an extra per-post filter charge.",
            "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. Full reply records stay nested under comment_details.all_comments[].all_replies, and each parent comment includes reply_details with requested-versus-returned feedback. There is no charge just for enabling this switch; billing applies only to visible replies that are 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. Full reply rows stay under each comment, and reply_details reports per-comment reply availability so you can see when fewer replies were public than requested.",
            "default": 10
          },
          "include_post_share_person_details": {
            "title": "🔁 Include People Who Shared This Post",
            "type": "boolean",
            "description": "Turn on to add the share_details group with public reshare stories from Facebook's People who shared this post overlay. There is no charge just for enabling this switch; billing applies only to visible reshare-story rows that are actually returned. When off, share_details returns a guidance object while top-level share_count_total can still appear when available.",
            "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. Returned stories appear in share_details.all_share_people. If Facebook exposes fewer rows than requested, share_details.request explains that. Billing is based on the number of returned public reshare stories.",
            "default": 10
          },
          "posts_newer_than": {
            "title": "📅 Posts Newer Than",
            "type": "string",
            "description": "Only scrape posts created after this date. Leave empty for no lower date limit. Applying a date filter adds a small extra per-post surcharge."
          },
          "posts_older_than": {
            "title": "📅 Posts Older Than",
            "type": "string",
            "description": "Only scrape posts created before this date. Leave empty for no upper date limit. Applying a date filter adds a small extra per-post surcharge."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}