{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Ads Library Scraper",
    "description": "Scrape the Meta Ad Library (Facebook, Instagram, Messenger, Threads) by keyword, advertiser, ad ID or URL in any country: ad text, media, links, dates, platforms, spend and EU audience. No login. Export to JSON, CSV or Excel.",
    "version": "0.0",
    "x-build-id": "7vPoAosSeNTiKVSIj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nice_dev~facebook-ads-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nice_dev-facebook-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/nice_dev~facebook-ads-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-nice_dev-facebook-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/nice_dev~facebook-ads-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-nice_dev-facebook-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": "Ad Library URLs or advertiser pages",
            "maxItems": 1000,
            "type": "array",
            "description": "Links pasted from the Meta Ad Library (`https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=shoes&search_type=keyword_unordered`): every filter set on the site is kept (country, status, ad type, media, platforms, languages, dates, sort) and pagination is automatic. Also accepted: an advertiser's ads (`…&view_all_page_id=<page id>`), a single ad (`https://www.facebook.com/ads/library/?id=<ad id>`) and a Facebook page link (`https://www.facebook.com/nike`), read as that advertiser's ads. When this list is not empty, the search fields below are added to it; filters, caps and monitoring apply to all. Max 1 000 URLs.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "query": {
            "title": "Search keyword",
            "maxLength": 200,
            "type": "string",
            "description": "Words searched in the ads' text, as typed in the Ad Library search box (e.g. `running shoes`). Empty = no keyword search (use advertisers, ad IDs or URLs instead)."
          },
          "searchQueries": {
            "title": "More search keywords",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Several keywords in one run: one search per keyword (times each country below). Added to **Search keyword**; an ad found by several searches is saved once.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "exactPhrase": {
            "title": "Exact phrase",
            "type": "boolean",
            "description": "Match the keywords as an exact phrase (the site's \"exact phrase\" search), instead of ads that contain all the words in any order.",
            "default": false
          },
          "pageIds": {
            "title": "Advertisers (page ID, link or name in the link)",
            "maxItems": 1000,
            "uniqueItems": true,
            "type": "array",
            "description": "All the ads of these advertisers: Facebook page ID (`15087023444`), page link (`https://www.facebook.com/nike`) or the last part of the link (`nike`). Country, status and the other filters below apply. Max 1 000.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "advertiserNames": {
            "title": "Advertisers by name",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Advertiser names as shown in the Ad Library (`Nike`, `Decathlon France`) or Instagram accounts (`@thedemocrats`): each one is looked up in the site's advertiser search and the best match is read (exact page name, alias or Instagram account first, then the most liked page). The page found is returned in `pageId` / `pageName` and `searchPageId`; the rows' `searchUrl` keeps the name as typed (the key of that search, not a link to the advertiser's ads). Max 100.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "adIds": {
            "title": "Ad IDs",
            "maxItems": 1000,
            "uniqueItems": true,
            "type": "array",
            "description": "Single ads by their Ad Library ID (`1234567890123456`, the `id=` of an ad link). Read in every country and status. Max 1 000.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country",
            "enum": [
              "ALL",
              "AF",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "VG",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "AN",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "SZ",
              "ET",
              "FK",
              "FJ",
              "FI",
              "FR",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GD",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "XK",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MR",
              "MU",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MK",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RO",
              "RU",
              "RW",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "KR",
              "SS",
              "ES",
              "LK",
              "SH",
              "KN",
              "LC",
              "VC",
              "SR",
              "SJ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UM",
              "VI",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UY",
              "UZ",
              "VU",
              "VA",
              "VE",
              "VN",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string",
            "description": "Country where the ads were shown. `All countries` covers the whole library. Political and issue ads are listed in every country; other ads only where the law makes Meta list them (EU, UK, Brazil…) or where they are running now.",
            "default": "ALL"
          },
          "countries": {
            "title": "More countries",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Several countries in one run: every keyword and advertiser is searched in every country (3 keywords × 4 countries = 12 searches, max 1000), and `searchCountry` tells which one found the ad. Added to **Country**. Two-letter codes (`FR`, `DE`, `US`) or `ALL`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max ads",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of ads to save for the whole run (after deduplication and filters). 0 = no limit.",
            "default": 100
          },
          "maxItemsPerQuery": {
            "title": "Max ads per search",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Cap for EACH search (keyword × country, advertiser × country, or pasted URL), so that the first search cannot use up the whole **Max ads** budget. 0 = no per-search cap.",
            "default": 0
          },
          "activeStatus": {
            "title": "Ad status",
            "enum": [
              "active",
              "inactive",
              "all"
            ],
            "type": "string",
            "description": "Ads running now, ads that stopped, or both.",
            "default": "active"
          },
          "adType": {
            "title": "Ad category",
            "enum": [
              "ALL",
              "POLITICAL_AND_ISSUE_ADS",
              "HOUSING_ADS",
              "EMPLOYMENT_ADS",
              "CREDIT_ADS",
              "FINANCIAL_PRODUCTS_AND_SERVICES_ADS",
              "UNCATEGORIZED_ADS"
            ],
            "type": "string",
            "description": "The site's ad category. `Issues, elections or politics` ads come with their spend, impressions and audience.",
            "default": "ALL"
          },
          "mediaType": {
            "title": "Media type",
            "enum": [
              "all",
              "image",
              "video",
              "meme",
              "image_and_meme",
              "none"
            ],
            "type": "string",
            "description": "Only ads with this kind of media.",
            "default": "all"
          },
          "publisherPlatforms": {
            "title": "Platforms",
            "uniqueItems": true,
            "type": "array",
            "description": "Only ads shown on at least one of these platforms. Empty = all platforms.",
            "items": {
              "type": "string",
              "enum": [
                "facebook",
                "instagram",
                "messenger",
                "audience_network",
                "threads"
              ],
              "enumTitles": [
                "Facebook",
                "Instagram",
                "Messenger",
                "Audience Network",
                "Threads"
              ]
            },
            "default": []
          },
          "contentLanguages": {
            "title": "Ad languages",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "Only ads written in one of these languages, as two-letter codes (`en`, `fr`, `es`). Empty = all languages.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "impressions",
              "newest"
            ],
            "type": "string",
            "description": "Order in which the site returns the ads (it matters with **Max ads**): most impressions first (the site's default) or most recent first.",
            "default": "impressions"
          },
          "isTargetedCountry": {
            "title": "Targeted country only",
            "type": "boolean",
            "description": "Only ads that TARGETED the chosen country (the site's filter), not the ads that merely reached people there.",
            "default": false
          },
          "bylines": {
            "title": "Paid for by (political ads)",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "Only political and issue ads whose \"Paid for by\" line is exactly one of these names, as the Ad Library shows it (`WALMART INC.`). Sent to the site.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "postedAfter": {
            "title": "Started after",
            "type": "string",
            "description": "Only ads that started running on or after this date: `2026-09-01`, or a period before now such as `7 days`, `2 weeks`, `1 month` (API: `24 hours` and full ISO date-times work too). Reads the ad's start date (`startDate`)."
          },
          "postedBefore": {
            "title": "Started before",
            "type": "string",
            "description": "Only ads that started running on or before this date (the whole day is included), or longer ago than a period such as `30 days`."
          },
          "minDaysRunning": {
            "title": "Min days running",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Only ads that have been running for at least this many days (from start date to end date, or to today for an active ad): long-running ads are usually the ones that sell. 0 = no minimum.",
            "default": 0
          },
          "maxDaysRunning": {
            "title": "Max days running",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Only ads that have been running for at most this many days (fresh tests, not yet scaled). 0 = no maximum.",
            "default": 0
          },
          "deliveredAfter": {
            "title": "Still running after",
            "type": "string",
            "description": "Only ads still running on or after this date (their end date, or today for an active ad): `2026-09-01` or a period such as `30 days`. Combine with **Started before** to get the ads that ran during a period."
          },
          "deliveredBefore": {
            "title": "Stopped before",
            "type": "string",
            "description": "Only ads that STOPPED running on or before this date (their end date; an ad still running is dropped): `2026-09-30` or a period such as `30 days`. Needs **Ad status** set to inactive or all (active ads have not stopped). With **Still running after**, the ads that ended inside a period."
          },
          "minCollationCount": {
            "title": "Min versions",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Only ads whose group has at least this many versions (`collationCount`): advertisers test and scale the creatives that work. 0 = no minimum. An ad asked by its ID has no known group size: it is kept.",
            "default": 0
          },
          "displayFormats": {
            "title": "Creative formats",
            "uniqueItems": true,
            "type": "array",
            "description": "Only ads with one of these creative formats (`displayFormat`). Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "IMAGE",
                "VIDEO",
                "CAROUSEL",
                "DPA",
                "DCO"
              ],
              "enumTitles": [
                "Image",
                "Video",
                "Carousel",
                "Catalog (DPA)",
                "Dynamic creative (DCO)"
              ]
            },
            "default": []
          },
          "includeDomains": {
            "title": "Only link domains",
            "maxItems": 500,
            "uniqueItems": true,
            "type": "array",
            "description": "Keep only the ads whose link, caption or a card's link goes to one of these domains (`gymshark.com` also keeps `fr.gymshark.com`). Tip: also put the domain in **Search keyword** or **More search keywords**: the site then returns mostly those ads.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludePageIds": {
            "title": "Exclude advertisers",
            "maxItems": 500,
            "uniqueItems": true,
            "type": "array",
            "description": "Drop the ads of these advertisers: page ID, page link or the last part of the link (e.g. your own brand in a keyword search).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeDomains": {
            "title": "Exclude link domains",
            "maxItems": 500,
            "uniqueItems": true,
            "type": "array",
            "description": "Drop the ads whose link or caption goes to one of these domains (`amazon.com` also drops `www.amazon.com` and `smile.amazon.com`).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "Drop the ads whose text (body, title, caption, link description or a card's text) contains one of these words, as a whole word (`cat` keeps \"category\"; case and accents ignored; a word in Chinese, Japanese, Korean, Thai, Burmese, Khmer or Lao is found anywhere in the text).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeAdDetails": {
            "title": "Ad details: EU audience, payer and beneficiary",
            "type": "boolean",
            "description": "Open each ad's \"See ad details\" panel (1 extra request per ad) and add `adDetails`: who paid for the ad and who it is for (`payer`, `beneficiary`), and for ads shown in the EU, UK or Brazil the audience Meta publishes (`euTotalReach`, targeted locations, gender, age range, reach by country, age and gender).",
            "default": false
          },
          "includeAdvertiserInfo": {
            "title": "Advertiser info",
            "type": "boolean",
            "description": "Read each advertiser once per run (1 extra request per advertiser) and add `advertiser` to its ads: Facebook likes, Instagram account and followers, verification badges, page category, alias, about text, and the amount spent on issue / political ads by disclaimer. Charged once per advertiser.",
            "default": false
          },
          "includePageTransparency": {
            "title": "Page transparency",
            "type": "boolean",
            "description": "Read each advertiser's About tab of the Ad Library once per run (1 extra request per advertiser) and add `pageTransparency`: the confirmed page owner (name, address, phone when published), the page creation date and name changes, the countries of the people who manage the page and how many in each, state media label, related pages and the about text. Charged once per advertiser.",
            "default": false
          },
          "includeAdvertiserAudience": {
            "title": "Advertiser audience and spend",
            "type": "boolean",
            "description": "Read each advertiser's Audience tab once per run (1 extra request per advertiser) and add `advertiserAudience`: number of ads and amount spent over the period, and the targeting of its ads by gender, age, location (with exclusions), custom and lookalike audiences and language, with the share of spend of each. Meta publishes it for advertisers running issue, electoral or political ads; others come back empty and are not charged.",
            "default": false
          },
          "audienceTimeframe": {
            "title": "Audience period",
            "enum": [
              "LAST_7_DAYS",
              "LAST_30_DAYS",
              "LAST_90_DAYS"
            ],
            "type": "string",
            "description": "With **Advertiser audience and spend**: the period Meta sums up.",
            "default": "LAST_30_DAYS"
          },
          "includeAdVersions": {
            "title": "All versions of grouped ads",
            "type": "boolean",
            "description": "The Ad Library groups ads with the same creative (`collationCount` > 1) and shows one. Read the group (at least 1 extra request per grouped ad, one more for each further page of versions) and add `versions`: the ID, dates, platforms and text of each version. Ads alone in their group cost nothing more. An ad asked by its ID comes without its group: `versions` stays null.",
            "default": false
          },
          "resolveLandingPages": {
            "title": "Final landing page",
            "type": "boolean",
            "description": "Follow each ad's link through its redirects and tracking links (1 extra request per distinct link) and add `landingPage`: the final URL without tracking parameters, its domain, the HTTP status, the page title and, for a product page, the product's name, price, currency, brand, availability and rating. Charged once per distinct link (ads that share a link, tracking parameters aside, are charged once); ads without a link cost nothing more.",
            "default": false
          },
          "downloadMedia": {
            "title": "Save images and videos",
            "type": "boolean",
            "description": "Meta's media links expire after a few days. Save each ad's images and videos (cards included) in the run's key-value store and add their permanent links in `savedMedia`. Charged per 3 MB saved: each file counts one unit per started 3 MB (an image is 1 unit, a 60 MB video 20); a file that could not be saved is not charged.",
            "default": false
          },
          "maxMediaPerAd": {
            "title": "Max media files per ad",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "With **Save images and videos**: the most files saved for ONE ad (a carousel can have 10 cards). Videos larger than 200 MB are skipped.",
            "default": 10
          },
          "imageText": {
            "title": "AI image text",
            "type": "boolean",
            "description": "AI reads the text written in each ad's images (offer, dates, brand, call to action) and adds `imageText` (main image) and `imageTexts` (every image, up to 10 per ad: the main image, the other images, the carousel cards, then the video preview). Latin-script text only (English, French, German, Spanish, Italian, Portuguese...). Charged per image where text is found; an image without readable text is free. Needs 2 GB of memory (Run options): with less the option is skipped and not charged.",
            "default": false
          },
          "videoTranscript": {
            "title": "AI speech in videos",
            "type": "boolean",
            "description": "AI writes down what is said in the ad's main video (first 60 seconds of sound) into `videoTranscript`, with the language in `videoLanguage` and the video length in seconds in `videoDuration`. Charged per video where speech is found; music only or no sound = empty and free. Needs 2 GB of memory (Run options): with less the option is skipped and not charged. Cannot be combined with Totals only.",
            "default": false
          },
          "aiLabelNames": {
            "title": "AI labels",
            "maxItems": 20,
            "uniqueItems": true,
            "type": "array",
            "description": "Your own labels (up to 20, in English, e.g. `discount`, `free shipping`, `testimonial`). AI judges the English text of each ad (body, title, caption, link description, cards, and the text read in the images when AI image text is ticked) and adds `aiLabels`: for each label a `score` (0 to 1) and `match` (true or false). Write `name: what it means` to say more than the name (e.g. `competitor: mentions a competing product`). Only ads written in English are labelled; an ad in another language, or without text, is skipped and not charged. Charged per label evaluated on an ad. Needs 2 GB of memory (Run options): with less the option is skipped and not charged. Empty list = off.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeAdScore": {
            "title": "Ad score",
            "type": "boolean",
            "description": "Adds a 0-100 \"winning ad\" score to each ad, computed from how long it has been running, how many versions it has, its platforms, countries and whether it is still active, with the points of each factor (`adScore` and `adScoreFactors`). Calculated on the ad's own data, no extra request. Charged per ad scored; an ad without a start date has no score and costs nothing.",
            "default": false
          },
          "extractLandingContacts": {
            "title": "Contacts and shop platform of the landing page",
            "type": "boolean",
            "description": "Read each ad's landing page once per run (1 extra request per distinct domain, per app for an app store) and add `landingContacts`: e-mail addresses, phone numbers and social links found on it, and the shop platform it runs on (Shopify, WooCommerce, Wix…). Turns the advertisers of a search into a lead list. Charged once per website where something was found (the other ads of that website carry the same contacts at no extra charge).",
            "default": false
          },
          "includeMarketStats": {
            "title": "Market statistics per search",
            "type": "boolean",
            "description": "At the end of the run, add ONE summary per search (keyword, advertiser, country or URL) with at least 10 ads delivered by this run, in the key-value store record `MARKET_STATS` (not in the dataset): number of ads and share still active, number of advertisers and the 10 biggest, ads by platform and by format, days running (min, median, 75th percentile, max), grouped ads, top landing domains, top buttons, ads by start month, top countries, the amount spent and impressions Meta publishes (by currency) and the total the Ad Library shows for the search. Calculated on the ads of this run, no extra request. Charged once per summary delivered; a search with fewer than 10 ads has none and costs nothing.",
            "default": false
          },
          "onlyTotalCount": {
            "title": "Totals only (no ads)",
            "type": "boolean",
            "description": "Return ONE row per search with the number of ads the Ad Library has for it (`totalCount`), without reading the ads: a quick way to size a market, an advertiser or a keyword in many countries. 1 request per search.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new ads",
            "type": "boolean",
            "description": "Skip the ads that a previous run (same **Memory key**) already delivered: they are not saved again; each one read again costs one filter check. First run = everything is new.",
            "default": false
          },
          "stateKey": {
            "title": "Memory key",
            "pattern": "^[a-zA-Z0-9_-]{1,64}$",
            "maxLength": 64,
            "type": "string",
            "description": "Name of the memory used by **Only new ads**. Give each schedule / task its own key (e.g. `competitor-ads-fr`) so that they do not share their memory. Letters, digits, `-` and `_`.",
            "default": "default"
          },
          "resetState": {
            "title": "Reset the memory",
            "type": "boolean",
            "description": "Forget everything remembered under this **Memory key** before the run: this run returns (and charges) every ad again. Untick it afterwards.",
            "default": false
          },
          "runTag": {
            "title": "Run tag",
            "maxLength": 100,
            "type": "string",
            "description": "Any label (e.g. `client-a-weekly`): copied as it is into every row as `runTag`, to tell your runs apart in a shared dataset or an integration."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Keep **Apify Proxy** (default): the Actor picks the connection each page needs, included in the price. With your own proxy URLs (`proxyUrls`), every request goes through them: Meta shows more than the first 30 ads of a search only to home connections. On the free Apify plan, without your own proxy URLs, you get the first 30 ads of each search: the residential connection beyond them is reserved for paid plans.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of searches read in parallel (each on its own IP address).",
            "default": 8
          },
          "maxRequestsPerMinute": {
            "title": "Max requests per minute",
            "minimum": 10,
            "maximum": 2000,
            "type": "integer",
            "description": "Most requests to the site in any 60 seconds, all searches and extra data together. A budget, not an even pace (spread them with the minimum delay below).",
            "default": 240
          },
          "minRequestIntervalMs": {
            "title": "Min delay between requests",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Smallest gap between two requests, in milliseconds. 0 = no gap.",
            "default": 0
          },
          "maxRequestRetries": {
            "title": "Max request retries",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Retries per request before it is marked as failed. A request the site turns away (\"Rate limit exceeded\") is also retried on a new IP address up to 10 times without using up these retries, and the search goes on from where it stopped.",
            "default": 5
          },
          "debugLog": {
            "title": "Debug log",
            "type": "boolean",
            "description": "Include debug messages in the run log.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}