{
  "openapi": "3.0.1",
  "info": {
    "title": "Meta Ads Library Scraper | 💵 from $0.40/1K",
    "description": "[💵 from $0.40 / 1K · no start fee] Paste a Meta Ads Library URL or search by keyword/Page ID. Export ads, optional reach/spend details, advertiser profiles, or count-only results.",
    "version": "0.1",
    "x-build-id": "ZMZOhpCWuJgNVpCAD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/webdata_labs~meta-ads-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-webdata_labs-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/webdata_labs~meta-ads-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-webdata_labs-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/webdata_labs~meta-ads-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-webdata_labs-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": {
          "startUrls": {
            "title": "Meta Ads Library URLs",
            "type": "array",
            "description": "Paste one or more facebook.com/ads/library URLs. Every filter encoded in the URL is preserved unless you explicitly set an override below.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Keywords or advertiser names for discovery. This is the easiest entry mode for API integrations and AI agents.",
            "items": {
              "type": "string"
            }
          },
          "pageIds": {
            "title": "Facebook Page IDs",
            "type": "array",
            "description": "Numeric Facebook Page IDs for exact advertiser tracking.",
            "items": {
              "type": "string"
            }
          },
          "countryCode": {
            "title": "Country (if not set in the URL)",
            "minLength": 2,
            "maxLength": 3,
            "type": "string",
            "description": "Two-letter country code. Used as a URL override only when you explicitly supply it; otherwise URL filters are preserved. Keyword and Page-ID searches fall back to US."
          },
          "activeStatus": {
            "title": "Ad status (if not set in the URL)",
            "enum": [
              "active",
              "inactive",
              "all"
            ],
            "type": "string",
            "description": "Override the URL's active_status filter, or set the status for keyword and Page-ID searches."
          },
          "mediaType": {
            "title": "Media type (if not set in the URL)",
            "enum": [
              "all",
              "image",
              "video",
              "meme",
              "none"
            ],
            "type": "string",
            "description": "Override the URL's media_type filter, or set the creative type for keyword and Page-ID searches."
          },
          "dateFrom": {
            "title": "Ads active from (if not set in the URL)",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
            "type": "string",
            "description": "Optional start-date override in YYYY-MM-DD format."
          },
          "dateTo": {
            "title": "Ads active until (if not set in the URL)",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
            "type": "string",
            "description": "Optional inclusive end-date override in YYYY-MM-DD format."
          },
          "sortBy": {
            "title": "Sort by (if not set in the URL)",
            "enum": [
              "default",
              "impressions",
              "recent"
            ],
            "type": "string",
            "description": "Override URL sorting with impression volume or recency."
          },
          "category": {
            "title": "Ad category (if not set in the URL)",
            "enum": [
              "all",
              "political_and_issue_ads",
              "housing_ads",
              "employment_ads",
              "credit_ads"
            ],
            "type": "string",
            "description": "Select a regulated category when you need the reach, spend, or transparency fields Meta exposes for those ads."
          },
          "isDetailsPerAd": {
            "title": "Include per-ad reach, spend, and transparency details",
            "type": "boolean",
            "description": "Open each ad's public detail payload. Reach and spend are usually available only for regulated ads or EU transparency records.",
            "default": false
          },
          "includeAboutPage": {
            "title": "Include advertiser About profile",
            "type": "boolean",
            "description": "Fetch one public advertiser profile per unique Page ID, including verification, About text, owner/contact fields when exposed, admin countries, page history, and linked Instagram data.",
            "default": false
          },
          "onlyTotal": {
            "title": "Only return total counts",
            "type": "boolean",
            "description": "Return one count row per input source without downloading ad rows. Useful for daily monitoring and job sizing.",
            "default": false
          },
          "maxResults": {
            "title": "Maximum ads",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of unique ad rows across all supplied searches. Ignored in count-only mode.",
            "default": 100
          },
          "url": {
            "title": "URL alias",
            "type": "string",
            "description": "Hidden compatibility alias for one Meta Ads Library URL."
          },
          "urls": {
            "title": "URLs alias",
            "type": "array",
            "description": "Hidden compatibility alias for Meta Ads Library URL strings.",
            "items": {
              "type": "string"
            }
          },
          "query": {
            "title": "Query alias",
            "type": "string",
            "description": "Hidden compatibility alias for one search keyword."
          },
          "pageId": {
            "title": "Page ID alias",
            "type": "string",
            "description": "Hidden compatibility alias for one numeric Facebook Page ID."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Managed internally with a working residential-proxy default.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}