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

# Meta Ad Library

> Search the public Meta Ad Library: ads running on Facebook, Instagram and other Meta apps by keyword or page, including political and issue ads.

![](https://mintcdn.com/webrouter/JBFYvcRI1PVnd4YX/logo/data-apis/meta-ad-library.webp?fit=max\&auto=format\&n=JBFYvcRI1PVnd4YX\&q=85\&s=42735db0f8992900ebcc224cb64c325f)

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

Needs&#x20;

`META_AD_LIBRARY_ACCESS_TOKEN`

Endpoints

1

Auth

Key in query

[Vendor docs](https://www.facebook.com/ads/library/api/)

## Setup

| Variable | | What it is |
| - | - | - |
| `META_AD_LIBRARY_ACCESS_TOKEN` | required | a Meta access token for an app whose developer has been identity-verified for the Ad Library API ([https://www.facebook.com/ID](https://www.facebook.com/ID)) |
| `META_AD_LIBRARY_API_VERSION` | optional | Graph API version used for ads\_archive. Default `v27.0`. One of `v25.0`, `v26.0`, `v27.0`. |

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

## Notes

* Public data, not your own account: any ad in the library, subject to Meta's coverage.
* Ads outside the EU are only returned when they concern social issues, elections or politics; commercial ads are searchable for the EU and UK.
* Keywords are not translated: write search\_terms in the ads' language.
* Error 190 is an invalid token, 613 a rate limit.

## Endpoints

GET

Search the Meta Ad Library

Ads by keyword or Page, filtered by country, status, date, platform and media type.

[Open](#meta-ad-library-ads-search)

### Search the Meta Ad Library

GET

`/ads_archive`

`meta-ad-library.ads.search`

Ads by keyword or Page, filtered by country, status, date, platform and media type.

Input

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

      <th>
        Type
      </th>

      <th>
        In
      </th>

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

  <tbody>
    <tr><td>`ad_type` required</td><td>string</td><td>query</td><td>Ad category. Required. One of `ALL`, `EMPLOYMENT_ADS`, `FINANCIAL_PRODUCTS_AND_SERVICES_ADS`, `HOUSING_ADS`, `POLITICAL_AND_ISSUE_ADS` Example `ALL`</td></tr>
    <tr><td>`ad_reached_countries` required</td><td>string</td><td>query</td><td>JSON array of ISO country codes the ad reached, e.g. \["US","GB"], or \["ALL"]. Example `["US"]`</td></tr>

    <tr>
      <td>
        `search_terms`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Keywords, up to 100 characters. Spaces act as AND.
      </td>
    </tr>

    <tr><td>`search_type`</td><td>string</td><td>query</td><td>How search\_terms match. One of `KEYWORD_UNORDERED`, `KEYWORD_EXACT_PHRASE`</td></tr>

    <tr>
      <td>
        `search_page_ids`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        JSON array of Facebook Page ids, up to 10, e.g. \["123","456"].
      </td>
    </tr>

    <tr><td>`ad_active_status`</td><td>string</td><td>query</td><td>Delivery status; default ACTIVE. One of `ACTIVE`, `ALL`, `INACTIVE`</td></tr>

    <tr>
      <td>
        `ad_delivery_date_min`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        YYYY-MM-DD; ads delivered on or after.
      </td>
    </tr>

    <tr>
      <td>
        `ad_delivery_date_max`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        YYYY-MM-DD; ads delivered on or before.
      </td>
    </tr>

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

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        JSON array of ISO 639-1 codes (plus CMN, YUE), e.g. \["en","es"].
      </td>
    </tr>

    <tr><td>`media_type`</td><td>string</td><td>query</td><td>Filter by media. One of `ALL`, `IMAGE`, `MEME`, `VIDEO`, `NONE`</td></tr>

    <tr>
      <td>
        `publisher_platforms`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        JSON array of FACEBOOK, INSTAGRAM, AUDIENCE\_NETWORK, MESSENGER, WHATSAPP, OCULUS, THREADS, STREAMING\_SERVICES.
      </td>
    </tr>

    <tr>
      <td>
        `bylines`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        JSON array of full 'paid for by' disclaimers. Political ads only.
      </td>
    </tr>

    <tr>
      <td>
        `unmask_removed_content`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Include content removed for policy violations.
      </td>
    </tr>

    <tr><td>`fields`</td><td>string</td><td>query</td><td>Comma-separated ArchivedAd fields to return. Example `id,ad_creation_time,ad_creative_bodies,page_name,ad_snapshot_url`</td></tr>

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

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page size.
      </td>
    </tr>

    <tr>
      <td>
        `after`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        paging.cursors.after from the previous answer.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.facebook.com/docs/graph-api/reference/ads_archive/) · Same job: [Adyntel](https://docs.webrouter.net/data-apis/adyntel.md#adyntel-meta-ads), [Foreplay](https://docs.webrouter.net/data-apis/foreplay.md#foreplay-ads-search), [Litescrape](https://docs.webrouter.net/data-apis/litescrape.md#litescrape-google-ads), [Upspring](https://docs.webrouter.net/data-apis/upspring.md#upspring-ads-search)

```python Python theme={null}
router.call_data_api("meta-ad-library.ads.search", {'ad_type': 'ALL', 'ad_reached_countries': '["US"]', 'fields': 'id,ad_creation_time,ad_creative_bodies,page_name,ad_snapshot_url'})
```

```text MCP theme={null}
call_data_api(endpoint="meta-ad-library.ads.search", params={"ad_type": "ALL", "ad_reached_countries": "[\"US\"]", "fields": "id,ad_creation_time,ad_creative_bodies,page_name,ad_snapshot_url"})
```

> [!NOTE]
>
> * Pass fields explicitly: the answer carries only the ids unless you name the fields you want.
> * An empty data array on a later page means the results are exhausted.
> * Spend and impressions are ranges, and only available for political and issue ads and for EU-served ads.


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