Skip to main content

Meta Ads Library API

Search the Meta Ad Library: ads by keyword or advertiser, advertiser page details, archived ad details and supported countries.

Base URL https://api.socialapis.io. Every call needs your API key in the x-api-token header.

List Ad Countries​

Get list of supported country codes for Meta Ads Library filtering.

Endpoint​

GET /facebook/ads/countries

Parameters​

None.

Pricing​

Per call: 1 credit.

Example Request​

curl --request GET \
--url 'https://api.socialapis.io/facebook/ads/countries' \
--header 'x-api-token: YOUR_API_KEY'

Search Ads​

Search ads in the Meta Ad Library by keyword or page ID with filters.

Endpoint​

GET /facebook/ads/search

Parameters​

NameTypeRequiredDefaultDescription
querystringNo—Search keyword for ads
ad_page_idstringNo—Facebook AD Page ID. Used only if query is not provided.
countrystringNo—ISO country code or ALL
activeStatusstringNo—Filter by ad status: ALL, Active, or Inactive
after_timestringNo—Filter ads after this date (YYYY-MM-DD)
before_timestringNo—Filter ads before this date (YYYY-MM-DD)
sort_datastringNo—Sort: impressions (high to low) or recent (most recent)
end_cursorstringNo—Pagination cursor

Pricing​

Per call: 1 credit.

Example Request​

curl --request GET \
--url 'https://api.socialapis.io/facebook/ads/search' \
--header 'x-api-token: YOUR_API_KEY'

Get Advertiser Page Details​

Get detailed info about a specific Facebook page from the Ads Library.

Endpoint​

GET /facebook/ads/page-details

Parameters​

NameTypeRequiredDefaultDescription
page_idstringYes—Facebook Page ID

Pricing​

Per call: 1 credit.

Example Request​

curl --request GET \
--url 'https://api.socialapis.io/facebook/ads/page-details?page_id=YOUR_PAGE_ID' \
--header 'x-api-token: YOUR_API_KEY'

Get Ad Archive Details​

Get detailed info about a specific archived ad by archive ID.

Endpoint​

GET /facebook/ads/archive-details

Parameters​

NameTypeRequiredDefaultDescription
ad_archive_idstringYes—Ad Archive ID
page_idstringNo—Facebook Page ID
countrystringNo—ISO country code or ALL
is_ad_non_politicalbooleanNo—Filter non-political ads
is_ad_not_aaa_eligiblebooleanNo—Filter AAA eligibility

Pricing​

Per call: 1 credit.

Example Request​

curl --request GET \
--url 'https://api.socialapis.io/facebook/ads/archive-details?ad_archive_id=YOUR_AD_ARCHIVE_ID' \
--header 'x-api-token: YOUR_API_KEY'

Find Advertisers by Keyword​

Search for ads by keyword with optional country filter.

Endpoint​

GET /facebook/ads/keywords

Parameters​

NameTypeRequiredDefaultDescription
querystringYes—Search keyword
countrystringNo—ISO country code or ALL

Pricing​

Per call: 1 credit.

Example Request​

curl --request GET \
--url 'https://api.socialapis.io/facebook/ads/keywords?query=coffee' \
--header 'x-api-token: YOUR_API_KEY'

Verifying what you were charged​

Every paid response carries an X-SocialAPIs-Credits-Deducted header with the exact credit amount charged for that request. Variable-priced endpoints (page and group posts, media download) report the resolved amount here, so you can reconcile usage without checking the dashboard. Prices on this page come from the live endpoint catalog when the docs were built; socialapis.io/openapi.json always has the current ones.