{
  "openapi": "3.0.1",
  "info": {
    "title": "Meta Ad Library Scraper: Facebook Ad Library & Instagram Ads",
    "description": "Search the public Meta Ad Library (Facebook and Instagram ads) by keyword, advertiser Page id or library URL. No login. Flat rows: ad text, headline, link, CTA, media URLs, ISO dates, platforms, variations. $0.00065 per ad.",
    "version": "0.1",
    "x-build-id": "Ohv6L2UtVui8AAg4n"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/transparent_meteorite~meta-ad-library/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-transparent_meteorite-meta-ad-library",
        "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/transparent_meteorite~meta-ad-library/runs": {
      "post": {
        "operationId": "runs-sync-transparent_meteorite-meta-ad-library",
        "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/transparent_meteorite~meta-ad-library/run-sync": {
      "post": {
        "operationId": "run-sync-transparent_meteorite-meta-ad-library",
        "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": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords or advertiser names, one per line (for example \"running shoes\"). Each term is searched in the public Ad Library.",
            "items": {
              "type": "string"
            }
          },
          "pageIds": {
            "title": "Advertiser Page ids",
            "type": "array",
            "description": "Numeric Facebook Page ids (the view_all_page_id in an Ad Library URL). Returns every ad that Page runs. Example: [\"866655706540346\"].",
            "items": {
              "type": "string"
            }
          },
          "libraryUrls": {
            "title": "Ad Library URLs",
            "type": "array",
            "description": "Paste search URLs copied from facebook.com/ads/library. Their filters are used as they are. Example: [\"https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=running%20shoes\"].",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs (Ad Library)",
            "type": "array",
            "description": "Paste any facebook.com/ads/library/?... URL. Its filters (active_status, ad_type, country, q, search_type, view_all_page_id, media_type, start_date[min]/[max], sort_data, platforms, languages) are used as they are. Same as libraryUrls, in the format other scrapers use.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter country code, or ALL. Ads shown in this country. Example: \"US\", \"GB\", \"ALL\".",
            "default": "US"
          },
          "activeStatus": {
            "title": "Active status",
            "enum": [
              "active",
              "inactive",
              "all"
            ],
            "type": "string",
            "description": "Which ads to include. Choose active for ads running now, inactive for ended ads, all for both.",
            "default": "active"
          },
          "adType": {
            "title": "Ad type",
            "enum": [
              "all",
              "political",
              "housing",
              "employment",
              "credit"
            ],
            "type": "string",
            "description": "All ads is the commercial default. Political and issue ads add Meta's published spend and impression ranges.",
            "default": "all"
          },
          "adCategory": {
            "title": "Ad category",
            "enum": [
              "all",
              "political_and_issue_ads",
              "housing",
              "employment",
              "credit"
            ],
            "type": "string",
            "description": "Same as Ad type, named as other scrapers do. When set to anything but all it overrides Ad type.",
            "default": "all"
          },
          "mediaType": {
            "title": "Media type",
            "enum": [
              "all",
              "image",
              "video",
              "meme",
              "none"
            ],
            "type": "string",
            "description": "Filter by creative type. Choose all unless you need only one creative type.",
            "default": "all"
          },
          "dateFrom": {
            "title": "Started on or after",
            "type": "string",
            "description": "YYYY-MM-DD. Only ads that started running on or after this date. Example: \"2026-01-01\"."
          },
          "dateTo": {
            "title": "Started on or before",
            "type": "string",
            "description": "YYYY-MM-DD. Only ads that started running on or before this date. Example: \"2026-10-01\"."
          },
          "minDate": {
            "title": "Min start date",
            "type": "string",
            "description": "YYYY-MM-DD. Keep only ads whose delivery started on or after this date. Same as dateFrom. Example: \"2026-08-01\"."
          },
          "maxDate": {
            "title": "Max start date",
            "type": "string",
            "description": "YYYY-MM-DD. Keep only ads whose delivery started on or before this date. Same as dateTo. Example: \"2026-10-01\"."
          },
          "platforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Optional. Any of: facebook, instagram, audience_network, messenger, threads. Example: [\"facebook\",\"instagram\"].",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "Ad languages",
            "type": "array",
            "description": "Optional language codes such as en, es. The library filters by these; they are echoed in the languages field. Example: [\"en\",\"es\"].",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "default",
              "relevance",
              "impressions"
            ],
            "type": "string",
            "description": "default keeps the library's own order. relevance is the library's relevancy ranking. impressions ranks by total impressions, which the library only publishes for political and issue ads.",
            "default": "default"
          },
          "fetchDetails": {
            "title": "Fetch details",
            "type": "boolean",
            "description": "Adds a details object to each ad: collation id, paid-for-by byline, disclaimer, AI-generated and sensitive-content flags, total active time, extra links, texts and media. Off by default; no extra requests, no extra charge.",
            "default": false
          },
          "maxItems": {
            "title": "Max ads",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Total ads to deliver across all targets. You are charged per ad.",
            "default": 100
          },
          "onlyNewSinceLastRun": {
            "title": "Only ads not seen in earlier runs",
            "type": "boolean",
            "description": "Skip ads already delivered by a previous run (tracked by ad id). Skipped ads are not charged.",
            "default": false
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store that remembers delivered ad ids when onlyNewSinceLastRun is on. Change it to keep separate watch lists. Example: \"shoe-brands-watch\".",
            "default": "meta-ad-library-seen"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy. Residential is the default: Meta rate-limits datacenter IPs after the first page, so datacenter returns only the first ~30 ads.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}