{
  "openapi": "3.0.1",
  "info": {
    "title": "Meta Ads Library Scraper: Facebook & Instagram Ads · $0.40/1K",
    "description": "Facebook & Instagram Ad Library: search by keyword, Page, advertiser, URL or ad ID. Creatives, video, links, days running, variations, winning score, EU reach and demographics, landing page, monitor. No login. Hard cost cap. $0.40 per 1,000 ads.",
    "version": "1.0",
    "x-build-id": "h7LnDyJH3feOB9AXL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pomlabs~meta-ads-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pomlabs-meta-ads-library-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/pomlabs~meta-ads-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-pomlabs-meta-ads-library-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/pomlabs~meta-ads-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-pomlabs-meta-ads-library-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": "Keywords",
            "type": "array",
            "description": "One search per keyword or phrase, e.g. running shoes. Leave everything empty to try a sample search.",
            "items": {
              "type": "string"
            }
          },
          "urls": {
            "title": "Ad Library or Facebook Page URLs",
            "type": "array",
            "description": "Paste any Ad Library URL (all its filters are kept), a single ad URL (?id=...) or a Facebook Page URL.",
            "items": {
              "type": "string"
            }
          },
          "pageIds": {
            "title": "Page IDs",
            "type": "array",
            "description": "Numeric Facebook Page IDs: all ads of that advertiser.",
            "items": {
              "type": "string"
            }
          },
          "advertisers": {
            "title": "Advertiser names",
            "type": "array",
            "description": "Advertiser or Page names, e.g. Nike. We find the matching Page and return its ads.",
            "items": {
              "type": "string"
            }
          },
          "adIds": {
            "title": "Ad Library IDs",
            "type": "array",
            "description": "Specific ads by Library ID.",
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "2-letter code of the country where ads are shown (US, BR, GB, DE...) or ALL.",
            "default": "US"
          },
          "countries": {
            "title": "Several countries",
            "type": "array",
            "description": "Run every keyword, Page and advertiser in each of these countries (overrides Country).",
            "items": {
              "type": "string"
            }
          },
          "maxAds": {
            "title": "Maximum ads (total)",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap for the whole run. The run never returns or charges more ads than this.",
            "default": 30
          },
          "maxAdsPerSearch": {
            "title": "Maximum ads per search",
            "minimum": 1,
            "type": "integer",
            "description": "Cap for each keyword, Page or URL (default: same as the total)."
          },
          "maxCostUsd": {
            "title": "Maximum cost (USD)",
            "type": "string",
            "description": "Stop before event charges pass this amount, e.g. 0.50. Optional; works together with the platform's own maximum cost per run."
          },
          "onlyTotal": {
            "title": "Only count ads",
            "type": "boolean",
            "description": "Return just the number of ads in the Library for each search (no ads).",
            "default": false
          },
          "activeStatus": {
            "title": "Status",
            "enum": [
              "active",
              "inactive",
              "all"
            ],
            "type": "string",
            "description": "Active, inactive or all ads.",
            "default": "active"
          },
          "adType": {
            "title": "Ad type",
            "enum": [
              "all",
              "political_and_issue_ads",
              "housing_ads",
              "employment_ads",
              "credit_ads"
            ],
            "type": "string",
            "description": "Category of the ads.",
            "default": "all"
          },
          "mediaType": {
            "title": "Media type",
            "enum": [
              "all",
              "image",
              "video",
              "meme",
              "image_and_meme",
              "none"
            ],
            "type": "string",
            "description": "Filter by creative type.",
            "default": "all"
          },
          "platforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Only ads shown on these platforms.",
            "items": {
              "type": "string",
              "enum": [
                "facebook",
                "instagram",
                "messenger",
                "audience_network",
                "threads"
              ]
            }
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "Content language codes, e.g. en, pt, es.",
            "items": {
              "type": "string"
            }
          },
          "exactPhrase": {
            "title": "Exact phrase",
            "type": "boolean",
            "description": "Match the keyword as an exact phrase instead of any word order.",
            "default": false
          },
          "period": {
            "title": "Started in the last",
            "enum": [
              "any",
              "last24h",
              "last7days",
              "last14days",
              "last30days",
              "last90days"
            ],
            "type": "string",
            "description": "Only ads that started in this period.",
            "default": "any"
          },
          "startDateFrom": {
            "title": "Started from",
            "type": "string",
            "description": "Only ads that started on or after this date (YYYY-MM-DD)."
          },
          "startDateTo": {
            "title": "Started until",
            "type": "string",
            "description": "Only ads that started on or before this date (YYYY-MM-DD)."
          },
          "longRunningDays": {
            "title": "Running for at least N days",
            "minimum": 0,
            "type": "integer",
            "description": "Only ads that have run N days or more: the ones worth copying."
          },
          "sortBy": {
            "title": "Sort",
            "enum": [
              "relevance",
              "newest",
              "impressions_high_to_low",
              "impressions_low_to_high"
            ],
            "type": "string",
            "description": "Order of the ads. With a start date filter and \"relevance\", the newest come first.",
            "default": "relevance"
          },
          "includeAdDetails": {
            "title": "Ad details: reach, demographics, advertiser",
            "type": "boolean",
            "description": "EU/UK reach by country, age and gender, targeting, payer and beneficiary, advertiser Page info (likes, Instagram followers, verification, political spend). Charged per ad with details.",
            "default": false
          },
          "expandVariants": {
            "title": "Open every version of an ad",
            "type": "boolean",
            "description": "When Meta groups several ads under one creative and text, return every one of them as its own row (own ID, dates and platforms). Each row is charged as an ad.",
            "default": false
          },
          "parallelSlices": {
            "title": "Faster big pulls (parallel slices)",
            "type": "boolean",
            "description": "Reads each search as several streams at once (all ads, videos, images, memes) and delivers every ad once. Up to 4x faster on pulls of hundreds or thousands of ads; the order of the rows is mixed. Ignored with maxAdsPerSearch.",
            "default": false
          },
          "analyzeLandingPage": {
            "title": "Analyze the landing page",
            "type": "boolean",
            "description": "Follow the ad link: final URL, title, price, e-commerce platform, Meta Pixel and Google tag IDs. Charged per page read.",
            "default": false
          },
          "transcribeVideos": {
            "title": "Transcribe videos",
            "type": "boolean",
            "description": "Adds the speech of the ad video as text: transcript, language, the words of the first 3 seconds (hook3s) and timed segments. Charged only when the video has speech.",
            "default": false
          },
          "ocrImageAds": {
            "title": "Read the text on images",
            "type": "boolean",
            "description": "Adds imageText: the words written on the ad image (or on the video cover). Charged only when there is text.",
            "default": false
          },
          "analyzeAds": {
            "title": "AI marketing analysis",
            "type": "boolean",
            "description": "Adds aiAnalysis: hook, offer, offer type, angle, emotional trigger, target persona, call to action and summary. Uses the transcript and image text too when those are on.",
            "default": false
          },
          "downloadMedia": {
            "title": "Save media files",
            "enum": [
              "none",
              "images",
              "videos",
              "all"
            ],
            "type": "string",
            "description": "Save the creatives (videos and images) to storage, since Meta links expire. Charged per ad with saved files.",
            "default": "none"
          },
          "onlyNewAds": {
            "title": "Monitor: only new ads",
            "type": "boolean",
            "description": "Return only ads not delivered by earlier runs with the same searches (or the same monitor name). Schedule the run to watch competitors.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional name of the monitor memory."
          },
          "includeRawData": {
            "title": "Include raw data",
            "type": "boolean",
            "description": "Add every field Meta returns for the ad.",
            "default": false
          },
          "concurrency": {
            "title": "Searches in parallel",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many searches run at once.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}