> ## 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

# Discovery Ads

> Search the Foreplay ad index (100M+ ads) with a text query plus filters; each result is a full ad object.

Search across the Foreplay ad index with a text `query` plus filters (live status, display format, publisher platform, niche, market target, language, video/running duration, date range, order). Each result in `data[]` is a full ad object — image/video URLs, transcription, brand metadata, targeting, and more. Use `cursor` + `limit` (max 250) to page.

`display_format` accepts exactly these 11 values: `carousel`, `dco`, `dpa`, `event`, `image`, `multi_images`, `multi_medias`, `multi_videos`, `page_like`, `text`, `video`.

**Billing: per item returned in `data[]`; empty results and errors are not charged.** Current prices are on [aisa.one/api](https://aisa.one/api). One credit per ad; a call with `limit≤50` bills at most 50 items

Related: [`get_foreplay-getadsbybrandid`](https://aisa.one/docs/api-reference/foreplay/get_foreplay-getadsbybrandid), [`get_foreplay-getbrandsbydomain`](https://aisa.one/docs/api-reference/foreplay/get_foreplay-getbrandsbydomain), [`get_foreplay-brand-analytics`](https://aisa.one/docs/api-reference/foreplay/get_foreplay-brand-analytics).

## Request contract

* **Method and path:** GET /apis/v1/foreplay/discovery/ads
* **Availability:** enabled
* **Request URL template:** `https://api.aisa.one/apis/v1/foreplay/discovery/ads`
* **cursor:** query; optional
* **display\_format:** query; optional
* **end\_date:** query; optional
* **languages:** query; optional
* **limit:** query; optional
* **live:** query; optional
* **market\_target:** query; optional
* **niches:** query; optional
* **order:** query; optional
* **publisher\_platform:** query; optional
* **query:** query; optional
* **running\_duration\_max\_days:** query; optional
* **running\_duration\_min\_days:** query; optional
* **start\_date:** query; optional
* **video\_duration\_max:** query; optional
* **video\_duration\_min:** query; optional
* **Runtime facts:** 799c2645862e25f3076e45d5e7d545772f57444689dd138cd88f92c37554b81c

[Complete OpenAPI definition](https://aisa.one/docs/reference-contracts/foreplay.json)

Effective request and pricing declaration (including authentication and referenced schemas):

```json theme={null}
{
  "operationId": "search_discovery_ads",
  "method": "GET",
  "path": "/apis/v1/foreplay/discovery/ads",
  "servers": [
    {
      "url": "https://api.aisa.one"
    }
  ],
  "parameters": [
    {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "Cursor for pagination. Use the cursor value from the previous response's metadata to get the next page of results.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "display_format",
      "in": "query",
      "required": false,
      "description": "Filter by one or more display formats.\nAvailable formats (11): carousel, dco, dpa, event, image, multi_images, multi_medias, multi_videos, page_like, text, video\nExample: `?display_format=video&display_format=carousel`\n\n",
      "schema": {
        "type": "string",
        "enum": [
          "carousel",
          "dco",
          "dpa",
          "event",
          "image",
          "multi_images",
          "multi_medias",
          "multi_videos",
          "page_like",
          "text",
          "video"
        ]
      }
    },
    {
      "name": "end_date",
      "in": "query",
      "required": false,
      "description": "End date (inclusive). Format: 'YYYY-MM-DD', 'YYYY-MM-DDTHH:MM:SS', or 'YYYY-MM-DD HH:MM:SS'. If you provide only the date (e.g. '2024-11-12'), it will be interpreted as '2024-11-12 00:00:00'. To include all results for a given day, set end_date to 'YYYY-MM-DD 23:59:59' or to the next day at '00:00:00'. Examples: start_date=2024-11-12 00:00:00, end_date=2024-11-12 23:59:59.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "languages",
      "in": "query",
      "required": false,
      "description": "Filter by languages.\nAccepts various language formats: 'french', 'FR', 'romanian', 'ro', 'english', 'en', etc.\nExample: `?languages=en&languages=fr`\n\n",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Pagination limit (max 250). Controls the number of ads returned per request.",
      "schema": {
        "type": "integer",
        "default": 10,
        "maximum": 250
      }
    },
    {
      "name": "live",
      "in": "query",
      "required": false,
      "description": "Filter ads by live status. `true` means currently active ads, `false` means inactive ads. Leave empty to include both.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "market_target",
      "in": "query",
      "required": false,
      "description": "Filter by market target.\nAvailable targets: b2b (business-to-business), b2c (business-to-consumer)\nExample: `?market_target=b2b`\n\n",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "niches",
      "in": "query",
      "required": false,
      "description": "Filter by one or more niches.\nAvailable niches: accessories, app/software, beauty, business/professional, education, entertainment, fashion, food/drink, health/wellness, home/garden, jewelry/watches, other, parenting, pets, real estate, service business, medical, charity/nfp, kids/baby\nExample: `?niches=travel&niches=fashion`\n\n",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "order",
      "in": "query",
      "required": false,
      "description": "Order of results: 'newest' (default), 'oldest', 'longest_running', or 'most_relevant'. Sorts ads by creation date, longest running duration, or relevance to the search query.",
      "schema": {
        "type": "string",
        "default": "newest",
        "enum": [
          "newest",
          "oldest",
          "longest_running",
          "most_relevant"
        ]
      }
    },
    {
      "name": "publisher_platform",
      "in": "query",
      "required": false,
      "description": "Filter by one or more publisher platforms.\nAvailable platforms: facebook, instagram, audience_network, messenger, tiktok, youtube, linkedin, threads, whatsapp\nExample: `?publisher_platform=facebook&publisher_platform=instagram`\n\n",
      "schema": {
        "type": "string",
        "enum": [
          "facebook",
          "instagram",
          "audience_network",
          "messenger",
          "tiktok",
          "youtube",
          "linkedin",
          "threads",
          "whatsapp"
        ]
      }
    },
    {
      "name": "query",
      "in": "query",
      "required": false,
      "description": "Search text for ad name or description. Leave empty to search all ads with filters only.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "running_duration_max_days",
      "in": "query",
      "required": false,
      "description": "Filter ads by maximum running duration in days. Must be a positive integer.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "running_duration_min_days",
      "in": "query",
      "required": false,
      "description": "Filter ads by minimum running duration in days. Must be a positive integer.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "start_date",
      "in": "query",
      "required": false,
      "description": "Start date (inclusive). Format: 'YYYY-MM-DD', 'YYYY-MM-DDTHH:MM:SS', or 'YYYY-MM-DD HH:MM:SS'. If you provide only the date (e.g. '2024-11-12'), it will be interpreted as '2024-11-12 00:00:00'. To get all ads from a specific day, set end_date to 'YYYY-MM-DD 23:59:59' or to the next day at '00:00:00'. Examples: start_date=2024-11-12 00:00:00, end_date=2024-11-12 23:59:59.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "video_duration_max",
      "in": "query",
      "required": false,
      "description": "Filter ads by maximum video duration in seconds. Only applies to video ads.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "video_duration_min",
      "in": "query",
      "required": false,
      "description": "Filter ads by minimum video duration in seconds. Only applies to video ads.",
      "schema": {
        "type": "string"
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "x-aisa-status": "enabled",
  "x-aisa-pricing": {
    "cost_contract": "response_count",
    "customer_multiplier": 1.0,
    "customer_pricing": "provider_cost_multiplier",
    "default_request_estimate_usd": 0.875,
    "estimate_source": "profile_seed",
    "evidence_source": "response_body",
    "maximum_units": 50,
    "unit": "provider_credit",
    "unit_rate_usd": 0.0
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```

## Cost and request rules

Usage-based billing; Default request estimate: \$0.875 USD (not a fixed price). Declared unit rate: \$0 USD per provider\_credit. Account-specific pricing and final settlement may differ.

Published reference values are not an account-specific quote or a settled charge. For endpoints supporting X-AISA-Cost-Mode: quote, obtain a free quote for your exact request before execution; reconcile the settled cost with response metadata and Usage Logs. USD amounts use 1,000,000 integer micro-USD per dollar.

* **Default request reference estimate (USD):** 0.875
* **Declared unit rate (USD):** 0.0
* **Billing unit:** provider\_credit
* **Cost contract:** response\_count
* **Published reference multiplier:** 1.0
* **Declared maximum count/units:** 50
* **Settlement evidence source:** response\_body


## OpenAPI

````yaml reference-contracts/foreplay.json GET /apis/v1/foreplay/discovery/ads
openapi: 3.1.0
info:
  description: ''
  title: foreplay
  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-configured-paths:
    - /apis/v1/foreplay/brand/analytics
    - /apis/v1/foreplay/brand/getAdsByBrandId
    - /apis/v1/foreplay/brand/getBrandsByDomain
    - /apis/v1/foreplay/discovery/ads
  x-aisa-document:
    facts_hash: 799c2645862e25f3076e45d5e7d545772f57444689dd138cd88f92c37554b81c
    generator_version: '3'
    protocol_version: '1'
    schema_version: '1'
    composer_version: '27'
    response_pending: []
    document_hash: sha256:dd3cfc311bf0758a900c4133701868bd33a3fd386684a64c6924ea1bfadbe96d
  x-aisa-plans:
    builder: 1
    display_plan: payg
    payg: 1
    similarweb_payg: 1
    team: 1
    version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-provider: foreplay
  x-aisa-catalogs:
    foreplay:
      title: foreplay
      description: ''
      x-aisa-document:
        facts_hash: 799c2645862e25f3076e45d5e7d545772f57444689dd138cd88f92c37554b81c
        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-capabilities:
        idempotency: Idempotency-Key
        max_price: X-AISA-Max-Price-USD
        quote:
          header: X-AISA-Cost-Mode
          value: quote
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
paths:
  /apis/v1/foreplay/discovery/ads:
    get:
      tags:
        - foreplay
      summary: Discovery Ads
      description: >-
        Search across the Foreplay ad index (100M+ ads) with a text query plus
        filters. Each result in `data[]` is a full ad object (image/video URLs,
        transcription, brand metadata, targeting, and more).

         empty results and 4xx/5xx errors are not charged.

        <!-- aisa-pricing:start -->

        Usage-based billing; Default request estimate: $0.875 USD (not a fixed
        price). Declared unit rate: $0 USD per provider_credit. Account-specific
        pricing and final settlement may differ.

        <!-- aisa-pricing:end -->
      operationId: search_discovery_ads
      parameters:
        - name: cursor
          in: query
          required: false
          description: >-
            Cursor for pagination. Use the cursor value from the previous
            response's metadata to get the next page of results.
          schema:
            type: string
        - name: display_format
          in: query
          required: false
          description: >+
            Filter by one or more display formats.

            Available formats (11): carousel, dco, dpa, event, image,
            multi_images, multi_medias, multi_videos, page_like, text, video

            Example: `?display_format=video&display_format=carousel`

          schema:
            type: string
            enum:
              - carousel
              - dco
              - dpa
              - event
              - image
              - multi_images
              - multi_medias
              - multi_videos
              - page_like
              - text
              - video
        - name: end_date
          in: query
          required: false
          description: >-
            End date (inclusive). Format: 'YYYY-MM-DD', 'YYYY-MM-DDTHH:MM:SS',
            or 'YYYY-MM-DD HH:MM:SS'. If you provide only the date (e.g.
            '2024-11-12'), it will be interpreted as '2024-11-12 00:00:00'. To
            include all results for a given day, set end_date to 'YYYY-MM-DD
            23:59:59' or to the next day at '00:00:00'. Examples:
            start_date=2024-11-12 00:00:00, end_date=2024-11-12 23:59:59.
          schema:
            type: string
        - name: languages
          in: query
          required: false
          description: >+
            Filter by languages.

            Accepts various language formats: 'french', 'FR', 'romanian', 'ro',
            'english', 'en', etc.

            Example: `?languages=en&languages=fr`

          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: >-
            Pagination limit (max 250). Controls the number of ads returned per
            request.
          schema:
            type: integer
            default: 10
            maximum: 250
        - name: live
          in: query
          required: false
          description: >-
            Filter ads by live status. `true` means currently active ads,
            `false` means inactive ads. Leave empty to include both.
          schema:
            type: string
        - name: market_target
          in: query
          required: false
          description: >+
            Filter by market target.

            Available targets: b2b (business-to-business), b2c
            (business-to-consumer)

            Example: `?market_target=b2b`

          schema:
            type: string
        - name: niches
          in: query
          required: false
          description: >+
            Filter by one or more niches.

            Available niches: accessories, app/software, beauty,
            business/professional, education, entertainment, fashion,
            food/drink, health/wellness, home/garden, jewelry/watches, other,
            parenting, pets, real estate, service business, medical,
            charity/nfp, kids/baby

            Example: `?niches=travel&niches=fashion`

          schema:
            type: string
        - name: order
          in: query
          required: false
          description: >-
            Order of results: 'newest' (default), 'oldest', 'longest_running',
            or 'most_relevant'. Sorts ads by creation date, longest running
            duration, or relevance to the search query.
          schema:
            type: string
            default: newest
            enum:
              - newest
              - oldest
              - longest_running
              - most_relevant
        - name: publisher_platform
          in: query
          required: false
          description: >+
            Filter by one or more publisher platforms.

            Available platforms: facebook, instagram, audience_network,
            messenger, tiktok, youtube, linkedin, threads, whatsapp

            Example: `?publisher_platform=facebook&publisher_platform=instagram`

          schema:
            type: string
            enum:
              - facebook
              - instagram
              - audience_network
              - messenger
              - tiktok
              - youtube
              - linkedin
              - threads
              - whatsapp
        - name: query
          in: query
          required: false
          description: >-
            Search text for ad name or description. Leave empty to search all
            ads with filters only.
          schema:
            type: string
        - name: running_duration_max_days
          in: query
          required: false
          description: >-
            Filter ads by maximum running duration in days. Must be a positive
            integer.
          schema:
            type: string
        - name: running_duration_min_days
          in: query
          required: false
          description: >-
            Filter ads by minimum running duration in days. Must be a positive
            integer.
          schema:
            type: string
        - name: start_date
          in: query
          required: false
          description: >-
            Start date (inclusive). Format: 'YYYY-MM-DD', 'YYYY-MM-DDTHH:MM:SS',
            or 'YYYY-MM-DD HH:MM:SS'. If you provide only the date (e.g.
            '2024-11-12'), it will be interpreted as '2024-11-12 00:00:00'. To
            get all ads from a specific day, set end_date to 'YYYY-MM-DD
            23:59:59' or to the next day at '00:00:00'. Examples:
            start_date=2024-11-12 00:00:00, end_date=2024-11-12 23:59:59.
          schema:
            type: string
        - name: video_duration_max
          in: query
          required: false
          description: >-
            Filter ads by maximum video duration in seconds. Only applies to
            video ads.
          schema:
            type: string
        - name: video_duration_min
          in: query
          required: false
          description: >-
            Filter ads by minimum video duration in seconds. Only applies to
            video ads.
          schema:
            type: string
      responses:
        '200':
          description: >-
            JSON envelope with `metadata` and a `data[]` array of ad objects.
            Each ad in `data[]` counts as one billed item.
          content:
            application/json:
              schema:
                type: object
              example:
                metadata:
                  success: true
                  status_code: 200
                  count: 1
                  cursor: null
                data:
                  - id: abc123
                    brand_id: bYeKOahyGopmGKMHiWit
                    brand_name: Nike
                    display_format: video
                    publisher_platform: facebook
                    live: true
                error: null
        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.