> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# Search Facebook Ad Library ads

> Searches Facebook Ad Library ads by keyword and filters. Required input: `query`. Results are paged: while `data.page.hasMore` is true, send `data.page.nextCursor` as `cursor` to get the next page.

> **请求示例待验证。** 此接口的请求示例尚未在生产环境验证。静态示例用于说明请求格式，请替换为自己的参数。正式调用前，可用免费的报价模式（`X-AISA-Cost-Mode: quote`）查看预估费用。

## 请求规范

* **方法与路径:** GET /apis/v1/facebook/ad-library/ads/search
* **可用状态:** enabled
* **请求 URL 模板:** `https://api.aisa.one/apis/v1/facebook/ad-library/ads/search`
* **adType:** query; 可选
* **country:** query; 可选
* **cursor:** query; 可选
* **endDate:** query; 可选
* **language:** query; 可选
* **mediaType:** query; 可选
* **query:** query; 必填
* **searchType:** query; 可选
* **sortBy:** query; 可选
* **startDate:** query; 可选
* **status:** query; 可选
* **trim:** query; 可选

[完整 OpenAPI 定义](https://aisa.one/docs/openapi-public/zh/facebook.json)

有效请求声明（包括认证和引用的 schema）：

```json theme={null}
{
  "operationId": "facebook.ad-library.ads.search",
  "method": "GET",
  "path": "/apis/v1/facebook/ad-library/ads/search",
  "servers": [
    {
      "url": "https://api.aisa.one"
    }
  ],
  "parameters": [
    {
      "in": "query",
      "name": "adType",
      "required": false,
      "schema": {
        "description": "Optional filter for all ads or political and issue ads.",
        "enum": [
          "all",
          "political-and-issue"
        ],
        "maxLength": 4096,
        "minLength": 1,
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "country",
      "required": false,
      "schema": {
        "description": "Optional country code filter. Use ALL to search all countries.",
        "maxLength": 4096,
        "minLength": 1,
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "cursor",
      "required": false,
      "schema": {
        "description": "Opaque pagination cursor from a previous response.",
        "maxLength": 16384,
        "minLength": 1,
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "endDate",
      "required": false,
      "schema": {
        "description": "Optional end date filter in YYYY-MM-DD format.",
        "maxLength": 4096,
        "minLength": 1,
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "language",
      "required": false,
      "schema": {
        "description": "Optional ISO 639-1 language code (two letters, for example EN, ES or FR) to only return ads in that language.",
        "maxLength": 4096,
        "minLength": 1,
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "mediaType",
      "required": false,
      "schema": {
        "description": "Optional creative media filter.",
        "enum": [
          "all",
          "image",
          "image-and-meme",
          "meme",
          "none",
          "video"
        ],
        "maxLength": 4096,
        "minLength": 1,
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "query",
      "required": true,
      "schema": {
        "description": "Search query text for Facebook Ad Library ads.",
        "maxLength": 4096,
        "minLength": 1,
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "searchType",
      "required": false,
      "schema": {
        "description": "Optional keyword matching mode for the search query.",
        "enum": [
          "exact-phrase",
          "keyword-unordered"
        ],
        "maxLength": 4096,
        "minLength": 1,
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "sortBy",
      "required": false,
      "schema": {
        "description": "Optional sort order for returned ads.",
        "enum": [
          "impressions",
          "most-recent"
        ],
        "maxLength": 4096,
        "minLength": 1,
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "startDate",
      "required": false,
      "schema": {
        "description": "Optional start date filter in YYYY-MM-DD format.",
        "maxLength": 4096,
        "minLength": 1,
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "status",
      "required": false,
      "schema": {
        "description": "Optional ad status filter.",
        "enum": [
          "active",
          "all",
          "inactive"
        ],
        "maxLength": 4096,
        "minLength": 1,
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "trim",
      "required": false,
      "schema": {
        "description": "When true, returns a smaller response with fewer fields.",
        "type": "boolean"
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "x-aisa-status": "enabled",
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```

## 已观察到的响应结构

以下结构来自探针或抽样请求的成功结果，只反映已观察到的部分：字段和类型可能变化，不保证每次都有。已有正式响应定义优先；这里不发布真实响应值。

* **HTTP 状态 / 最近观察日期:** 200 / 2026-11-27

```json theme={null}
{
  "additionalProperties": true,
  "properties": {
    "aisa_pagination": {
      "additionalProperties": true,
      "properties": {
        "has_more": {
          "type": "boolean"
        },
        "next_cursor": {
          "type": [
            "null",
            "string"
          ]
        },
        "next_param": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "data": {
      "additionalProperties": true,
      "properties": {
        "page": {
          "additionalProperties": true,
          "properties": {
            "hasMore": {
              "type": "boolean"
            },
            "nextCursor": {
              "type": [
                "null",
                "string"
              ]
            }
          },
          "type": "object"
        },
        "query": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "meta": {
      "additionalProperties": true,
      "properties": {
        "version": {
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "type": "object"
}
```

## 费用与请求规则

按实际用量收费。 默认请求预估费用：\$0.042 USD。 最终费用以实际用量为准。 账户适用价格可能不同；支持报价的接口可按实际请求获取报价。

## 翻页

* 把 `aisa_pagination.next_cursor` 作为 `cursor`（查询参数）传入即可获取下一页；`aisa_pagination.has_more` 为 false 时停止。
* 响应头 `X-AISA-Has-More` 与 `X-AISA-Next-Cursor` 返回相同的值。

## 响应时间

* 通常 10 秒内返回。


## OpenAPI

````yaml openapi-public/zh/facebook.json GET /apis/v1/facebook/ad-library/ads/search
openapi: 3.1.0
info:
  description: ''
  title: Facebook公开数据
  version: '1'
  x-aisa-capabilities:
    idempotency: Idempotency-Key
    max_price: X-AISA-Max-Price-USD
    quote:
      header: X-AISA-Cost-Mode
      value: quote
  x-aisa-catalogs:
    facebook:
      description: ''
      title: Facebook公开数据
      x-aisa-capabilities:
        idempotency: Idempotency-Key
        max_price: X-AISA-Max-Price-USD
        quote:
          header: X-AISA-Cost-Mode
          value: quote
      x-aisa-document:
        facts_hash: 23c4518fe0e0b2521c80af5979c6da9baa3750647312250fa85879a638b281e5
        generator_version: '3'
        protocol_version: '1'
        schema_version: '1'
      x-aisa-plans:
        builder: 1
        display_plan: payg
        payg: 1
        similarweb_payg: 1
        team: 1
        version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-configured-paths:
    - /apis/v1/facebook/ad-library/ads
    - /apis/v1/facebook/ad-library/ads/search
    - /apis/v1/facebook/ad-library/companies/ads
    - /apis/v1/facebook/ad-library/companies/search
    - /apis/v1/facebook/events
    - /apis/v1/facebook/events/details
    - /apis/v1/facebook/events/search
    - /apis/v1/facebook/get-comment-replies
    - /apis/v1/facebook/get-post-comments
    - /apis/v1/facebook/get-post-comments-v1
    - /apis/v1/facebook/get-profile-id
    - /apis/v1/facebook/get-profile-posts
    - /apis/v1/facebook/get-profile-posts-v1
    - /apis/v1/facebook/groups
    - /apis/v1/facebook/groups/posts
    - /apis/v1/facebook/marketplace/items
    - /apis/v1/facebook/marketplace/locations/search
    - /apis/v1/facebook/marketplace/search
    - /apis/v1/facebook/posts
    - /apis/v1/facebook/posts/comments
    - /apis/v1/facebook/posts/comments/replies
    - /apis/v1/facebook/posts/transcript
    - /apis/v1/facebook/profiles
    - /apis/v1/facebook/profiles/events
    - /apis/v1/facebook/profiles/photos
    - /apis/v1/facebook/profiles/posts
    - /apis/v1/facebook/profiles/reels
    - /apis/v1/facebook/search-post
    - /apis/v1/facebook/search-post-v1
  x-aisa-document:
    composer_version: '31'
    facts_hash: 23c4518fe0e0b2521c80af5979c6da9baa3750647312250fa85879a638b281e5
    generator_version: '3'
    protocol_version: '1'
    response_pending: []
    schema_version: '1'
    public_projection:
      version: '4'
      source_document_hash: sha256:adf4d33a1b2fa6ef0487005567fb2933bd5878d87599dca5ff15f1d6ef4261ce
    document_hash: sha256:cb834c22c823b5806007ca04dff3d916d2c68d1e4f6fa85362c241bdb784b855
  x-aisa-plans:
    builder: 1
    display_plan: payg
    payg: 1
    similarweb_payg: 1
    team: 1
    version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-provider: facebook
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
paths:
  /apis/v1/facebook/ad-library/ads/search:
    get:
      tags:
        - Facebook
      summary: Search Facebook Ad Library ads
      description: >-
        Searches Facebook Ad Library ads by keyword and filters. Required input:
        `query`. Results are paged: while `data.page.hasMore` is true, send
        `data.page.nextCursor` as `cursor` to get the next page.


        > **请求示例待验证。**
        此接口的请求示例尚未在生产环境验证。静态示例用于说明请求格式，请替换为自己的参数。正式调用前，可用免费的报价模式（`X-AISA-Cost-Mode:
        quote`）查看预估费用。
      operationId: facebook.ad-library.ads.search
      parameters:
        - in: query
          name: adType
          required: false
          schema:
            description: Optional filter for all ads or political and issue ads.
            enum:
              - all
              - political-and-issue
            maxLength: 4096
            minLength: 1
            type: string
        - in: query
          name: country
          required: false
          schema:
            description: Optional country code filter. Use ALL to search all countries.
            maxLength: 4096
            minLength: 1
            type: string
        - in: query
          name: cursor
          required: false
          schema:
            description: Opaque pagination cursor from a previous response.
            maxLength: 16384
            minLength: 1
            type: string
        - in: query
          name: endDate
          required: false
          schema:
            description: Optional end date filter in YYYY-MM-DD format.
            maxLength: 4096
            minLength: 1
            type: string
        - in: query
          name: language
          required: false
          schema:
            description: >-
              Optional ISO 639-1 language code (two letters, for example EN, ES
              or FR) to only return ads in that language.
            maxLength: 4096
            minLength: 1
            type: string
        - in: query
          name: mediaType
          required: false
          schema:
            description: Optional creative media filter.
            enum:
              - all
              - image
              - image-and-meme
              - meme
              - none
              - video
            maxLength: 4096
            minLength: 1
            type: string
        - in: query
          name: query
          required: true
          schema:
            description: Search query text for Facebook Ad Library ads.
            maxLength: 4096
            minLength: 1
            type: string
        - in: query
          name: searchType
          required: false
          schema:
            description: Optional keyword matching mode for the search query.
            enum:
              - exact-phrase
              - keyword-unordered
            maxLength: 4096
            minLength: 1
            type: string
        - in: query
          name: sortBy
          required: false
          schema:
            description: Optional sort order for returned ads.
            enum:
              - impressions
              - most-recent
            maxLength: 4096
            minLength: 1
            type: string
        - in: query
          name: startDate
          required: false
          schema:
            description: Optional start date filter in YYYY-MM-DD format.
            maxLength: 4096
            minLength: 1
            type: string
        - in: query
          name: status
          required: false
          schema:
            description: Optional ad status filter.
            enum:
              - active
              - all
              - inactive
            maxLength: 4096
            minLength: 1
            type: string
        - in: query
          name: trim
          required: false
          schema:
            description: When true, returns a smaller response with fewer fields.
            type: boolean
      responses:
        '200':
          content:
            application/json:
              examples:
                empty:
                  value:
                    data:
                      ads: []
                      page:
                        hasMore: false
                        nextCursor: null
                        totalResultsEstimate: 0
                      query: unlikely search
                    meta:
                      creditsCharged: 1
                      requestId: req_01example_empty
                      version: v1
                found:
                  value:
                    data:
                      ads:
                        - adId: null
                          brandedContent: null
                          campaign:
                            collationCount: 1
                            collationId: '888075953335279'
                          categories:
                            - UNKNOWN
                          countries: []
                          creative:
                            bodyText: Example ad body text.
                            callToAction: Learn more
                            callToActionType: LEARN_MORE
                            caption: null
                            cards: []
                            displayFormat: IMAGE
                            images:
                              - resizedUrl: https://example.com/image-resized.jpg
                                url: https://example.com/image.jpg
                                watermarkedResizedUrl: null
                            linkDescription: null
                            linkUrl: https://example.com/product
                            title: null
                            videos: []
                          endedAt: '2025-02-28T00:00:00.000Z'
                          euTransparency: null
                          id: '615470338018648'
                          impressions:
                            index: -1
                            text: null
                          isActive: true
                          page:
                            categories:
                              - Pet Service
                            id: '115531458627129'
                            isDeleted: false
                            likeCount: 3823
                            name: Example Advertiser
                            profilePictureUrl: https://example.com/page.jpg
                            url: https://www.facebook.com/example
                          publisherPlatforms:
                            - FACEBOOK
                            - INSTAGRAM
                          spend: null
                          startedAt: '2025-02-28T00:00:00.000Z'
                          url: >-
                            https://www.facebook.com/ads/library?id=615470338018648
                      page:
                        hasMore: true
                        nextCursor: >-
                          eyJjIjoiQVFIX2V4YW1wbGUiLCJmIjp7InF1ZXJ5IjoicnVubmluZyJ9fQ
                        totalResultsEstimate: 50001
                      query: running
                    meta:
                      creditsCharged: 1
                      requestId: req_01example_found
                      version: v1
                inactive:
                  value:
                    data:
                      ads:
                        - adId: null
                          brandedContent: null
                          campaign:
                            collationCount: 1
                            collationId: '888075953335279'
                          categories:
                            - UNKNOWN
                          countries: []
                          creative:
                            bodyText: Example ad body text.
                            callToAction: Learn more
                            callToActionType: LEARN_MORE
                            caption: null
                            cards: []
                            displayFormat: IMAGE
                            images:
                              - resizedUrl: https://example.com/image-resized.jpg
                                url: https://example.com/image.jpg
                                watermarkedResizedUrl: null
                            linkDescription: null
                            linkUrl: https://example.com/product
                            title: null
                            videos: []
                          endedAt: '2025-03-01T00:00:00.000Z'
                          euTransparency: null
                          id: '615470338018651'
                          impressions:
                            index: -1
                            text: null
                          isActive: false
                          page:
                            categories:
                              - Pet Service
                            id: '115531458627129'
                            isDeleted: false
                            likeCount: 3823
                            name: Example Advertiser
                            profilePictureUrl: https://example.com/page.jpg
                            url: https://www.facebook.com/example
                          publisherPlatforms:
                            - FACEBOOK
                            - INSTAGRAM
                          spend: null
                          startedAt: '2025-02-28T00:00:00.000Z'
                          url: >-
                            https://www.facebook.com/ads/library?id=615470338018651
                      page:
                        hasMore: false
                        nextCursor: null
                        totalResultsEstimate: 50001
                      query: running
                    meta:
                      creditsCharged: 1
                      requestId: req_01example_inactive
                      version: v1
                paginated:
                  value:
                    data:
                      ads:
                        - adId: null
                          brandedContent: null
                          campaign:
                            collationCount: 1
                            collationId: '888075953335279'
                          categories:
                            - UNKNOWN
                          countries: []
                          creative:
                            bodyText: Example ad body text.
                            callToAction: Learn more
                            callToActionType: LEARN_MORE
                            caption: null
                            cards: []
                            displayFormat: IMAGE
                            images:
                              - resizedUrl: https://example.com/image-resized.jpg
                                url: https://example.com/image.jpg
                                watermarkedResizedUrl: null
                            linkDescription: null
                            linkUrl: https://example.com/product
                            title: null
                            videos: []
                          endedAt: '2025-02-28T00:00:00.000Z'
                          euTransparency: null
                          id: '615470338018649'
                          impressions:
                            index: -1
                            text: null
                          isActive: true
                          page:
                            categories:
                              - Pet Service
                            id: '115531458627129'
                            isDeleted: false
                            likeCount: 3823
                            name: Example Advertiser
                            profilePictureUrl: https://example.com/page.jpg
                            url: https://www.facebook.com/example
                          publisherPlatforms:
                            - FACEBOOK
                            - INSTAGRAM
                          spend: null
                          startedAt: '2025-02-28T00:00:00.000Z'
                          url: >-
                            https://www.facebook.com/ads/library?id=615470338018649
                      page:
                        hasMore: true
                        nextCursor: >-
                          eyJjIjoiQVFIX3NlY29uZF9wYWdlIiwiZiI6eyJxdWVyeSI6InJ1bm5pbmcifX0
                        totalResultsEstimate: null
                      query: running
                    meta:
                      creditsCharged: 1
                      requestId: req_01example_page_2
                      version: v1
                video:
                  value:
                    data:
                      ads:
                        - adId: null
                          brandedContent: null
                          campaign:
                            collationCount: 1
                            collationId: '888075953335279'
                          categories:
                            - UNKNOWN
                          countries: []
                          creative:
                            bodyText: Example ad body text.
                            callToAction: Learn more
                            callToActionType: LEARN_MORE
                            caption: null
                            cards: []
                            displayFormat: VIDEO
                            images: []
                            linkDescription: null
                            linkUrl: https://example.com/product
                            title: null
                            videos:
                              - hdUrl: https://example.com/video-hd.mp4
                                previewImageUrl: https://example.com/video-preview.jpg
                                sdUrl: https://example.com/video-sd.mp4
                          endedAt: '2025-02-28T00:00:00.000Z'
                          euTransparency: null
                          id: '615470338018650'
                          impressions:
                            index: -1
                            text: null
                          isActive: true
                          page:
                            categories:
                              - Pet Service
                            id: '115531458627129'
                            isDeleted: false
                            likeCount: 3823
                            name: Example Advertiser
                            profilePictureUrl: https://example.com/page.jpg
                            url: https://www.facebook.com/example
                          publisherPlatforms:
                            - FACEBOOK
                            - INSTAGRAM
                          spend: null
                          startedAt: '2025-02-28T00:00:00.000Z'
                          url: >-
                            https://www.facebook.com/ads/library?id=615470338018650
                      page:
                        hasMore: false
                        nextCursor: null
                        totalResultsEstimate: 50001
                      query: running
                    meta:
                      creditsCharged: 1
                      requestId: req_01example_video
                      version: v1
              schema:
                description: Standard success response envelope.
                properties:
                  aisa_pagination:
                    additionalProperties: false
                    description: >-
                      AIsa pagination. Pass next_cursor as cursor to fetch the
                      next page; has_more is false on the last page.
                    properties:
                      has_more:
                        type: boolean
                      next_cursor:
                        type:
                          - string
                          - 'null'
                      next_param:
                        const: cursor
                        type: string
                    required:
                      - has_more
                      - next_cursor
                      - next_param
                    type: object
                  data:
                    description: Endpoint-specific response payload.
                    properties:
                      ads:
                        description: >-
                          Ads returned for the requested search. This array may
                          be empty when no ads match the filters.
                        items:
                          description: A single Facebook Ad Library ad.
                          properties:
                            adId:
                              description: Platform ad id when available.
                              type:
                                - string
                                - 'null'
                            brandedContent:
                              description: >-
                                Partner page for branded content (paid
                                partnership) ads. Null when the ad is not a
                                partnership ad.
                              properties:
                                pageId:
                                  description: >-
                                    Facebook page id of the partner when
                                    available.
                                  type:
                                    - string
                                    - 'null'
                                pageName:
                                  description: >-
                                    Display name of the partner page when
                                    available.
                                  type:
                                    - string
                                    - 'null'
                                pageUrl:
                                  description: >-
                                    Public profile URL for the partner (Facebook
                                    page or Instagram account) when available.
                                  type:
                                    - string
                                    - 'null'
                              required:
                                - pageId
                                - pageName
                                - pageUrl
                              type:
                                - object
                                - 'null'
                            campaign:
                              description: Campaign collation metadata for this ad.
                              properties:
                                collationCount:
                                  description: >-
                                    Number of ads in the campaign collation when
                                    available.
                                  minimum: 0
                                  type:
                                    - integer
                                    - 'null'
                                collationId:
                                  description: Campaign collation id when available.
                                  type:
                                    - string
                                    - 'null'
                              required:
                                - collationId
                                - collationCount
                              type: object
                            categories:
                              description: Ad categories reported by the platform.
                              items:
                                minLength: 1
                                type: string
                              type: array
                            countries:
                              description: >-
                                Countries targeted or reached by the ad when
                                available.
                              items:
                                minLength: 1
                                type: string
                              type: array
                            creative:
                              description: Creative content for this ad.
                              properties:
                                bodyText:
                                  description: Primary ad body text when available.
                                  type:
                                    - string
                                    - 'null'
                                callToAction:
                                  description: Call-to-action label when available.
                                  type:
                                    - string
                                    - 'null'
                                callToActionType:
                                  description: Call-to-action type when available.
                                  type:
                                    - string
                                    - 'null'
                                caption:
                                  description: Ad caption when available.
                                  type:
                                    - string
                                    - 'null'
                                cards:
                                  description: Carousel cards attached to the creative.
                                  items:
                                    description: >-
                                      Carousel card for a Facebook Ad Library ad
                                      creative.
                                    properties:
                                      body:
                                        description: Card body text when available.
                                        type:
                                          - string
                                          - 'null'
                                      caption:
                                        description: Card caption when available.
                                        type:
                                          - string
                                          - 'null'
                                      imageUrl:
                                        description: Card image URL when available.
                                        type:
                                          - string
                                          - 'null'
                                      linkUrl:
                                        description: Card link URL when available.
                                        type:
                                          - string
                                          - 'null'
                                      title:
                                        description: Card title when available.
                                        type:
                                          - string
                                          - 'null'
                                      videoUrl:
                                        description: Card video URL when available.
                                        type:
                                          - string
                                          - 'null'
                                    required:
                                      - title
                                      - body
                                      - caption
                                      - linkUrl
                                      - imageUrl
                                      - videoUrl
                                    type: object
                                  type: array
                                displayFormat:
                                  description: >-
                                    Display format for the creative when
                                    available.
                                  type:
                                    - string
                                    - 'null'
                                images:
                                  description: Image assets attached to the creative.
                                  items:
                                    description: >-
                                      Image asset for a Facebook Ad Library ad
                                      creative.
                                    properties:
                                      resizedUrl:
                                        description: Resized image URL when available.
                                        type:
                                          - string
                                          - 'null'
                                      url:
                                        description: Image URL when available.
                                        type:
                                          - string
                                          - 'null'
                                      watermarkedResizedUrl:
                                        description: >-
                                          Watermarked resized image URL when
                                          available.
                                        type:
                                          - string
                                          - 'null'
                                    required:
                                      - url
                                      - resizedUrl
                                      - watermarkedResizedUrl
                                    type: object
                                  type: array
                                linkDescription:
                                  description: Link description when available.
                                  type:
                                    - string
                                    - 'null'
                                linkUrl:
                                  description: Primary link URL when available.
                                  type:
                                    - string
                                    - 'null'
                                title:
                                  description: Ad title when available.
                                  type:
                                    - string
                                    - 'null'
                                videos:
                                  description: Video assets attached to the creative.
                                  items:
                                    description: >-
                                      Video asset for a Facebook Ad Library ad
                                      creative.
                                    properties:
                                      hdUrl:
                                        description: >-
                                          High-definition video URL when
                                          available.
                                        type:
                                          - string
                                          - 'null'
                                      previewImageUrl:
                                        description: Video preview image URL when available.
                                        type:
                                          - string
                                          - 'null'
                                      sdUrl:
                                        description: >-
                                          Standard-definition video URL when
                                          available.
                                        type:
                                          - string
                                          - 'null'
                                    required:
                                      - hdUrl
                                      - sdUrl
                                      - previewImageUrl
                                    type: object
                                  type: array
                              required:
                                - bodyText
                                - title
                                - caption
                                - linkUrl
                                - linkDescription
                                - callToAction
                                - callToActionType
                                - displayFormat
                                - images
                                - videos
                                - cards
                              type: object
                            endedAt:
                              description: >-
                                ISO-8601 timestamp for when the ad ended, when
                                available.
                              type:
                                - string
                                - 'null'
                            euTransparency:
                              description: >-
                                EU/UK audience transparency (reach, age, gender,
                                locations, payer and beneficiary). Usually only
                                present on single-ad lookups of ads delivered in
                                the EU or UK; null otherwise.
                              properties:
                                ageRange:
                                  description: Targeted age range when available.
                                  properties:
                                    max:
                                      description: Maximum targeted age when available.
                                      minimum: 0
                                      type:
                                        - integer
                                        - 'null'
                                    min:
                                      description: Minimum targeted age when available.
                                      minimum: 0
                                      type:
                                        - integer
                                        - 'null'
                                  required:
                                    - min
                                    - max
                                  type:
                                    - object
                                    - 'null'
                                gender:
                                  description: >-
                                    Targeted gender audience as reported by the
                                    platform (for example `All`, `Women` or
                                    `Men`) when available.
                                  type:
                                    - string
                                    - 'null'
                                locations:
                                  description: >-
                                    Targeted locations. Empty when none are
                                    disclosed.
                                  items:
                                    description: Targeted location disclosed for the ad.
                                    properties:
                                      isExcluded:
                                        description: >-
                                          Whether the location was excluded from
                                          targeting when available.
                                        type:
                                          - boolean
                                          - 'null'
                                      name:
                                        description: >-
                                          Location name, such as a country or
                                          country group.
                                        minLength: 1
                                        type: string
                                      type:
                                        description: >-
                                          Location type as reported by the
                                          platform (for example `countries` or
                                          `country_groups`) when available.
                                        type:
                                          - string
                                          - 'null'
                                    required:
                                      - name
                                      - type
                                      - isExcluded
                                    type: object
                                  type: array
                                payers:
                                  description: >-
                                    Payer and beneficiary pairs. Empty when none
                                    are disclosed.
                                  items:
                                    description: >-
                                      Payer and beneficiary disclosed for the
                                      ad.
                                    properties:
                                      beneficiary:
                                        description: >-
                                          Name of the entity the ad benefits when
                                          available.
                                        type:
                                          - string
                                          - 'null'
                                      payer:
                                        description: >-
                                          Name of the entity that paid for the ad
                                          when available.
                                        type:
                                          - string
                                          - 'null'
                                    required:
                                      - payer
                                      - beneficiary
                                    type: object
                                  type: array
                                totalReach:
                                  description: >-
                                    Total reach reported in the transparency
                                    disclosure when available.
                                  minimum: 0
                                  type:
                                    - integer
                                    - 'null'
                              required:
                                - totalReach
                                - ageRange
                                - gender
                                - locations
                                - payers
                              type:
                                - object
                                - 'null'
                            id:
                              description: Stable identifier for the ad.
                              minLength: 1
                              type: string
                            impressions:
                              description: Impressions metadata when available.
                              properties:
                                index:
                                  description: Impressions index when available.
                                  type:
                                    - integer
                                    - 'null'
                                text:
                                  description: >-
                                    Human-readable impressions label when
                                    available.
                                  type:
                                    - string
                                    - 'null'
                              required:
                                - text
                                - index
                              type:
                                - object
                                - 'null'
                            isActive:
                              description: Whether the ad is currently active.
                              type: boolean
                            page:
                              description: Advertiser page summary for this ad.
                              properties:
                                categories:
                                  description: >-
                                    Public categories for the advertiser page
                                    when available.
                                  items:
                                    minLength: 1
                                    type: string
                                  type: array
                                id:
                                  description: >-
                                    Facebook page id for the advertiser when
                                    available.
                                  type:
                                    - string
                                    - 'null'
                                isDeleted:
                                  description: >-
                                    Whether the advertiser page is marked
                                    deleted.
                                  type:
                                    - boolean
                                    - 'null'
                                likeCount:
                                  description: Advertiser page like count when available.
                                  minimum: 0
                                  type:
                                    - integer
                                    - 'null'
                                name:
                                  description: >-
                                    Display name for the advertiser page when
                                    available.
                                  type:
                                    - string
                                    - 'null'
                                profilePictureUrl:
                                  description: >-
                                    Profile picture URL for the advertiser page
                                    when available.
                                  type:
                                    - string
                                    - 'null'
                                url:
                                  description: >-
                                    Public Facebook URL for the advertiser page
                                    when available.
                                  type:
                                    - string
                                    - 'null'
                              required:
                                - id
                                - name
                                - url
                                - isDeleted
                                - profilePictureUrl
                                - likeCount
                                - categories
                              type: object
                            publisherPlatforms:
                              description: >-
                                Publisher platforms where the ad ran or is
                                running.
                              items:
                                minLength: 1
                                type: string
                              type: array
                            spend:
                              description: Spend metadata when available.
                              properties:
                                amount:
                                  description: Spend amount text when available.
                                  type:
                                    - string
                                    - 'null'
                                currency:
                                  description: Currency code for spend when available.
                                  type:
                                    - string
                                    - 'null'
                              required:
                                - amount
                                - currency
                              type:
                                - object
                                - 'null'
                            startedAt:
                              description: >-
                                ISO-8601 timestamp for when the ad started, when
                                available.
                              type:
                                - string
                                - 'null'
                            url:
                              description: >-
                                Public Facebook Ad Library URL for this ad when
                                available.
                              type:
                                - string
                                - 'null'
                          required:
                            - id
                            - adId
                            - url
                            - page
                            - campaign
                            - isActive
                            - publisherPlatforms
                            - startedAt
                            - endedAt
                            - categories
                            - countries
                            - impressions
                            - spend
                            - creative
                            - brandedContent
                            - euTransparency
                          type: object
                        type: array
                      page:
                        description: Pagination information for the current response.
                        properties:
                          hasMore:
                            description: Whether another page of ads can be requested.
                            type: boolean
                          nextCursor:
                            description: >-
                              Cursor to pass as `cursor` in the next request
                              when `hasMore` is true; otherwise null.
                            type:
                              - string
                              - 'null'
                          totalResultsEstimate:
                            description: >-
                              Estimated total number of matching ads when
                              available.
                            minimum: 0
                            type:
                              - integer
                              - 'null'
                        required:
                          - nextCursor
                          - hasMore
                          - totalResultsEstimate
                        type: object
                      query:
                        description: Search query that was evaluated for this response.
                        type: string
                    required:
                      - query
                      - ads
                      - page
                    type: object
                  meta:
                    description: Metadata describing the request and billing outcome.
                    properties:
                      creditsCharged:
                        description: Credits charged for this request.
                        minimum: 0
                        type: integer
                      requestId:
                        description: Unique request identifier for tracing this API call.
                        minLength: 1
                        type: string
                      version:
                        description: Public API version that served the response.
                        enum:
                          - v1
                        type: string
                    required:
                      - requestId
                      - creditsCharged
                      - version
                    type: object
                required:
                  - data
                  - meta
                type: object
          description: Facebook Ad Library ads matching the requested search.
          headers:
            X-AISA-Has-More:
              description: Mirrors aisa_pagination.has_more.
              schema:
                enum:
                  - 'true'
                  - 'false'
                type: string
            X-AISA-Next-Cursor:
              description: Mirrors aisa_pagination.next_cursor; absent on the last page.
              schema:
                type: string
        default:
          content:
            application/json:
              schema: {}
          description: >-
            Error response; upstream passthrough responses may use provider
            formats
components:
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.