---
title: "Facebook Ad Library API: ad search as JSON | Perceptlayer"
description: "Facebook Ad Library API for ad search by keyword, page, country and ad type, ad details, advertisers and EU transparency reports as JSON."
url: https://perceptlayer.com/apis/facebook-ad-library
---

[APIs](https://perceptlayer.com/apis) / [Social media](https://perceptlayer.com/verticals/social) / Facebook Ad Library

1 credit per call 5 endpoints 

# Facebook Ad Library API

Facebook Ad Library API for ad search by keyword, page, country and ad type, ad details, advertisers and EU transparency reports as JSON.

[Get a free API key](https://perceptlayer.com/signup) Run it below

Facebook Ad Library

GET /v1/facebook-ad-library/search?query=climate&country=US&ad\_type=POLITICAL\_AND\_ISSUE\_ADS 

```
curl "https://api.perceptlayer.com/v1/facebook-ad-library/search?query=climate&country=US&ad_type=POLITICAL_AND_ISSUE_ADS" \
  -H "X-API-Key: $API_KEY"
```

cURL 1 credit per successful call

Run this call below or from your dashboard to see a live response.

Playground

## Run this API

cURL shell 

```
curl "https://api.perceptlayer.com/v1/facebook-ad-library/search?query=climate&country=US&ad_type=POLITICAL_AND_ISSUE_ADS" \
  -H "X-API-Key: $API_KEY"
```

Facebook Ad Library · 5 endpoints

## Endpoints

Every endpoint takes the same key. Open one for its parameters, the fields it returns and an example request.

Note 

Endpoints marked “Needs terms” return personal or social data. They work once you accept the [restricted-endpoint terms](https://perceptlayer.com/legal/restricted-endpoints) in your dashboard.

| Endpoint | Required parameters | Returns | Cost |
| --- | --- | --- | --- |
| [GET `/v1/facebook-ad-library/ad-details`](https://perceptlayer.com/apis/facebook-ad-library/ad-details) | `ad_archive_id` `page_id` +1 optional Needs terms | `ad_archive_id` `page_id` `advertiser` `uk_transparency` `response_time_ms` | 1 credit |
| [GET `/v1/facebook-ad-library/advertisers`](https://perceptlayer.com/apis/facebook-ad-library/advertisers) | `query` +2 optional Needs terms | `advertisers` `advertisers_count` `response_time_ms` | 1 credit |
| [GET `/v1/facebook-ad-library/eu-report`](https://perceptlayer.com/apis/facebook-ad-library/eu-report) | `section` +2 optional Needs terms | `report_parameters` `section_data` `reach_note` `response_time_ms` | 1 credit |
| [GET `/v1/facebook-ad-library/filters`](https://perceptlayer.com/apis/facebook-ad-library/filters) | none +3 optional Needs terms | `empty_facet_lists` `empty_facet_lists_note` `response_time_ms` | 1 credit |
| [GET `/v1/facebook-ad-library/search`](https://perceptlayer.com/apis/facebook-ad-library/search) | none +13 optional Needs terms | `search_parameters` `ads` `ads_count` `pagination` `response_time_ms` | 1 credit |

Overview

## About the Facebook Ad Library API

## What you can get

The Facebook Ad Library API returns public Ad Library data as JSON through 5 endpoints. All of them are restricted endpoints: the [restricted-endpoint terms](https://perceptlayer.com/legal/restricted-endpoints) apply, and they don't permit collecting personal data without a lawful basis or using it to contact people.

-   **Search:** `search` takes a `query` or `page_id`, with `country`, `ad_type` (ALL, POLITICAL\_AND\_ISSUE\_ADS, CREDIT\_ADS, FINANCIAL\_PRODUCTS\_AND\_SERVICES\_ADS, EMPLOYMENT\_ADS, HOUSING\_ADS or UNCATEGORIZED\_ADS), `media_type`, `active_status` (ALL, ACTIVE or INACTIVE), `publisher_platforms[]`, `start_date` and `cursor`.
-   **Ads:** `ad-details` takes an `ad_archive_id` and `page_id`, with `country`.
-   **Advertisers and filters:** `advertisers` takes a `query`, with `country` and `ad_type`; `filters` takes the same.
-   **EU report:** `eu-report` takes a `section` (overview, searches, campaign-tracker, advertisers, locations or download-availability), with `country` and `time_preset`.

## How a call works

Search ads by keyword: `GET /v1/facebook-ad-library/search?query=climate&country=US&ad_type=POLITICAL_AND_ISSUE_ADS` with your key in the `X-API-Key` header. Search pages with `cursor`. Every successful call costs 1 credit; failed calls cost nothing.

Social media JSON REST MCP Some endpoints need terms

### More social media APIs

[Behance](https://perceptlayer.com/apis/behance) [Bilibili](https://perceptlayer.com/apis/bilibili) [Bluesky](https://perceptlayer.com/apis/bluesky) [Dailymotion](https://perceptlayer.com/apis/dailymotion) [DeviantArt](https://perceptlayer.com/apis/deviantart) [DISBOARD](https://perceptlayer.com/apis/disboard) [Dribbble](https://perceptlayer.com/apis/dribbble) [Facebook](https://perceptlayer.com/apis/facebook) [Flickr](https://perceptlayer.com/apis/flickr) [Hacker News](https://perceptlayer.com/apis/hacker-news) [Imgur](https://perceptlayer.com/apis/imgur) [Instagram](https://perceptlayer.com/apis/instagram)

Use cases

### Review competitors' active ads by keyword and country

`Use the Facebook Ad Library API to review competitors' active ads by keyword and country` 

### Research issue and political ads in a market

`Use the Facebook Ad Library API to research issue and political ads in a market` 

### Track how a brand's ads change over time

`Use the Facebook Ad Library API to track how a brand's ads change over time` 

### Report on ad activity from the EU transparency data

`Use the Facebook Ad Library API to report on ad activity from the EU transparency data` 

FAQ

## Questions

**Do I need a Meta developer app?**

No. You call this Facebook Ad Library API with your Perceptlayer key in the \`X-API-Key\` header, so there's no Meta app to register. You do need to accept the restricted-endpoint terms first.

**How much does the Facebook Ad Library API cost?**

Each successful call costs one credit. New accounts get free credits to start, and credit packs bring the price down as you scale.

**What format are responses in?**

Every endpoint returns JSON, with no HTML parsing on your side.

**Is this the official Facebook Ad Library API?**

No. Perceptlayer is an independent service and is not affiliated with Facebook Ad Library. It returns Facebook Ad Library data as JSON with a Perceptlayer key, so there is no Facebook Ad Library developer account, app review or partner approval to get first. It only reads data: if Facebook Ad Library has an official API and you need to act on your own Facebook Ad Library account, such as posting, managing orders or reading private data, use that one.

**Should I build a Facebook Ad Library scraper instead?**

You can, but a Facebook Ad Library scraper is code you maintain: page changes break it, requests get blocked, and Facebook Ad Library's terms govern how you collect data. The Facebook Ad Library API gives you 5 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first. Some of these endpoints return social or personal data and need the restricted-endpoint terms; collect only what you have a lawful basis for.

## Try the Facebook Ad Library API with 100 free credits

No credit card. Failed calls are never billed.

[Get a free API key](https://perceptlayer.com/signup) [Read the docs](https://docs.perceptlayer.com)
