{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Pages Search Scraper - Contacts, Followers & Ratings",
    "description": "Search Facebook Pages by keyword and location: name, Page ID, category, followers, rating, phone, email, website, address with coordinates, hours, price range, social links, creation date and ad status. Facebook's own search, no login. $1.60 per 1,000 Pages, $3.60 with the profile.",
    "version": "0.1",
    "x-build-id": "HWsVRLvQTi2EWOlvh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/topapi~facebook-pages-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-topapi-facebook-pages-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/topapi~facebook-pages-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-topapi-facebook-pages-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/topapi~facebook-pages-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-topapi-facebook-pages-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": "Search terms",
            "type": "array",
            "description": "What to search for, one per line: a kind of business (\"dentist\"), a brand or a Page name. Each term is searched on its own with Facebook's own Pages search, the list a Facebook visitor sees. Facebook matches the words against Page names, so \"plumber austin\" finds Pages with those words in their name. Facebook search URLs (facebook.com/search/pages/?q=...) can go in \"Facebook search URLs\" below.",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "Location (added to each search term)",
            "type": "array",
            "description": "Optional city, region or country, one per line, e.g. \"New York\" or \"Austin, TX\". Each search term is searched once per location, with the location added to its words (\"pizza New York\"), as the leader does. Facebook offers no location filter to signed-out visitors (measured: its Pages location filter answers 0 results signed out), so turn on \"Only Pages that mention the location\" to drop Pages from elsewhere.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search type",
            "enum": [
              "pages",
              "places"
            ],
            "type": "string",
            "description": "Pages = Facebook's Pages search (businesses, brands, organisations, creators). Places = Facebook's Places search (Pages with a physical location). Both return the same Page row.",
            "default": "pages"
          },
          "resultsLimit": {
            "title": "Maximum Pages in total",
            "minimum": 0,
            "type": "integer",
            "description": "Stop the run after this many Pages across every search. You pay only for Pages delivered. 0 = no limit.",
            "default": 100
          },
          "maxResultsPerSearch": {
            "title": "Maximum Pages per search",
            "minimum": 1,
            "type": "integer",
            "description": "Stop each search term (x location) after this many Pages. Empty = only the total limit applies. Facebook's own list ends sooner for narrow terms: measured 75 Pages for \"plumber austin\", 202 for \"dentist london\", 338+ for \"restaurant\"."
          },
          "startUrls": {
            "title": "Facebook search URLs",
            "type": "array",
            "description": "Facebook search links such as https://www.facebook.com/search/pages/?q=coffee%20roaster or /search/places/?q=... The words in q= are searched like a search term.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "includeDetails": {
            "title": "Page profile (phone, email, website, followers, rating...)",
            "type": "boolean",
            "description": "On: each Page's own About tab is read for its profile: category, followers, talking about, were here, intro, phone, email, website, address with coordinates, social links, rating, hours, price range and services. Charged as the page-details event on the rows that carry it. Off: the search result only (name, URL, ID, verified badge and picture), a lighter row at its own lower price.",
            "default": true
          },
          "includeTransparency": {
            "title": "Page transparency (creation date, ad status, owner)",
            "type": "boolean",
            "description": "With the profile: also read the Page transparency tab for the Page ID, the date the Page was created, whether it is running ads now and the confirmed owner. Included in the page-details price.",
            "default": true
          },
          "includeAboutText": {
            "title": "Full About text",
            "type": "boolean",
            "description": "With the profile: also read the Page's \"Details about\" tab for its full About text and the links in it (about_me). Included in the page-details price; it is a third tab per Page, so it uses up Facebook's per-IP allowance for profiles 50% sooner.",
            "default": false
          },
          "categoryContains": {
            "title": "Category contains",
            "type": "array",
            "description": "Keep only Pages whose Facebook category contains one of these words, e.g. \"Dentist\" or \"Pizza place\". Not case sensitive. Reads the profile (charged as page-details).",
            "items": {
              "type": "string"
            }
          },
          "verifiedOnly": {
            "title": "Verified Pages only",
            "type": "boolean",
            "description": "Keep only Pages with Facebook's verified badge.",
            "default": false
          },
          "minFollowers": {
            "title": "Minimum followers",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only Pages with at least this many followers."
          },
          "maxFollowers": {
            "title": "Maximum followers",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only Pages with at most this many followers (small local businesses)."
          },
          "withEmailOnly": {
            "title": "With email only",
            "type": "boolean",
            "description": "Keep only Pages that show an email address.",
            "default": false
          },
          "withPhoneOnly": {
            "title": "With phone only",
            "type": "boolean",
            "description": "Keep only Pages that show a phone number.",
            "default": false
          },
          "withWebsiteOnly": {
            "title": "With website only",
            "type": "boolean",
            "description": "Keep only Pages that link a website.",
            "default": false
          },
          "withoutWebsiteOnly": {
            "title": "Without website only",
            "type": "boolean",
            "description": "Keep only Pages that link no website (businesses that may need one).",
            "default": false
          },
          "minRatingPercent": {
            "title": "Minimum recommendation %",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Keep only Pages whose reviewers recommend them at least this often (\"94% recommend\" = 94). Pages not yet rated are dropped when this is set."
          },
          "adsStatus": {
            "title": "Ad status",
            "enum": [
              "any",
              "running",
              "notRunning"
            ],
            "type": "string",
            "description": "Keep only Pages that are running ads now, or only Pages that are not (from the Page transparency tab).",
            "default": "any"
          },
          "createdAfter": {
            "title": "Page created on or after",
            "type": "string",
            "description": "Keep only Pages created on or after this date (YYYY-MM-DD), from the Page transparency tab. Use it with monitor mode to collect new businesses on a schedule."
          },
          "createdBefore": {
            "title": "Page created on or before",
            "type": "string",
            "description": "Keep only Pages created on or before this date (YYYY-MM-DD)."
          },
          "strictLocation": {
            "title": "Only Pages that mention the location",
            "type": "boolean",
            "description": "Keep only Pages whose title, address, name or intro mentions the location's first part (\"Austin\" for \"Austin, TX\"). Facebook's search also lists same-named Pages from elsewhere; this drops them before the charge.",
            "default": false
          },
          "excludePageIds": {
            "title": "Exclude Page IDs",
            "type": "array",
            "description": "Facebook IDs (facebookId) never to deliver, e.g. Pages you already have.",
            "items": {
              "type": "string"
            }
          },
          "monitorMode": {
            "title": "Monitor mode (only new Pages)",
            "type": "boolean",
            "description": "Deliver only Pages that no earlier monitor run delivered (remembered in the named key-value store below). Schedule the same input daily or weekly: each run returns, and charges, only the new Pages.",
            "default": false
          },
          "monitorChanges": {
            "title": "Also deliver changed Pages",
            "type": "boolean",
            "description": "In monitor mode, also deliver a known Page again when its followers, category, rating, phone, email, website or ad status changed (with monitorStatus \"changed\" and previousStats).",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Named key-value store that remembers the Pages delivered. Use one name per watch list.",
            "default": "facebook-pages-search-monitor"
          },
          "maxConcurrency": {
            "title": "Parallel profile reads",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "How many Page profiles are read at the same time.",
            "default": 5
          },
          "requestDelayMs": {
            "title": "Delay between profile reads (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Facebook answers a signed-out IP with its login page after a few dozen Page profiles read in a burst. The run spaces the About-tab requests by this many milliseconds (one IP at a time). Lower is faster; higher keeps more profiles per IP.",
            "default": 500
          },
          "residentialProfiles": {
            "title": "Read profiles over residential when refused",
            "type": "boolean",
            "description": "Facebook answers its login page to a signed-out IP after a few dozen Page profiles (measured: ~20-40 on the Apify container IP and on one datacenter IP). A refused datacenter IP is replaced by a fresh one up to 4 times a run. On: when all of them have been refused, the remaining profiles are read over one Apify residential IP (the About tab only: no transparency or details tab). Off: the remaining Pages are delivered as search results without the page-details charge.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Leave as is: the run starts on the Apify container's own IP and climbs to one Apify datacenter session (and, for the search only, a residential session, plus up to 3 fresh residential IPs) when Facebook refuses. Your own proxy (custom URLs or Apify groups) replaces that ladder for every request.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}