{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Ads Library Scraper · Meta Ad Library, No Login",
    "description": "Facebook Ads Library scraper, no login, 6× cheaper than Apify's. Meta Ad Library: Facebook & Instagram ads by keyword, page, Ad Library URL or ad ID: text, link, CTA, images, videos, cards, dates, platforms; political spend & impressions; EU reach, targeting, payer with one tick. CSV, Excel, JSON.",
    "version": "0.1",
    "x-build-id": "4vaKFQtyr8ChRfANE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/instagram-data-api~meta-ads-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-instagram-data-api-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/instagram-data-api~meta-ads-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-instagram-data-api-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/instagram-data-api~meta-ads-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-instagram-data-api-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": {
          "queries": {
            "title": "Keywords, advertiser pages, Ad Library links or ad IDs",
            "type": "array",
            "description": "One per line, any mix:\n• a keyword — `running shoes`\n• an advertiser's Facebook page — `https://www.facebook.com/nike` or its page ID `15087023444`\n• an advertiser by exact page name — `page:Nike`\n• an Ad Library link — a pasted search link keeps its own filters (country, status, media, dates, sort)\n• one ad — its Library ID `ad:1550534860016399` or its link `https://www.facebook.com/ads/library/?id=…`\nDuplicates are removed before anything is read.",
            "items": {
              "type": "string"
            }
          },
          "maxAdsPerQuery": {
            "title": "Max ads per line",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "How many ads to return for each line above. Meta's results are read 10 ads a request (the first request brings 30 and Meta's total counter).",
            "default": 100
          },
          "maxAds": {
            "title": "Max ads in the whole run",
            "minimum": 1,
            "type": "integer",
            "description": "Optional. The run stops when this many ads are delivered in total."
          },
          "includeDetails": {
            "title": "Include ad details — EU / UK reach, targeting, payer (extra charge per ad)",
            "type": "boolean",
            "description": "One more read per ad: EU and UK reach by country, age and gender, targeting (locations, ages, gender), payer and beneficiary — Meta publishes these for ads delivered in the EU / UK — plus the page's category, verification and Instagram account for every ad. Charged per ad whose details were read (event «Ad details»); an ad Meta did not answer for is not charged.",
            "default": false
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter country code where the ads were delivered (US, GB, DE, FR, IN, BR…) or ALL for every country. A pasted Ad Library link keeps its own country.",
            "default": "US"
          },
          "activeStatus": {
            "title": "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"
            ],
            "type": "string",
            "description": "«Political and issue ads» rows carry spend, impressions, estimated reach and the «paid for by» line — Meta shows these only for that category.",
            "default": "all"
          },
          "mediaType": {
            "title": "Media type",
            "enum": [
              "all",
              "image",
              "meme",
              "image_and_meme",
              "video",
              "none"
            ],
            "type": "string",
            "description": "Keep only ads with this kind of creative.",
            "default": "all"
          },
          "platforms": {
            "title": "Platforms",
            "uniqueItems": true,
            "type": "array",
            "description": "Keep only ads delivered on these platforms. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "facebook",
                "instagram",
                "audience_network",
                "messenger",
                "threads",
                "whatsapp"
              ],
              "enumTitles": [
                "Facebook",
                "Instagram",
                "Audience Network",
                "Messenger",
                "Threads",
                "WhatsApp"
              ]
            }
          },
          "searchType": {
            "title": "Keyword match",
            "enum": [
              "keyword_unordered",
              "keyword_exact_phrase"
            ],
            "type": "string",
            "description": "Any order of the words, or the exact phrase.",
            "default": "keyword_unordered"
          },
          "startDate": {
            "title": "Ran on or after",
            "type": "string",
            "description": "A date (YYYY-MM-DD) or a period back from today («7 days», «3 months»). Meta's own meaning: ads that were RUNNING in the range, whenever they started."
          },
          "endDate": {
            "title": "Ran on or before",
            "type": "string",
            "description": "A date (YYYY-MM-DD) or a period back from today."
          },
          "startedInRangeOnly": {
            "title": "Only ads that STARTED inside the date range",
            "type": "boolean",
            "description": "Leaves out ads that started before the range and were still running in it. Ads left out are not charged. Use it with «Newest first».",
            "default": false
          },
          "sortBy": {
            "title": "Sort",
            "enum": [
              "impressions",
              "newest"
            ],
            "type": "string",
            "description": "The order Meta returns the ads in.",
            "default": "impressions"
          },
          "contentLanguages": {
            "title": "Ad languages",
            "type": "array",
            "description": "Optional language codes as in the Ad Library's own filter (en, de, es, fr…). Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Leave as it is: the run checks Apify's datacenter IPs with one small request and switches to residential IPs by itself if Meta refuses them; the log says which was used. Set a group or your own proxies only to force them.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "Lines read at the same time",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many input lines are read side by side, each through its own proxy IP. 16 is the measured default: 20 keywords of 100 ads each took 48 s at 16 and 99 s at 4, with no refused request (Apify runs, 17 Nov 2026). One line's pages always come one after another.",
            "default": 16
          },
          "docIds": {
            "title": "Query IDs override",
            "type": "object",
            "description": "Meta's internal query IDs change with its site releases; the Actor finds the new ones by itself. Use this only if support asks you to: {\"AdLibrarySearchPaginationQuery\": \"…\", \"AdLibraryV3AdDetailsQuery\": \"…\", \"AdLibraryFoundationRootQuery\": \"…\"}."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}