---
openapi: 3.1.0
info:
  title: Meta Ad Library — SearchApi
  version: 3.1.0
  description: Generated from the SearchApi engine catalog. Parameters marked in the
    catalog as unverified are described from its records rather than from the vendor's
    specification.
servers:
- url: https://www.searchapi.io/api/v1
paths:
  "/search":
    get:
      operationId: meta_ad_library
      summary: Meta Ad Library
      parameters:
      - name: engine
        in: query
        required: true
        description: Engine that retrieves the data; fixed per API (see Apis::BY_ENGINE
          keys).
        schema:
          type: string
          const: meta_ad_library
      - name: api_key
        in: query
        required: true
        description: 'SearchApi.io API key; alternatively send ''Authorization: Bearer
          <key>''.'
        schema:
          type: string
      - name: zero_retention
        in: query
        required: false
        description: 'Enterprise-only: disables all logging and persistent storage
          of the search.'
        schema:
          type: boolean
          default: false
      - name: q
        in: query
        required: true
        description: Search query; most engines accept native operators and advanced
          filters.
        schema:
          type: string
      - name: country
        in: query
        required: false
        description: Country the ads were shown in.
        schema:
          type: string
      - name: platforms
        in: query
        required: false
        description: 'Comma-separated Meta platforms filter: facebook, instagram,
          audience_network, messenger.'
        schema:
          type: string
      - name: media_type
        in: query
        required: false
        description: Creative media type filter.
        schema:
          type: string
          enum:
          - all
          - image
          - video
          - meme
          - none
      - name: active_status
        in: query
        required: false
        description: Whether the returned ads are currently running.
        schema:
          type: string
          enum:
          - all
          - active
          - inactive
      - name: ad_type
        in: query
        required: false
        description: Ad category filter, e.g. all, political_and_issue_ads.
        schema:
          type: string
      - name: next_page_token
        in: query
        required: false
        description: Opaque token from the previous response that fetches the next
          page.
        schema:
          type: string
      responses:
        '200':
          description: A Meta Ad Library result envelope.
