APIs / Facebook Ad Library / Search

Facebook Ad Library: Search

Search from Facebook Ad Library as JSON. 1 credit per successful call.

GET /v1/facebook-ad-library/searchNeeds terms

Note
This endpoint needs the restricted-endpoint terms, which you can accept in your dashboard.

Parameters

Send parameters in the query string.

Required Send query or page_id.

ParameterTypeRequiredAllowed values
querystringOptionalUp to 500 characters
page_idstringOptionalUp to 30 characters
countrystringOptionalUp to 2 characters
ad_typestringOptionalALL, POLITICAL_AND_ISSUE_ADS, CREDIT_ADS, FINANCIAL_PRODUCTS_AND_SERVICES_ADS, EMPLOYMENT_ADS, HOUSING_ADS, UNCATEGORIZED_ADS
media_typestringOptionalALL, IMAGE, MEME, IMAGE_AND_MEME, VIDEO, NONE
active_statusstringOptionalALL, ACTIVE, INACTIVE
publisher_platforms[]list of stringOptionalfacebook, instagram, audience_network, messenger, threads
start_dateintegerOptionalAny
search_typestringOptionalkeyword_unordered, keyword_exact_phrase
cursorstringOptionalUp to 8,192 characters
sort_data[mode]stringOptionalAny
sort_data[direction]stringOptionalAny
sort_datastringOptionalAny

Example request

cURLshell
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"

Run this endpoint in the playground with your own parameters. 1 credit per successful call; failed calls are free.

Response fields

The response has these 5 fields, read from a recorded call. The recording leaves out fields that were empty, so a live call can return more.

FieldType
search_parametersobject
adsobject[]
ads_countinteger
paginationobject
response_time_msinteger