{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Search Scraper & Public Events",
    "description": "🔍 Collect public data from Facebook search results based on your keywords. This Apify actor extracts page names, posts, links, and basic engagement data. Useful for research, trend tracking, and competitor analysis with clean, structured output ready to export.",
    "version": "0.1",
    "x-build-id": "KFsHjTWayoSC19U84"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scraper-engine~facebook-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scraper-engine-facebook-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/scraper-engine~facebook-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scraper-engine-facebook-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/scraper-engine~facebook-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scraper-engine-facebook-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",
        "properties": {
          "categories": {
            "title": "🏷️ Categories",
            "type": "array",
            "description": "Business types to search (Pub, Bar, Restaurant...). Combined with locations → e.g. \"Pub NYC\", \"Bar London\".",
            "default": [
              "Pub"
            ],
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "📍 Locations",
            "type": "array",
            "description": "Where to search (NYC, London...) — paired with each category.",
            "default": [
              "NYC"
            ],
            "items": {
              "type": "string"
            }
          },
          "resultsLimit": {
            "title": "📊 Results Limit",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Max pages to scrape across all queries. Higher = more data, longer run.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy",
            "type": "object",
            "description": "Optional. No proxy by default. Auto fallback to datacenter → residential if blocked."
          },
          "includeEvents": {
            "title": "🎟️ Include upcoming events tab",
            "type": "boolean",
            "description": "Read facebook.com/<page>/events. Returns up to 8 event nodes per page. Measured on 8 business pages: 6/8 pages rendered events, 2/8 returned an empty tab.",
            "default": true
          },
          "includePastEvents": {
            "title": "🕓 Include past events tab",
            "type": "boolean",
            "description": "Also read facebook.com/<page>/past_hosted_events. Measured on 6 event-bearing pages: 3/6 returned a fully disjoint second set of 8 events (16 total), 3/6 returned the same 8 the first tab already showed.",
            "default": true
          },
          "includeEventDetails": {
            "title": "🔍 Fetch each event's detail page",
            "type": "boolean",
            "description": "One extra request per event. Adds description, venue coordinates, full address, timezone, ticket link and cover photo. Turn off for a much faster, listing-only run.",
            "default": true
          },
          "maxEventsPerPage": {
            "title": "🔢 Max events per page",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "Cap on events kept per business page, newest first. Facebook serves at most 8 per tab, so 16 is the practical ceiling.",
            "default": 8
          },
          "onlyPagesWithUpcomingEvents": {
            "title": "📅 Only keep pages with an upcoming event",
            "type": "boolean",
            "description": "Filters on isPast == false, not on \"has any events\" — the events tab also serves years-old events. Off by default: measured on 8 pages, only 3 had a genuinely upcoming event, so switching this on drops most rows.",
            "default": false
          },
          "cookies": {
            "title": "🍪 Facebook cookies (optional)",
            "type": "object",
            "description": "Optional cookie jar, e.g. {\"c_user\": \"...\", \"xs\": \"...\"}. NOT required — every page, events tab and event detail page this actor reads was verified logged-out. Supply it only if you want to reach an age-gated page. Stored encrypted."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}