{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Ads Library Scraper | Exact Ad Limit | No Login",
    "description": "Scrapes the Facebook Ads Library (Meta ad library) from links, Page URLs or search words. Give it what to look for and how many; get each ad's text, dates, platforms, links and images, plus EU reach and payer as rows, stopping at exactly your limit. Same field names as the most used tool.",
    "version": "0.1",
    "x-build-id": "jafNCSwmUcOZLPPDU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/h1018y~anvil-facebook-ads-library-scraper-pro/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-h1018y-anvil-facebook-ads-library-scraper-pro",
        "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/h1018y~anvil-facebook-ads-library-scraper-pro/runs": {
      "post": {
        "operationId": "runs-sync-h1018y-anvil-facebook-ads-library-scraper-pro",
        "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/h1018y~anvil-facebook-ads-library-scraper-pro/run-sync": {
      "post": {
        "operationId": "run-sync-h1018y-anvil-facebook-ads-library-scraper-pro",
        "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": "Ad Library links or Facebook Page links",
            "type": "array",
            "description": "Paste a Meta Ad Library search link, a Facebook Page link or the link of one ad, e.g. https://www.facebook.com/SHEINOFFICIAL. Settings inside a link win over this form.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchTerms": {
            "title": "Search words",
            "type": "array",
            "description": "Or just type what you would type in the Ad Library search, one per line, e.g. running shoes. Uses the country below.",
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country for search words",
            "type": "string",
            "description": "Two-letter code of the country where the ads ran, or ALL, e.g. DE. Used for search words only; links keep their own country.",
            "default": "US"
          },
          "resultsLimit": {
            "title": "Results limit per link or word",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Exact number of ads per input, e.g. 40. The run stops right there, so you are never billed past it.",
            "default": 50
          },
          "maxItems": {
            "title": "Max results in the whole run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard stop for the whole run across all inputs, e.g. 200.",
            "default": 1000
          },
          "activeStatus": {
            "title": "Active status (if the link does not say)",
            "enum": [
              "",
              "active",
              "inactive",
              "all"
            ],
            "type": "string",
            "description": "Keep ads still running, stopped ads, or both, e.g. active. A status inside a link wins.",
            "default": ""
          },
          "sorting": {
            "title": "Sorting (if the link does not say)",
            "enum": [
              "",
              "total_impressions",
              "relevancy_monthly_grouped"
            ],
            "type": "string",
            "description": "Order of the ads, e.g. relevancy_monthly_grouped for most recent first. A sort inside a link wins.",
            "default": ""
          },
          "onlyAdsNewerThan": {
            "title": "Only ads active on or after",
            "type": "string",
            "description": "A date like 2026-01-31 or a relative value like 7 days, 2 months, 1 year. Checked on every row."
          },
          "onlyAdsOlderThan": {
            "title": "Only ads started on or before",
            "type": "string",
            "description": "A date like 2026-06-30 or a relative value like 7 days. Combine it with the field above for a closed range."
          },
          "isDetailsPerAd": {
            "title": "Add reach and advertiser details per ad",
            "type": "boolean",
            "description": "Opens each ad's details for EU reach, reach by country and age, payer, Instagram name and followers. Turn off for a faster run, e.g. false.",
            "default": true
          },
          "onlyTotal": {
            "title": "Only the total ad count",
            "type": "boolean",
            "description": "Turn on for one row per input with totalCount and no ads. Off always gives the ads themselves, e.g. false.",
            "default": false
          },
          "onlyNew": {
            "title": "Only ads that are new or changed since last run",
            "type": "boolean",
            "description": "For a schedule: the first run is the baseline, then only new or stopped ads come back, e.g. true.",
            "default": false
          },
          "useApifyProxy": {
            "title": "Use Apify Proxy",
            "type": "boolean",
            "description": "Leave on so Facebook sees a normal visitor address, e.g. true.",
            "default": true
          },
          "proxyGroups": {
            "title": "Proxy groups",
            "type": "array",
            "description": "Optional Apify proxy groups, e.g. RESIDENTIAL. Empty uses the standard one.",
            "items": {
              "type": "string"
            }
          },
          "webhookUrl": {
            "title": "Send results to (webhook URL)",
            "type": "string",
            "description": "Optional. An https address - your own system, Zapier, Make or a Slack incoming webhook - that gets each run's results as JSON (with 'only new' on: just the new ones). Example: https://hooks.slack.com/services/T000/B000/XXXX"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}