{
  "openapi": "3.0.1",
  "info": {
    "title": "Meta Ad Library Click-to-WhatsApp Ads Scraper",
    "description": "Find businesses running Click-to-WhatsApp ads in the Meta Ad Library, by country and keyword. Advertiser page, category, size, creative, CTA and days running. No login, pay per ad saved.",
    "version": "0.1",
    "x-build-id": "iEraQ8aNeJeRZgWud"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/clovis~meta-ad-library-whatsapp-ads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-clovis-meta-ad-library-whatsapp-ads",
        "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/clovis~meta-ad-library-whatsapp-ads/runs": {
      "post": {
        "operationId": "runs-sync-clovis-meta-ad-library-whatsapp-ads",
        "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/clovis~meta-ad-library-whatsapp-ads/run-sync": {
      "post": {
        "operationId": "run-sync-clovis-meta-ad-library-whatsapp-ads",
        "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": [
          "countries"
        ],
        "properties": {
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "ISO 3166-1 alpha-2 codes of the countries where the ads are shown, e.g. CO, MX, BR, ES, IN.",
            "default": [
              "CO"
            ],
            "items": {
              "type": "string"
            }
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to search in the ad text or advertiser name. One search is run per country and term. Tip: use words your customers use, e.g. 'whatsapp', 'pide por whatsapp', 'agenda tu cita', 'delivery'.",
            "default": [
              "whatsapp"
            ],
            "items": {
              "type": "string"
            }
          },
          "pageIds": {
            "title": "Advertiser page IDs",
            "type": "array",
            "description": "Optional. Restrict the search to these Facebook page IDs instead of a keyword search.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "activeStatus": {
            "title": "Ad status",
            "enum": [
              "active",
              "inactive",
              "all"
            ],
            "type": "string",
            "description": "Only active ads (currently running), only inactive, or all.",
            "default": "active"
          },
          "targetedCountryOnly": {
            "title": "Only ads targeted at the country",
            "type": "boolean",
            "description": "By default the Ad Library returns every ad that was SHOWN in the country, including foreign advertisers whose audience spilled over. Turn this on to keep only ads whose advertiser targeted that country.",
            "default": true
          },
          "maxPageLikes": {
            "title": "Max advertiser page likes",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Drop advertisers with more likes than this. Useful to skip big brands and keep small and medium businesses (e.g. 100000)."
          },
          "minPageLikes": {
            "title": "Min advertiser page likes",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Drop advertisers with fewer likes than this."
          },
          "onlyWhatsApp": {
            "title": "Only Click-to-WhatsApp ads",
            "type": "boolean",
            "description": "Keep only ads whose call to action opens WhatsApp (CTA type WHATSAPP_MESSAGE, including carousel cards). Turn off to get every ad matching the search.",
            "default": true
          },
          "maxAdsPerSearch": {
            "title": "Max ads per search",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Stop each country+term search after this many ads have been SAVED (after the WhatsApp filter). Use it to control cost. Default 20 is a quick sample; raise it for a full list.",
            "default": 20
          },
          "maxPagesPerSearch": {
            "title": "Max result pages per search",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Safety cap on how many result pages (about 10 ads each) to scan per search, whatever the filter keeps. Each page takes about 4 seconds.",
            "default": 15
          },
          "enrichPages": {
            "title": "Enrich advertiser pages",
            "type": "boolean",
            "description": "Second step: visit each advertiser's public Facebook page (no login) and add its website, phone numbers, emails, WhatsApp link and Instagram when the page shows them. One 'page' event per page visited; roughly 2 to 5 MB of residential traffic each.",
            "default": false
          },
          "maxPagesToEnrich": {
            "title": "Max pages to enrich",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Cap on advertiser pages visited in the second step (one visit per unique page, whatever the number of ads).",
            "default": 50
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Meta blocks datacenter IPs. Keep Apify residential proxies unless you bring your own.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}