Social Fetch
Facebook

Search Facebook Ad Library ads

Search Facebook Ad Library ads by keyword.

Operation

GET/v1/facebook/ad-library/ads/search
Cost: 1 credit

Headers

x-api-keystringrequired(header)

API key (`sfk_...`)

Parameters

querystringrequired(query)

Search query text for Facebook Ad Library ads.

min 1 chars · max 4096 chars

sortBystring(query)

Optional sort order for returned ads.

one of: impressions, most-recent

searchTypestring(query)

Optional keyword matching mode for the search query.

one of: keyword-unordered, exact-phrase

adTypestring(query)

Optional filter for all ads or political and issue ads.

one of: all, political-and-issue

countrystring(query)

Optional country code filter. Use ALL to search all countries.

min 2 chars · max 3 chars

statusstring(query)

Optional ad status filter.

one of: all, active, inactive

mediaTypestring(query)

Optional creative media filter.

one of: all, image, video, meme, image-and-meme, none

startDatestring(query)

Optional start date filter in YYYY-MM-DD format.

pattern: ^\d{4}-\d{2}-\d{2}$

endDatestring(query)

Optional end date filter in YYYY-MM-DD format.

pattern: ^\d{4}-\d{2}-\d{2}$

cursorstring(query)

Opaque pagination cursor from a previous response.

min 1 chars

trimboolean(query)

When true, returns a smaller response with fewer fields.

Response fields

data
objectrequired

Endpoint-specific response payload.

dataquery
stringrequired

Search query that was evaluated for this response.

dataads
arrayrequired

Ads returned for the requested search. This array may be empty when no ads match the filters.

dataads[]id
stringrequired

Stable identifier for the ad.

min 1 chars

dataads[]adId
stringrequirednullable

Platform ad id when available.

dataads[]url
stringrequirednullable

Public Facebook Ad Library URL for this ad when available.

dataads[]page
objectrequired

Advertiser page summary for this ad.

dataads[]pageid
stringrequirednullable

Facebook page id for the advertiser when available.

dataads[]pagename
stringrequirednullable

Display name for the advertiser page when available.

dataads[]pageurl
stringrequirednullable

Public Facebook URL for the advertiser page when available.

dataads[]pageisDeleted
booleanrequirednullable

Whether the advertiser page is marked deleted.

dataads[]pageprofilePictureUrl
stringrequirednullable

Profile picture URL for the advertiser page when available.

dataads[]pagelikeCount
integerrequirednullable

Advertiser page like count when available.

≥ 0

dataads[]pagecategories
arrayrequired

Public categories for the advertiser page when available.

dataads[]pagecategories[]
string

min 1 chars

dataads[]campaign
objectrequired

Campaign collation metadata for this ad.

dataads[]campaigncollationId
stringrequirednullable

Campaign collation id when available.

dataads[]campaigncollationCount
integerrequirednullable

Number of ads in the campaign collation when available.

≥ 0

dataads[]isActive
booleanrequired

Whether the ad is currently active.

dataads[]publisherPlatforms
arrayrequired

Publisher platforms where the ad ran or is running.

dataads[]publisherPlatforms[]
string

min 1 chars

dataads[]startedAt
stringrequirednullable

ISO-8601 timestamp for when the ad started, when available.

dataads[]endedAt
stringrequirednullable

ISO-8601 timestamp for when the ad ended, when available.

dataads[]categories
arrayrequired

Ad categories reported by the platform.

dataads[]categories[]
string

min 1 chars

dataads[]countries
arrayrequired

Countries targeted or reached by the ad when available.

dataads[]countries[]
string

min 1 chars

dataads[]impressions
objectrequirednullable

Impressions metadata when available.

dataads[]impressionstext
stringrequirednullable

Human-readable impressions label when available.

dataads[]impressionsindex
integerrequirednullable

Impressions index when available.

dataads[]spend
objectrequirednullable

Spend metadata when available.

dataads[]spendamount
stringrequirednullable

Spend amount text when available.

dataads[]spendcurrency
stringrequirednullable

Currency code for spend when available.

dataads[]creative
objectrequired

Creative content for this ad.

dataads[]creativebodyText
stringrequirednullable

Primary ad body text when available.

dataads[]creativetitle
stringrequirednullable

Ad title when available.

dataads[]creativecaption
stringrequirednullable

Ad caption when available.

dataads[]creativelinkUrl
stringrequirednullable

Primary link URL when available.

dataads[]creativelinkDescription
stringrequirednullable

Link description when available.

dataads[]creativecallToAction
stringrequirednullable

Call-to-action label when available.

dataads[]creativecallToActionType
stringrequirednullable

Call-to-action type when available.

dataads[]creativedisplayFormat
stringrequirednullable

Display format for the creative when available.

dataads[]creativeimages
arrayrequired

Image assets attached to the creative.

dataads[]creativeimages[]url
stringrequirednullable

Image URL when available.

dataads[]creativeimages[]resizedUrl
stringrequirednullable

Resized image URL when available.

dataads[]creativeimages[]watermarkedResizedUrl
stringrequirednullable

Watermarked resized image URL when available.

dataads[]creativevideos
arrayrequired

Video assets attached to the creative.

dataads[]creativevideos[]hdUrl
stringrequirednullable

High-definition video URL when available.

dataads[]creativevideos[]sdUrl
stringrequirednullable

Standard-definition video URL when available.

dataads[]creativevideos[]previewImageUrl
stringrequirednullable

Video preview image URL when available.

dataads[]creativecards
arrayrequired

Carousel cards attached to the creative.

dataads[]creativecards[]title
stringrequirednullable

Card title when available.

dataads[]creativecards[]body
stringrequirednullable

Card body text when available.

dataads[]creativecards[]caption
stringrequirednullable

Card caption when available.

dataads[]creativecards[]linkUrl
stringrequirednullable

Card link URL when available.

dataads[]creativecards[]imageUrl
stringrequirednullable

Card image URL when available.

dataads[]creativecards[]videoUrl
stringrequirednullable

Card video URL when available.

datapage
objectrequired

Pagination information for the current response.

datapagenextCursor
stringrequirednullable

Cursor to pass as `cursor` in the next request when `hasMore` is true; otherwise null.

datapagehasMore
booleanrequired

Whether another page of ads can be requested.

datapagetotalResultsEstimate
integerrequirednullable

Estimated total number of matching ads when available.

≥ 0

meta
objectrequired

Metadata describing the request and billing outcome.

metarequestId
stringrequired

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integerrequired

Credits charged for this request.

≥ 0

metaversion
stringrequired

Public API version that served the response.

one of: v1

Code example

Responses

Facebook Ad Library ads matching the requested search.

Error codes

bad_requestinsufficient_creditsinternal_errorlookup_failedtemporarily_unavailableunauthorized

On this page