{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Search Scraper",
    "description": "Search Facebook by keyword across Events, Marketplace and the Ad Library (ads and advertisers) in one Actor. No login or cookies needed.",
    "version": "1.0",
    "x-build-id": "dMdsJkKhd8BxUqLXm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~facebook-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-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/khadinakbar~facebook-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-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/khadinakbar~facebook-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-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": {
          "query": {
            "title": "Search keyword",
            "type": "string",
            "description": "The keyword to search Facebook for. Free text, e.g. 'coffee festival', 'Nike', or 'electric bike'. Applies to whichever surface you pick in searchType. This is NOT a Facebook URL; pass plain words. To search several keywords in one run, use 'queries' instead (or in addition)."
          },
          "queries": {
            "title": "More keywords (optional)",
            "type": "array",
            "description": "Up to 10 extra keywords searched at the same time in one run. Results are merged, de-duplicated and stop at 'maxResults' in total. Example: ['electric bike','e-scooter'].",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search type",
            "enum": [
              "ads",
              "advertisers",
              "events",
              "marketplace"
            ],
            "type": "string",
            "description": "Which Facebook surface to search. 'ads' and 'advertisers' query the public Ad Library; 'events' finds public events; 'marketplace' finds for-sale listings (needs a location). Defaults to 'ads'. These are the only surfaces Facebook lets you keyword-search without logging in — public post/page/profile keyword search is login-gated and served by sibling actors.",
            "default": "ads"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of results to return and charge for, across all keywords and countries together. Range 1-500, default 50. Free-plan accounts are limited to 100 per run. Keep it modest for quick, low-cost runs.",
            "default": 50
          },
          "location": {
            "title": "Marketplace location",
            "type": "string",
            "description": "City or place used to anchor Marketplace listings, e.g. 'Austin, TX' or 'London, UK'. Required only when searchType is 'marketplace'; ignored for every other search type. The actor resolves it to coordinates automatically. Leave empty unless searching Marketplace."
          },
          "country": {
            "title": "Ad Library country",
            "type": "string",
            "description": "Two-letter ISO country code to scope Ad Library results, e.g. 'US', 'GB', or 'IN'. Used only when searchType is 'ads'; leave empty to search all countries. Does not affect events, advertisers, or marketplace. Example: 'US'."
          },
          "countries": {
            "title": "More countries (ads only)",
            "type": "array",
            "description": "Up to 10 two-letter country codes for Ad Library ads, searched at the same time, e.g. ['US','GB','CA']. Each keyword is searched in each country. Ignored for events, advertisers and marketplace.",
            "items": {
              "type": "string"
            }
          },
          "adStatus": {
            "title": "Ad status",
            "enum": [
              "ACTIVE",
              "INACTIVE",
              "ALL"
            ],
            "type": "string",
            "description": "For ads only. 'ACTIVE' returns ads that are running now, 'INACTIVE' returns ended ads, 'ALL' returns both. Default 'ACTIVE'.",
            "default": "ACTIVE"
          },
          "adType": {
            "title": "Ad type",
            "enum": [
              "ALL",
              "POLITICAL_AND_ISSUE_ADS"
            ],
            "type": "string",
            "description": "Restrict Ad Library ads to all ads or only political/issue ads. 'ALL' returns every ad type; 'POLITICAL_AND_ISSUE_ADS' returns only regulated political ads. Defaults to 'ALL'. Applies only to searchType 'ads'.",
            "default": "ALL"
          },
          "adSort": {
            "title": "Ad sort order",
            "enum": [
              "impressions",
              "recent"
            ],
            "type": "string",
            "description": "For ads only. 'impressions' lists the most-seen ads first; 'recent' lists the newest ads first. Default 'impressions'.",
            "default": "impressions"
          },
          "exactPhrase": {
            "title": "Exact phrase (ads)",
            "type": "boolean",
            "description": "For ads only. Turn on to match the keyword as an exact phrase instead of any of its words. Default off.",
            "default": false
          },
          "language": {
            "title": "Ad language",
            "type": "string",
            "description": "For ads only. Two-letter language code such as 'EN', 'ES' or 'FR' to keep only ads in that language. Leave empty for all languages."
          },
          "mediaType": {
            "title": "Ad media type",
            "enum": [
              "ALL",
              "IMAGE",
              "VIDEO",
              "MEME",
              "IMAGE_AND_MEME",
              "NONE"
            ],
            "type": "string",
            "description": "For ads only. Keep only ads with this kind of creative. 'ALL' returns every ad.",
            "default": "ALL"
          },
          "startDate": {
            "title": "Ads shown from (date)",
            "type": "string",
            "description": "For ads only. Keep ads with impressions from this date, format YYYY-MM-DD, e.g. '2026-10-01'. Leave empty for no start limit."
          },
          "endDate": {
            "title": "Ads shown until (date)",
            "type": "string",
            "description": "For ads only. Keep ads with impressions up to this date, format YYYY-MM-DD, e.g. '2026-11-01'. Leave empty for no end limit."
          },
          "radiusKm": {
            "title": "Marketplace radius (km)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "For marketplace only. Search radius around the location in kilometres. Leave empty for the default radius."
          },
          "minPrice": {
            "title": "Marketplace minimum price",
            "minimum": 0,
            "type": "integer",
            "description": "For marketplace only. Hide listings below this price (in the local currency). Leave empty for no minimum."
          },
          "maxPrice": {
            "title": "Marketplace maximum price",
            "minimum": 0,
            "type": "integer",
            "description": "For marketplace only. Hide listings above this price (in the local currency). Leave empty for no maximum."
          },
          "marketSort": {
            "title": "Marketplace sort",
            "enum": [
              "suggested",
              "distance_ascend",
              "creation_time_descend",
              "price_ascend",
              "price_descend"
            ],
            "type": "string",
            "description": "For marketplace only. How listings are ordered. Default 'suggested'.",
            "default": "suggested"
          },
          "condition": {
            "title": "Marketplace condition",
            "enum": [
              "new",
              "used_like_new",
              "used_good",
              "used_fair"
            ],
            "type": "string",
            "description": "For marketplace only. Keep only listings in this condition. Leave empty for any condition."
          },
          "deliveryMethod": {
            "title": "Marketplace delivery",
            "enum": [
              "all",
              "local_pickup",
              "shipping"
            ],
            "type": "string",
            "description": "For marketplace only. 'local_pickup' or 'shipping' to filter by how the buyer gets the item. Default 'all'.",
            "default": "all"
          },
          "dateListed": {
            "title": "Marketplace listed within",
            "enum": [
              "all",
              "last_24_hours",
              "last_7_days",
              "last_30_days"
            ],
            "type": "string",
            "description": "For marketplace only. Keep only listings posted within this window. Default 'all'.",
            "default": "all"
          },
          "concurrency": {
            "title": "Parallel searches",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many keyword/country searches run at the same time. Default 5 (maximum 5). Lower it to 1 to run them one after another.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}