{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Pages Directory Crawler",
    "description": "[ 1k/1.49$ ] Facebook Pages Directory Crawler crawls the public Facebook Places directory by country and city and returns every Page found: URL, name, ID, category and rating, with crawl path and depth. Optional enrichment adds followers, address, phone, website and hours.",
    "version": "0.1",
    "x-build-id": "MqjzlgI9hTDFEADoZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/alpha-scraper~facebook-pages-directory-crawler/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-alpha-scraper-facebook-pages-directory-crawler",
        "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/alpha-scraper~facebook-pages-directory-crawler/runs": {
      "post": {
        "operationId": "runs-sync-alpha-scraper-facebook-pages-directory-crawler",
        "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/alpha-scraper~facebook-pages-directory-crawler/run-sync": {
      "post": {
        "operationId": "run-sync-alpha-scraper-facebook-pages-directory-crawler",
        "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": {
          "startUrls": {
            "title": "Start URLs",
            "uniqueItems": true,
            "type": "array",
            "description": "Where to start the crawl: the Places directory root (https://www.facebook.com/places/), a country page or a city page (https://www.facebook.com/places/Things-to-do-in-<name>/<id>/). Legacy /directory/ URLs are skipped because Facebook blocks them for logged-out visitors.",
            "default": [
              "https://www.facebook.com/places/110970792260960"
            ],
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries",
            "uniqueItems": true,
            "type": "array",
            "description": "Only crawl these countries, by name as listed in the Places directory (e.g. France, Japan; case and accents are ignored). Applies when a start URL is the directory root. Leave empty for all countries (up to 'Max countries').",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeEventVenues": {
            "title": "Include event venues",
            "type": "boolean",
            "description": "Also return the Page venues of the events that a city page recommends.",
            "default": false
          },
          "emitDirectoryNodes": {
            "title": "Include country and city records",
            "type": "boolean",
            "description": "Also return the country and city entries themselves (kind = country or city) next to the Pages. 'Max items' counts Pages only.",
            "default": false
          },
          "enrich": {
            "title": "Enrichment",
            "enum": [
              "false",
              "ids",
              "true"
            ],
            "type": "string",
            "description": "How much detail to add for each discovered Page. 'Off' returns only what the directory lists. 'Basic' adds 1 request per Page (Page id, followers, likes, intro). 'Full' adds 2 requests per Page (also address, coordinates, phone, website, email, hours, reviews).",
            "default": "ids"
          },
          "deepEnrich": {
            "title": "Deep enrichment",
            "type": "boolean",
            "description": "Only with 'Enrichment' set to Full: 2 more requests per Page for the About description, creation date, ad status, confirmed owner and Page details.",
            "default": false
          },
          "maxCountries": {
            "title": "Max countries",
            "minimum": 1,
            "type": "integer",
            "description": "How many countries to open when crawling from the directory root.",
            "default": 3
          },
          "citiesPerCountry": {
            "title": "Cities per country",
            "minimum": 1,
            "type": "integer",
            "description": "How many cities of each country to open (taken round-robin across the countries). Used when 'Max depth' is 3.",
            "default": 3
          },
          "maxDepth": {
            "title": "Max depth",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "How deep to crawl: 1 = country list only (no Pages are returned unless 'Include country and city records' is on), 2 = also the country pages with their highlighted Pages, 3 = also the city pages.",
            "default": 3
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of Pages to discover (de-duplicated). Country and city records are not counted.",
            "default": 15
          },
          "workers": {
            "title": "Enrichment workers",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Number of parallel clients used for enrichment (1-4). Only used when 'Enrichment' is not Off.",
            "default": 2
          },
          "probeSurfaces": {
            "title": "Probe legacy directory pages",
            "type": "boolean",
            "description": "Send a few plain requests to Facebook's legacy directory pages (/directory/pages/, /pages/category/, robots.txt sitemaps) to record whether they are reachable. This does not change the Pages returned; turn it off to save requests.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}