# Meta Ads Library API

> Search public Facebook and Instagram ads, advertiser Pages, creatives, and delivery metadata.

Access structured public data from the Meta Ads Library. Search Facebook and Instagram ads by keyword or advertiser, resolve advertiser Page IDs, inspect public ad creatives and transparency fields, filter by country, status, date, language, platform, and media type, paginate through results, or run asynchronous collection jobs.

- Provider: CAVSN Data, operated by CAVSN DATA LLC.
- Category: Web Scraping.
- Catalog status: live.
- [Interactive documentation](https://cavsndata.com/apis/meta-ads-library-api)
- [OpenAPI specification](https://cavsndata.com/api/openapi/meta-ads-library-api)
- [Current plans and pricing](https://cavsndata.com/pricing)
- [Purchase access or credits](https://cavsndata.com/purchase?api=meta-ads-library-api)

## Authentication and access

Base URL: ` https://cavsndata.com/gateway/meta-ads-library-api `

Create an account and API key, and activate a plan for this API. Send the key in the X-API-Key header or as an Authorization: Bearer token. Each API has its own plan and quota. The per-key gateway rate limit is 300 requests per second across the catalog; a plan's request allowance is separate.

Paid plans and credits are purchased through direct contact and activated after payment confirmation. See the purchase page for current options.

See the [gateway guide](https://cavsndata.com/docs) for authentication, response headers, errors, and quotas.

## Features

- Keyword ad search
- Advertiser Page lookup
- Ad creative details
- Country and media filters
- Cursor pagination
- Asynchronous collection jobs

## Endpoint reference (12)

Append each endpoint path below to the base URL, use its HTTP method, replace path placeholders, and supply its required parameters. Authentication values are not included in this reference.

### GET ` /v1/meta/resolve-url `

Resolve Meta Ads URL

Parses a public Meta Ad Library URL into an operation and reusable parameters without scraping ads.

- ` url `: query parameter; string; required. A public Facebook Ad Library search or advertiser URL.

### GET ` /v1/meta/search `

Search Ads

Searches public Facebook and Instagram ads by keyword or advertiser name.

- ` q `: query parameter; string; required. Search keyword, phrase, or advertiser name.
- ` country `: query parameter; string; optional.
- ` active_status `: query parameter; string; optional.
- ` ad_type `: query parameter; string; optional.
- ` search_type `: query parameter; string; optional.
- ` media_type `: query parameter; string; optional.
- ` sort_mode `: query parameter; string; optional. Sort by total impressions when Meta supports it for the selected ad category.
- ` sort_direction `: query parameter; string; optional. Sort direction used with sort_mode.
- ` cursor `: query parameter; string; optional. Cursor returned in data.pageInfo.cursor by the preceding page.
- ` page_size `: query parameter; number; optional.
- ` date_min `: query parameter; string; optional.
- ` date_max `: query parameter; string; optional.
- ` content_languages `: query parameter; string; optional. Comma-separated ISO 639-1 language codes.
- ` publisher_platforms `: query parameter; string; optional. Comma-separated platforms such as FACEBOOK and INSTAGRAM.
- ` page_ids `: query parameter; string; optional. Comma-separated advertiser Page IDs.
- ` is_targeted_country `: query parameter; boolean; optional.
- ` potential_reach_min `: query parameter; number; optional.
- ` potential_reach_max `: query parameter; number; optional.

### GET ` /v1/meta/ad-details `

Get Ad Details

Returns one public ad, its creative, advertiser metadata, and transparency fields when available.

- ` ad_archive_id `: query parameter; string; required.
- ` page_id `: query parameter; string; required.
- ` country `: query parameter; string; optional.
- ` raw `: query parameter; boolean; optional.

### GET ` /v1/meta/filter-options `

Get Filter Options

Returns advertiser pages, countries, and other filter values observed for a query.

- ` query_string `: query parameter; string; required.
- ` ad_type `: query parameter; string; optional.
- ` country `: query parameter; string; optional.
- ` search_type `: query parameter; string; optional.
- ` raw `: query parameter; boolean; optional.

### GET ` /v1/meta/page `

Get Page Ads

Lists ads for one advertiser using its numeric Facebook Page ID.

- ` page_id `: query parameter; string; required.
- ` country `: query parameter; string; optional.
- ` active_status `: query parameter; string; optional.
- ` media_type `: query parameter; string; optional.
- ` date_min `: query parameter; string; optional.
- ` date_max `: query parameter; string; optional.
- ` cursor `: query parameter; string; optional. Cursor returned in data.pageInfo.cursor by the preceding page.
- ` page_size `: query parameter; number; optional.
- ` content_languages `: query parameter; string; optional. Comma-separated ISO 639-1 language codes.
- ` publisher_platforms `: query parameter; string; optional. Comma-separated platforms such as FACEBOOK and INSTAGRAM.
- ` raw `: query parameter; boolean; optional.

### GET ` /v1/meta/page-id `

Resolve Page ID

Resolves a Facebook Page URL, username, or numeric value to an Ad Library Page ID.

- ` url `: query parameter; string; required.
- ` country `: query parameter; string; optional.

### GET ` /v1/meta/page-by-url `

Get Page Ads Without ID

Resolves a Facebook Page URL or username and lists that advertiser's ads.

- ` url `: query parameter; string; required.
- ` country `: query parameter; string; optional.
- ` active_status `: query parameter; string; optional.
- ` media_type `: query parameter; string; optional.
- ` date_min `: query parameter; string; optional.
- ` date_max `: query parameter; string; optional.
- ` cursor `: query parameter; string; optional. Cursor returned in data.pageInfo.cursor by the preceding page.
- ` page_size `: query parameter; number; optional.
- ` content_languages `: query parameter; string; optional. Comma-separated ISO 639-1 language codes.
- ` publisher_platforms `: query parameter; string; optional. Comma-separated platforms such as FACEBOOK and INSTAGRAM.
- ` raw `: query parameter; boolean; optional.

### GET ` /v1/meta/search-pages `

Search Pages

Finds advertiser Pages represented in live Meta Ad Library results.

- ` q `: query parameter; string; required. Search keyword, phrase, or advertiser name.
- ` country `: query parameter; string; optional.
- ` ad_type `: query parameter; string; optional.
- ` raw `: query parameter; boolean; optional.

### GET ` /ads `

Quick Search Ads

Searches by keyword, advertiser Page, or copied Ad Library URL and returns ads in one response.

- ` keyword `: query parameter; string; optional.
- ` page `: query parameter; string; optional. Numeric Page ID, Page name, username, or Facebook Page URL.
- ` url `: query parameter; string; optional. A copied Meta Ad Library URL. Its embedded filters take precedence.
- ` country `: query parameter; string; optional.
- ` activeStatus `: query parameter; string; optional.
- ` searchType `: query parameter; string; optional.
- ` minDate `: query parameter; string; optional.
- ` maxDate `: query parameter; string; optional.
- ` limit `: query parameter; number; optional.

### POST ` /jobs `

Start Ads Job

Starts an asynchronous ad collection job and immediately returns its job ID.

- ` body `: body parameter; json; required. JSON request body

### GET ` /jobs/{jobId} `

Get Ads Job

Gets job status. The reserved demo job is always available for testing.

- ` jobId `: path parameter; string; required. A job ID returned by Start Ads Job. Use demo to test this endpoint immediately.
- ` wait `: query parameter; number; optional. Long-poll for up to this many seconds while the job is running.

### GET ` /jobs/{jobId}/results `

Get Ads Job Results

Reads a page of results while a job runs or after it completes.

- ` jobId `: path parameter; string; required. A job ID returned by Start Ads Job. Use demo to test this endpoint immediately.
- ` offset `: query parameter; number; optional.
- ` limit `: query parameter; number; optional.

## Support

Email: support@cavsndata.com. Telegram: https://t.me/hkeydesign. WeChat: cavsndata.
