{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Ads Library Scraper 🎯📈 - Fast & cheap 💬⭐",
    "description": "🚀 Extract Facebook (Meta) Ads Data 📊 from one or multiple Pages! Gather page details, reach estimates, impressions, ad IDs, and more 📅. Download in JSON, CSV, or Excel formats 🔽 for seamless integration into apps, spreadsheets, and reports. Perfect for analysis and insights 📈💻.",
    "version": "0.0",
    "x-build-id": "1jHXhVEiF3SD6w6So"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapestorm~facebook-ads-library-scraper---fast-cheap/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapestorm-facebook-ads-library-scraper---fast-cheap",
        "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/scrapestorm~facebook-ads-library-scraper---fast-cheap/runs": {
      "post": {
        "operationId": "runs-sync-scrapestorm-facebook-ads-library-scraper---fast-cheap",
        "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/scrapestorm~facebook-ads-library-scraper---fast-cheap/run-sync": {
      "post": {
        "operationId": "run-sync-scrapestorm-facebook-ads-library-scraper---fast-cheap",
        "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",
        "required": [
          "keyword"
        ],
        "properties": {
          "keyword": {
            "title": "The keyword you want to use to get ads metadata from ads library Facebook ✍️🔍",
            "type": "string",
            "description": "The keyword you want to use to get ads metadata from ads library Facebook ✍️🔍",
            "default": "marketing"
          },
          "country_name": {
            "title": "Select country to scrape ads from 🌍",
            "enum": [
              "United States 🇺🇸",
              "United Kingdom 🇬🇧",
              "India 🇮🇳",
              "Aland Islands 🇦🇽",
              "Albania 🇦🇱",
              "Algeria 🇩🇿",
              "American Samoa 🇦🇸",
              "Andorra 🇦🇩",
              "Argentina 🇦🇷",
              "Australia 🇦🇺",
              "Austria 🇦🇹",
              "Belgium 🇧🇪",
              "Brazil 🇧🇷",
              "Canada 🇨🇦",
              "Chile 🇨🇱",
              "Colombia 🇨🇴",
              "Ivory Coast 🇨🇮",
              "Croatia 🇭🇷",
              "Czechia 🇨🇿",
              "Denmark 🇩🇰",
              "Dominican Republic 🇩🇴",
              "Egypt 🇪🇬",
              "Finland 🇫🇮",
              "France 🇫🇷",
              "Germany 🇩🇪",
              "Indonesia 🇮🇩",
              "Italy 🇮🇹",
              "Luxembourg 🇱🇺",
              "Malaysia 🇲🇾",
              "Mexico 🇲🇽",
              "Monaco 🇲🇨",
              "Morocco 🇲🇦",
              "Netherlands 🇳🇱",
              "Nigeria 🇳🇬",
              "Norway 🇳🇴",
              "Pakistan 🇵🇰",
              "Palestine 🇵🇸",
              "Philippines 🇵🇭",
              "Poland 🇵🇱",
              "Portugal 🇵🇹",
              "Qatar 🇶🇦",
              "Saudi Arabia 🇸🇦",
              "Senegal 🇸🇳",
              "Singapore 🇸🇬",
              "South Africa 🇿🇦",
              "Spain 🇪🇸",
              "Sweden 🇸🇪",
              "Switzerland 🇨🇭",
              "Thailand 🇹🇭",
              "Turkey 🇹🇷",
              "Russia 🇷🇺",
              "China 🇨🇳",
              "Ukraine 🇺🇦",
              "United Arab Emirates 🇦🇪",
              "Vietnam 🇻🇳",
              "ALL 🌍"
            ],
            "type": "string",
            "description": "Select country to scrape ads from 🌍",
            "default": "ALL 🌍"
          },
          "active_status": {
            "title": "Choose a Type of active_status 🟢🔴⚪",
            "enum": [
              "active",
              "inactive",
              "all"
            ],
            "type": "string",
            "description": "The type of the active_status 🟢🔴⚪",
            "default": "all"
          },
          "ad_type": {
            "title": "Choose a Type of ads (credit_ads = financials services) 🎯",
            "enum": [
              "all",
              "political_and_issue_ads",
              "employment_ads",
              "housing_ads",
              "credit_ads"
            ],
            "type": "string",
            "description": "The type of the ads (credit_ads = financials services) 🎯",
            "default": "all"
          },
          "media_type": {
            "title": "Choose a Type of media (none means no image or video) 🖼️📹",
            "enum": [
              "all",
              "image",
              "meme",
              "image_and_meme",
              "video",
              "none"
            ],
            "type": "string",
            "description": "The type of the media (none means no image or video)",
            "default": "all"
          },
          "publisher_platforms": {
            "title": "Choose a social media plateforme 🌐",
            "enum": [
              "all",
              "instagram",
              "facebook",
              "audience_network",
              "messenger"
            ],
            "type": "string",
            "description": "Choose a social media plateforme 🌐",
            "default": "all"
          },
          "start_date_min": {
            "title": "Date of start_date min search 📅",
            "type": "string",
            "description": "Date of start_date min search 📅",
            "default": "2018-05-09"
          },
          "start_date_max": {
            "title": "Date of start_date max search 📅",
            "type": "string",
            "description": "Date of start_date max search 📅",
            "default": "2025-04-15"
          },
          "maxitems": {
            "title": "Max ads you want to scrape 🔢",
            "type": "integer",
            "description": "The maximum number of ads to fetch 🔢",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}