{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Scraper API by SocialScrape",
    "description": "Scrape Facebook pages, posts, reels, comments, groups, events, Marketplace listings, video transcripts and the Ad Library as JSON. 23 endpoints in one actor, with the same field names on every platform. Pay per result: no API key and no other account needed.",
    "version": "0.1",
    "x-build-id": "0pQVaytPmTH2IpBnf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/socialscrape~facebook-scraper-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-socialscrape-facebook-scraper-api",
        "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/socialscrape~facebook-scraper-api/runs": {
      "post": {
        "operationId": "runs-sync-socialscrape-facebook-scraper-api",
        "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/socialscrape~facebook-scraper-api/run-sync": {
      "post": {
        "operationId": "run-sync-socialscrape-facebook-scraper-api",
        "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": [
          "endpoint"
        ],
        "properties": {
          "endpoint": {
            "title": "Endpoint",
            "enum": [
              "ad_library.search",
              "ad_library.company.ads",
              "ad_library.ad",
              "ad_library.ad.transcript",
              "ad_library.search.companies",
              "profile",
              "profile.posts",
              "profile.reels",
              "profile.photos",
              "profile.events",
              "search.videos",
              "post",
              "post.transcript",
              "post.comments",
              "post.comment.replies",
              "group",
              "group.posts",
              "marketplace.location.search",
              "marketplace.search",
              "marketplace.item",
              "events.search",
              "events",
              "event"
            ],
            "type": "string",
            "description": "What to fetch. The fields below are shared by the endpoints; each endpoint uses only the ones it needs.",
            "default": "profile"
          },
          "query": {
            "title": "Query",
            "type": "string",
            "description": "For ad_library.search: Keyword to search for. For ad_library.search.companies, search.videos, events.search: Search terms. For marketplace.location.search: City or area name. For marketplace.search: Search keyword. Required unless `category_id` is given."
          },
          "sort": {
            "title": "Sort",
            "type": "string",
            "description": "For ad_library.search, ad_library.company.ads: Changing it restarts the cursor chain (one of: relevance, impressions, newest). For post.comments: Order of results. Changing it restarts the cursor chain (one of: top, newest, oldest). For group.posts: Order of results. Changing it restarts the cursor chain (one of: chronological, top, recent_activity, chronological_listings). For marketplace.search: Order of results. Changing it restarts the cursor chain (one of: relevance, distance, newest, price_low, price_high)."
          },
          "match": {
            "title": "Match",
            "enum": [
              "any_words",
              "exact_phrase"
            ],
            "type": "string",
            "description": "Match any of the words, or the exact phrase. Used by: ad_library.search."
          },
          "ad_type": {
            "title": "Ad Type",
            "enum": [
              "all",
              "political"
            ],
            "type": "string",
            "description": "All ads, or only political and issue ads. Used by: ad_library.search."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Only ads in this language, a 2-letter code (EN, ES, FR). Used by: ad_library.company.ads, ad_library.search."
          },
          "status": {
            "title": "Status",
            "enum": [
              "active",
              "inactive",
              "all"
            ],
            "type": "string",
            "description": "Ad status. Used by: ad_library.company.ads, ad_library.search."
          },
          "media_type": {
            "title": "Media Type",
            "enum": [
              "all",
              "image",
              "video",
              "meme",
              "image_and_meme",
              "none"
            ],
            "type": "string",
            "description": "Creative type. `meme` is Meta's word for text on an image. Used by: ad_library.company.ads, ad_library.search."
          },
          "start_date": {
            "title": "Start Date",
            "type": "string",
            "description": "Impressions window start, YYYY-MM-DD. Used by: ad_library.company.ads, ad_library.search."
          },
          "end_date": {
            "title": "End Date",
            "type": "string",
            "description": "Impressions window end, YYYY-MM-DD. Used by: ad_library.company.ads, ad_library.search."
          },
          "region": {
            "title": "Region",
            "type": "string",
            "description": "Two-letter country code (ISO 3166-1) for results that vary by country. Used by: ad_library.company.ads, ad_library.search."
          },
          "trim": {
            "title": "Trim",
            "type": "boolean",
            "description": "Smaller response: drops null fields and `extra`.",
            "default": false
          },
          "raw": {
            "title": "Raw",
            "type": "boolean",
            "description": "Also return the platform's original object as `raw`.",
            "default": false
          },
          "max_age_days": {
            "title": "Max Age Days",
            "minimum": 0,
            "maximum": 30,
            "type": "number",
            "description": "Accept a cached result fetched within this many days. It answers faster."
          },
          "id": {
            "title": "ID",
            "type": "string",
            "description": "For ad_library.company.ads: Ad Library page id of the advertiser (from advertiser search). For ad_library.ad, ad_library.ad.transcript: Ad id in the library. For profile.posts: The profile or page id, as `profile` returns it in `id`. For group, group.posts: Numeric group id; use it instead of `url` if you have it. For marketplace.item: Listing id. For event: Event id."
          },
          "company_name": {
            "title": "Company Name",
            "type": "string",
            "description": "Advertiser name (resolved to a page id). Used by: ad_library.company.ads."
          },
          "url": {
            "title": "URL",
            "type": "string",
            "description": "For ad_library.ad, ad_library.ad.transcript: Ad Library URL (facebook.com/ads/library/?id=...). For profile, profile.posts, profile.reels, profile.photos, profile.events: Profile or page URL. For post, post.transcript, post.comments, post.comment.replies: Post, video or reel URL. For group, group.posts: Public group URL (facebook.com/groups/...). Sub-pages such as /about work too. For marketplace.item: Listing URL (facebook.com/marketplace/item/<id>). For events: City events page (facebook.com/events/explore/<city>/<id>). For event: Event URL (facebook.com/events/<id>)."
          },
          "get_transcript": {
            "title": "Get Transcript",
            "type": "boolean",
            "description": "For ad_library.ad: Accepted for compatibility. A video ad's transcript is its own call, `ad/transcript` (AI transcription, metered); this flag only adds a pointer to it in `extra.transcript_hint`. For post: Include the video's existing captions in `extra.transcript` (none if it has none; `post/transcript` also transcribes the audio with AI).",
            "default": false
          },
          "get_business_hours": {
            "title": "Get Business Hours",
            "type": "boolean",
            "description": "Include the business hours. Used by: profile.",
            "default": false
          },
          "include_gated_profile": {
            "title": "Include Gated Profile",
            "type": "boolean",
            "description": "Return limited public fields for gated or age-restricted pages. Ignored for normal public pages. Used by: profile.",
            "default": false
          },
          "feedback_id": {
            "title": "Feedback ID",
            "type": "string",
            "description": "For post.comments: The post's feedback id (from `post`); using it instead of `url` makes the request much faster. For post.comment.replies: The comment's feedback id (not the comment id), from `post/comments`."
          },
          "comment_id": {
            "title": "Comment ID",
            "type": "string",
            "description": "Id of the parent comment. Used by: post.comment.replies."
          },
          "expansion_token": {
            "title": "Expansion Token",
            "type": "string",
            "description": "The comment's expansion token, from `post/comments`. Used by: post.comment.replies."
          },
          "location": {
            "title": "Location",
            "type": "string",
            "description": "City or area to search around (\"Austin, TX\"). Used by: events.search, marketplace.search."
          },
          "lat": {
            "title": "Lat",
            "type": "number",
            "description": "Latitude of the search centre. Used by: marketplace.search."
          },
          "lng": {
            "title": "Lng",
            "type": "number",
            "description": "Longitude of the search centre. Used by: marketplace.search."
          },
          "category_id": {
            "title": "Category ID",
            "type": "string",
            "description": "Marketplace category id. Without a keyword only these browse: Antiques 393860164117441, Appliances 678754142233400, Bicycles 1658310421102081, Boats 712638205822882, Electronics 1792291877663080, Furniture 1583634935226685, Garden 800089866739547, Household 1569171756675761, Tools 1670493229902393, Trailers 655837954899686, Vehicles 807311116002614 (or 546583916084032). Other ids need a keyword. Used by: marketplace.search."
          },
          "radius_km": {
            "title": "Radius Km",
            "type": "number",
            "description": "Search radius in km. Used by: marketplace.search."
          },
          "min_price": {
            "title": "Min Price",
            "type": "number",
            "description": "Lowest listing price. Used by: marketplace.search."
          },
          "max_price": {
            "title": "Max Price",
            "type": "number",
            "description": "Highest listing price. Used by: marketplace.search."
          },
          "delivery_method": {
            "title": "Delivery Method",
            "enum": [
              "all",
              "local_pickup",
              "shipping"
            ],
            "type": "string",
            "description": "Delivery filter. Used by: marketplace.search."
          },
          "condition": {
            "title": "Condition",
            "enum": [
              "new",
              "used_like_new",
              "used_good",
              "used_fair"
            ],
            "type": "string",
            "description": "Condition filter. Used by: marketplace.search."
          },
          "date_listed": {
            "title": "Date Listed",
            "enum": [
              "all",
              "day",
              "week",
              "month"
            ],
            "type": "string",
            "description": "Listed within. Uses the UI's calendar-day buckets. Used by: marketplace.search."
          },
          "availability": {
            "title": "Availability",
            "enum": [
              "available",
              "sold",
              "all"
            ],
            "type": "string",
            "description": "Availability filter. Used by: marketplace.search."
          },
          "time": {
            "title": "Time",
            "enum": [
              "today",
              "this_week",
              "next_week"
            ],
            "type": "string",
            "description": "Time frame; default all time. Used by: events."
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Follow the cursor for up to this many pages. You pay for the results, not for the pages.",
            "default": 1
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many results. 0 means no limit other than Max pages.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}