{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Search Scraper: Keyword Posts, No Login",
    "description": "Facebook search scraper for public posts by keyword, phrase or #hashtag, no login: top or most recent, date window, tagged place, post type and source filters, deep month by month search. Rows: text, author, reactions by type, comments, shares, video views and media. JSON, CSV, API; pay per post.",
    "version": "0.1",
    "x-build-id": "AAhnkCzbWQeUsewMP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation_craft~facebook-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation_craft-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/automation_craft~facebook-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automation_craft-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/automation_craft~facebook-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automation_craft-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": {
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "What to search Facebook for, one query per line (up to 100): a keyword or phrase (climate change), a #hashtag, or a Facebook post search link (facebook.com/search/posts/?q=coffee; its most recent, date and location filters are read too). Any other link (another site, a short link, mailto: or tel:) is skipped free and named in a row, never searched as words. Each query is searched on its own and every row names it. Facebook's search is fuzzy: each row says whether it holds every word (matchesQuery), and \"Only posts that contain the query\" keeps only those. Also read from query, queries and searchTerms.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Order",
            "enum": [
              "top",
              "recent"
            ],
            "type": "string",
            "description": "Facebook's own two orders: top (its relevance ranking, posts of any age) or recent (the newest public posts first). Left empty: top, or the order a pasted search link names. Also read from searchType (latest and newest read as recent)."
          },
          "maxPostsPerQuery": {
            "title": "Posts per query",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "The most new posts delivered per query (and per location). Left empty: 20. A query whose results end earlier is walked month by month when \"Deep search\" is on. Also read from resultsCount, maxResults and resultsLimit."
          },
          "maxPosts": {
            "title": "Posts per run",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "The most posts delivered in the whole run, across queries. Left empty: no cap beyond the per query number and your charge limit. Also read from maxItems."
          },
          "startDate": {
            "title": "Posted on or after",
            "type": "string",
            "description": "The first day of a date window (UTC): YYYY-MM-DD, today, yesterday, or a time back from the run's start such as 7 days, 3 weeks, 2 months, 1 year. Sent to Facebook as its own date filter and checked again on every post (posts outside the window are left out and not charged). Left empty: no start. Also read from postedAfter and dateFrom."
          },
          "endDate": {
            "title": "Posted on or before",
            "type": "string",
            "description": "The last day of the date window (UTC), in the same forms as the start. Left empty: today. Also read from postedBefore and dateTo."
          },
          "locations": {
            "title": "Tagged locations",
            "type": "array",
            "description": "Only posts tagged at a place, one per line: a Facebook location id (108424279189115 is New York, New York) or a place's full name as Facebook writes it (New York, New York; London, United Kingdom), looked up in Facebook's own place list. A name that names no single place gets a free row with Facebook's suggestions and its searches are not run. Each query is searched once per location. Up to 20. Also read from location, locationUid and locationId.",
            "items": {
              "type": "string"
            }
          },
          "deepSearch": {
            "title": "Deep search",
            "type": "boolean",
            "description": "When a query's results end before its post number, go on month by month backwards (this month, the month before, back to the start date or 24 months), each month a new search of its own: Facebook's date filter ranks other posts first, so a month finds posts the plain search did not. Repeats are free.",
            "default": true
          },
          "postTypes": {
            "title": "Post types",
            "type": "array",
            "description": "Only these kinds of post (any of them). Left empty: every kind. Posts of other kinds are left out and not charged. Also read from postType.",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "photo",
                "album",
                "video",
                "reel",
                "link",
                "share",
                "event",
                "listing",
                "unavailable_attachment"
              ],
              "enumTitles": [
                "Text only",
                "One photo",
                "Several photos or videos",
                "Video",
                "Reel",
                "Link",
                "Shared post",
                "Event",
                "Marketplace listing",
                "Attachment no longer available"
              ]
            }
          },
          "postSources": {
            "title": "Posted by",
            "type": "array",
            "description": "Only posts by these sources (any of them): a page, a business page (a page with a business account), a person, or a post made in a public group. Left empty: every source. Also read from postSource.",
            "items": {
              "type": "string",
              "enum": [
                "page",
                "business_page",
                "person",
                "group"
              ],
              "enumTitles": [
                "A page",
                "A business page",
                "A person",
                "Posted in a group"
              ]
            }
          },
          "minReactions": {
            "title": "Minimum reactions",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many reactions (posts with fewer, or with no count shown, are left out and not charged)."
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many comments."
          },
          "minShares": {
            "title": "Minimum shares",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many shares."
          },
          "mustContainQuery": {
            "title": "Only posts that contain the query",
            "type": "boolean",
            "description": "Keep only posts whose text (or shared post text, or link, listing or event title) holds every word of the query as a whole word, case and accents (é, ü, ñ) aside; a query in double quotes must stand as that exact phrase. Off: Facebook's own matches are delivered and each row says whether it holds the query (matchesQuery, matchedWords).",
            "default": false
          },
          "includeKeywords": {
            "title": "Keep posts with any of these words",
            "type": "array",
            "description": "Only posts whose text holds at least one of these words or phrases (whole words, case aside). Up to 50. Also read from keywordFilter.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Leave out posts with any of these words",
            "type": "array",
            "description": "Posts whose text holds any of these words or phrases are left out and not charged (the same matching rule). Up to 50.",
            "items": {
              "type": "string"
            }
          },
          "maxPagesPerQuery": {
            "title": "Pages per search",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "The most result pages read per search (about 5 posts a page). Left empty: no page limit (the posts per search cap and Facebook's own end decide)."
          },
          "maxCommentsPerPost": {
            "title": "Comments per post (add-on)",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Read the comments of each delivered post, oldest first, up to this many, each as its own row (the Comment event). 0 or empty: no comments are read."
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "With comments on: read the replies of each comment too (they count toward the number per post).",
            "default": false
          },
          "includeAllPhotos": {
            "title": "Complete albums (add-on)",
            "type": "boolean",
            "description": "For a post whose search result lists only its first photos, read the post's photo set page and add the photos and videos it holds that the search result did not list (the Complete album event, charged only when the set added items; albumComplete says whether every item of the post was read). Also read from scrapePhotos."
          },
          "outputFormat": {
            "title": "Row form",
            "enum": [
              "full",
              "compact"
            ],
            "type": "string",
            "description": "full: every field; compact: the main fields of a post one level deep (text, author, counts, first image or video, link). Left empty: full. Also read from compact (true or false)."
          },
          "includePersonalData": {
            "title": "Include personal data",
            "type": "boolean",
            "description": "Off (the default): the fields that name or reach a private person are empty: a person author's id, profile link, picture and story id, the ids and links of people tagged or mentioned and of commenters, a listing's seller, and the phones and emails lists read from a text; a person's post link (and its photo, video and comment links) is kept only in a form without the person's profile name or id (a group post, photo, video or reel link), else empty. The names of authors, commenters and people tagged or mentioned, and every text, are delivered as Facebook shows them, either way. On: those fields are filled; you are responsible for a lawful use of personal data (GDPR included).",
            "default": false
          },
          "maxConcurrency": {
            "title": "Searches at once",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many searches are read at the same time, each on its own exit. Left empty: 1 (one after another)."
          },
          "requestDelayMs": {
            "title": "Pause between pages (ms)",
            "minimum": 300,
            "maximum": 10000,
            "type": "integer",
            "description": "The pause between two calls of one search, in milliseconds. Left empty: 400."
          },
          "maxRunSeconds": {
            "title": "Run deadline (seconds)",
            "minimum": 60,
            "maximum": 86400,
            "type": "integer",
            "description": "Stop starting new work after this many seconds and end with the coverage rows and the summary (what was delivered stays delivered and charged). Left empty: the run's own timeout."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy, the datacenter pool by default; choose the RESIDENTIAL group with a country for exits of that country, your own proxies (http(s) links with their port; each new exit takes the next one), or no proxy for the run's own address. Also read from proxy."
          },
          "resumeToken": {
            "title": "Resume token",
            "type": "string",
            "description": "Go on with the searches an earlier run stopped before their end (its post number, its page limit, the charge limit, the run deadline, a refusal): paste the resumeToken of that run's summary row here and run the same searches again, given the same way (the same words, order, date window, and the same place ids or place names). Each search starts where it stopped, searches that run read to the end are not read again, and each search skips, free, the posts it delivered in that run. A post another search of that run delivered can come again and is charged, as in any two separate runs. Left empty: every search starts at its first page."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}