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

# Foreplay

> Search a library of Meta, TikTok and other platform ads and brands: creatives, transcripts, brand lookups by name or domain, and running-ad analytics.

![](https://mintcdn.com/webrouter/gPu3tCeozwRcDBjt/logo/data-apis/foreplay.webp?fit=max\&auto=format\&n=gPu3tCeozwRcDBjt\&q=85\&s=33113c908b37928c105c809291e48ddb)

[Web Catalog · Advertising](https://docs.webrouter.net/data-apis.md?category=advertising)

Needs&#x20;

`FOREPLAY_API_KEY`

Endpoints

7

Auth

Key in header

[Vendor docs](https://public.api.foreplay.co/docs)

&#x20;·&#x20;

[Pricing](https://www.foreplay.co/pricing)

## Setup

| Variable | | What it is |
| - | - | - |
| `FOREPLAY_API_KEY` | required | A Foreplay API key (app.foreplay.co > API overview). |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Credits: 1 per ad returned on ad endpoints (a page of 250 ads costs 250), 1 per call on brand endpoints whatever the count; empty and error responses are free; usage is free. X-Credits-Remaining is on every response.
* Ad lists page by cursor: pass metadata.cursor from the previous response.
* Each ad carries foreplay\_url, the link to view it in Foreplay.
* Swipe file, boards and Spyder (your own saved and tracked brands) are not in this entry.

## Endpoints

GET

Search ads

Search the whole ad index by text and filters; each ad has media URLs, transcript, brand and targeting.

[Open](#foreplay-ads-search)

GET

Get an ad

One ad by its Foreplay id.

[Open](#foreplay-ads-get)

GET

Search brands by name

Brands matching a name, with total and active ad counts.

[Open](#foreplay-brands-search)

GET

Find brands by domain

Brands that advertise from a website domain.

[Open](#foreplay-brands-by-domain)

GET

Get ads by brand

Ads of one or more brands, with the same filters as search.

[Open](#foreplay-brands-ads)

GET

Get brand analytics

Daily rows of a brand's running-ad distribution and creative velocity.

[Open](#foreplay-brands-analytics)

GET

Get credit usage

Remaining and total credits and the billing-cycle window.

[Open](#foreplay-usage)

### Search ads

GET

`/api/discovery/ads`

`foreplay.ads.search`

Search the whole ad index by text and filters; each ad has media URLs, transcript, brand and targeting.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`query`</td><td>string</td><td>query</td><td>Text to match in ad name or description; empty searches with filters only. Example `protein powder`</td></tr>

    <tr>
      <td>
        `start_date`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Inclusive start, UTC: YYYY-MM-DD or YYYY-MM-DD HH:MM:SS (a bare date means 00:00:00).
      </td>
    </tr>

    <tr>
      <td>
        `end_date`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Inclusive end, UTC; use YYYY-MM-DD 23:59:59 to cover a whole day.
      </td>
    </tr>

    <tr><td>`live`</td><td>string</td><td>query</td><td>true for running ads, false for stopped; omit for both. One of `true`, `false`</td></tr>

    <tr>
      <td>
        `display_format`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Formats: video, carousel, image, dco, dpa, multi\_images, multi\_videos, multi\_medias, event, text, page\_like.
      </td>
    </tr>

    <tr>
      <td>
        `publisher_platform`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Platforms: facebook, instagram, audience\_network, messenger, tiktok, youtube, linkedin, threads, whatsapp.
      </td>
    </tr>

    <tr>
      <td>
        `niches`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Niches, e.g. beauty, fashion, food/drink, health/wellness.
      </td>
    </tr>

    <tr>
      <td>
        `market_target`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        b2b or b2c.
      </td>
    </tr>

    <tr>
      <td>
        `languages`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Languages, as names or codes (en, french).
      </td>
    </tr>

    <tr>
      <td>
        `video_duration_min`
      </td>

      <td>
        number
      </td>

      <td>
        query
      </td>

      <td>
        Minimum video length, seconds.
      </td>
    </tr>

    <tr>
      <td>
        `video_duration_max`
      </td>

      <td>
        number
      </td>

      <td>
        query
      </td>

      <td>
        Maximum video length, seconds.
      </td>
    </tr>

    <tr>
      <td>
        `running_duration_min_days`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Minimum days the ad has run.
      </td>
    </tr>

    <tr>
      <td>
        `running_duration_max_days`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Maximum days the ad has run.
      </td>
    </tr>

    <tr><td>`order`</td><td>string</td><td>query</td><td>Sort order, default newest. One of `newest`, `oldest`, `longest_running`, `most_relevant`</td></tr>

    <tr>
      <td>
        `cursor`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        metadata.cursor from the previous page.
      </td>
    </tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Ads per page, 1 to 250, default 10.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://public.api.foreplay.co/docs) · Same job: [Adyntel](https://docs.webrouter.net/data-apis/adyntel.md#adyntel-meta-ads), [Litescrape](https://docs.webrouter.net/data-apis/litescrape.md#litescrape-google-ads), [Meta Ad Library](https://docs.webrouter.net/data-apis/meta-ad-library.md#meta-ad-library-ads-search), [Upspring](https://docs.webrouter.net/data-apis/upspring.md#upspring-ads-search)

```python Python theme={null}
router.call_data_api("foreplay.ads.search", {'query': 'protein powder'})
```

```text MCP theme={null}
call_data_api(endpoint="foreplay.ads.search", params={"query": "protein powder"})
```

> [!NOTE]
>
> * 1 credit per ad returned.

### Get an ad

GET

`/api/ad/{ad_id}`

`foreplay.ads.get`

One ad by its Foreplay id.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `ad_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        Foreplay ad id.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://public.api.foreplay.co/docs) · Same job: [Adyntel](https://docs.webrouter.net/data-apis/adyntel.md#adyntel-tiktok-ad-details), [Upspring](https://docs.webrouter.net/data-apis/upspring.md#upspring-ads-get)

> [!NOTE]
>
> * 1 credit per successful lookup.

### Search brands by name

GET

`/api/discovery/brands`

`foreplay.brands.search`

Brands matching a name, with total and active ad counts.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`query` required</td><td>string</td><td>query</td><td>Brand name to search. Example `Nike`</td></tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Brands per call, 1 to 100, default 10.
      </td>
    </tr>

    <tr>
      <td>
        `include_empty`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Include brands with no indexed ads (hidden by default).
      </td>
    </tr>

    <tr>
      <td>
        `min_ads`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Only brands with at least this many ads.
      </td>
    </tr>

    <tr>
      <td>
        `max_ads`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Only brands with at most this many ads.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://public.api.foreplay.co/docs) · Same job: [Upspring](https://docs.webrouter.net/data-apis/upspring.md#upspring-advertisers-search)

```python Python theme={null}
router.call_data_api("foreplay.brands.search", {'query': 'Nike'})
```

```text MCP theme={null}
call_data_api(endpoint="foreplay.brands.search", params={"query": "Nike"})
```

> [!NOTE]
>
> * 1 credit per call. Ad-count filters apply after ranking, so fewer than limit may come back.

### Find brands by domain

GET

`/api/brand/getBrandsByDomain`

`foreplay.brands.by_domain`

Brands that advertise from a website domain.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`domain` required</td><td>string</td><td>query</td><td>Domain or full URL. Example `example.com`</td></tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Brands per call, 1 to 10, default 10.
      </td>
    </tr>

    <tr><td>`order`</td><td>string</td><td>query</td><td>Default most\_ranked. One of `most_ranked`, `least_ranked`</td></tr>
  </tbody>
</table>

[Vendor docs](https://public.api.foreplay.co/docs) · Same job: [Upspring](https://docs.webrouter.net/data-apis/upspring.md#upspring-advertisers-search)

```python Python theme={null}
router.call_data_api("foreplay.brands.by_domain", {'domain': 'example.com'})
```

```text MCP theme={null}
call_data_api(endpoint="foreplay.brands.by_domain", params={"domain": "example.com"})
```

> [!NOTE]
>
> * 1 credit per call.

### Get ads by brand

GET

`/api/brand/getAdsByBrandId`

`foreplay.brands.ads`

Ads of one or more brands, with the same filters as search.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `brand_ids`

        required
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        One or more Foreplay brand ids (from foreplay.brands.search).
      </td>
    </tr>

    <tr>
      <td>
        `start_date`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Inclusive start, UTC: YYYY-MM-DD or YYYY-MM-DD HH:MM:SS (a bare date means 00:00:00).
      </td>
    </tr>

    <tr>
      <td>
        `end_date`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Inclusive end, UTC; use YYYY-MM-DD 23:59:59 to cover a whole day.
      </td>
    </tr>

    <tr><td>`live`</td><td>string</td><td>query</td><td>true for running ads, false for stopped; omit for both. One of `true`, `false`</td></tr>

    <tr>
      <td>
        `display_format`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Formats: video, carousel, image, dco, dpa, multi\_images, multi\_videos, multi\_medias, event, text, page\_like.
      </td>
    </tr>

    <tr>
      <td>
        `publisher_platform`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Platforms: facebook, instagram, audience\_network, messenger, tiktok, youtube, linkedin, threads, whatsapp.
      </td>
    </tr>

    <tr>
      <td>
        `niches`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Niches, e.g. beauty, fashion, food/drink, health/wellness.
      </td>
    </tr>

    <tr>
      <td>
        `market_target`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        b2b or b2c.
      </td>
    </tr>

    <tr>
      <td>
        `languages`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Languages, as names or codes (en, french).
      </td>
    </tr>

    <tr>
      <td>
        `video_duration_min`
      </td>

      <td>
        number
      </td>

      <td>
        query
      </td>

      <td>
        Minimum video length, seconds.
      </td>
    </tr>

    <tr>
      <td>
        `video_duration_max`
      </td>

      <td>
        number
      </td>

      <td>
        query
      </td>

      <td>
        Maximum video length, seconds.
      </td>
    </tr>

    <tr>
      <td>
        `running_duration_min_days`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Minimum days the ad has run.
      </td>
    </tr>

    <tr>
      <td>
        `running_duration_max_days`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Maximum days the ad has run.
      </td>
    </tr>

    <tr><td>`order`</td><td>string</td><td>query</td><td>Sort order, default newest. One of `newest`, `oldest`, `longest_running`, `most_relevant`</td></tr>

    <tr>
      <td>
        `cursor`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        metadata.cursor from the previous page.
      </td>
    </tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Ads per page, 1 to 250, default 10.
      </td>
    </tr>

    <tr>
      <td>
        `collect`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        When nothing is cached, fetch live from Meta and wait about 30 seconds.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://public.api.foreplay.co/docs) · Same job: [Adyntel](https://docs.webrouter.net/data-apis/adyntel.md#adyntel-meta-ads), [Litescrape](https://docs.webrouter.net/data-apis/litescrape.md#litescrape-google-ads), [Meta Ad Library](https://docs.webrouter.net/data-apis/meta-ad-library.md#meta-ad-library-ads-search), [Upspring](https://docs.webrouter.net/data-apis/upspring.md#upspring-ads-search)

> [!NOTE]
>
> * 1 credit per ad returned. collect=true is a best-effort fallback and may still return nothing.

### Get brand analytics

GET

`/api/brand/analytics`

`foreplay.brands.analytics`

Daily rows of a brand's running-ad distribution and creative velocity.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Brand id (20-25 mixed-case characters) or numeric Facebook page id.
      </td>
    </tr>

    <tr>
      <td>
        `start_date`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Inclusive start, YYYY-MM-DD.
      </td>
    </tr>

    <tr>
      <td>
        `end_date`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Inclusive end, YYYY-MM-DD.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://public.api.foreplay.co/docs)

> [!NOTE]
>
> * 1 credit per call. Today's row is computed live from the latest collected data.

### Get credit usage

GET

`/api/usage`

`foreplay.usage`

Remaining and total credits and the billing-cycle window.

Input

No inputs.

[Vendor docs](https://public.api.foreplay.co/docs)

```python Python theme={null}
router.call_data_api("foreplay.usage")
```

```text MCP theme={null}
call_data_api(endpoint="foreplay.usage")
```

> [!NOTE]
>
> * Free.


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