SFOLN

Catalogue / Ad intelligence

Facebook Ads Library Scraper

sfoln/facebook-ads-search · Social media, Lead generation, Ecommerce On request

Search the Meta Ad Library (Facebook and Instagram) by keyword, page ID or company: one row per ad with text, CTA, landing URL, images, videos, dates, platforms and, where Meta discloses them, spend and impressions. $1 per 1,000 ads + $0.004 per page.

About

What it does

Facebook Ads Library Scraper searches the Meta Ad Library (Facebook, Instagram, Messenger, Audience Network) by keyword, Facebook page ID or company name and returns one clean dataset record per ad: ad archive ID, advertiser page, start/end dates, active status, platforms, ad text, headline, call to action, landing URL, media type, image and video URLs and, where Meta discloses it, impressions, spend and targeted countries. Filter by country, active status, media type, political/issue ads, language and date range. Built for competitor research, creative inspiration, ad monitoring, agencies and AI agents.

Price

Price per delivered record

EventPricePer 1,000Charged for
Facebook ad
facebook-ad
$0.001$1 / 1,000Charged once per ad record delivered from the Meta Ad Library (recordType ad). Duplicates, query summary rows and failed requests are not charged.
Ad Library page
facebook-ads-query
$0.004$4 / 1,000Charged once per Ad Library results page fetched for a query (a page holds up to ~30 ads). A page without new ads is charged only when the upstream provider billed it. Failed requests are not charged.

Apify free plan: up to 10 items per run. Paid plans have no per-run cap; set maxTotalChargeUsd to cap spend.

Run

Call it from code, an agent or the Console

This API is private on Apify for now. Email us and we will publish it for you, usually within two working days. The calls below work once it is public. contact@sfoln.com

curl · synchronous run, rows in the response
curl -X POST "https://api.apify.com/v2/actors/sfoln~facebook-ads-search/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"queries":["running shoes"],"maxAdsPerQuery":10,"country":"US"}'
mcp.json · hosted Apify MCP server
{
  "mcpServers": {
    "apify": {
      "type": "http",
      "url": "https://mcp.apify.com?tools=sfoln/facebook-ads-search"
    }
  }
}
asynchronous run · for large batches
POST https://api.apify.com/v2/actors/sfoln~facebook-ads-search/runs?maxTotalChargeUsd=1
GET  https://api.apify.com/v2/actor-runs/{runId}            # until status is SUCCEEDED
GET  https://api.apify.com/v2/datasets/{defaultDatasetId}/items?format=json

Authenticate with an Apify API token. MCP clients can instead sign in with OAuth when prompted. Example prompt for an agent: Find 20 active Facebook and Instagram ads in the US that mention "running shoes" and summarize their headlines, calls to action and landing pages.

Input

Input fields

Search the Meta Ad Library by keyword, Facebook page ID or company name. Each query returns one dataset record per ad plus one summary record.

FieldTypeDefaultMeaning
queriesarray—Search keywords
Keywords to search the Ad Library for (ad text match), one per line. Accounts on the Apify free plan can process up to 10 queries per run (keywords, page IDs and company names together).
pageIdsarray—Facebook page IDs
Numeric Facebook page IDs, or Ad Library URLs containing view_all_page_id=…, to list all ads of that page.
companyNamesarray—Company names
Advertiser / company names; the upstream resolves the name to its Ad Library page (a page ID is more precise).
maxAdsPerQueryinteger50Max ads per query
Maximum ads returned per keyword, page or company (1–500). Ads are fetched in pages of up to ~30. Range 1–500.
countrystring"ALL"Country
2-letter country code where the ads were delivered (e.g. US, GB, DE), or ALL.
statusstring"ACTIVE"Ad status
Only active ads, only inactive ads, or both. One of "ACTIVE", "INACTIVE", "ALL".
mediaTypestring"ALL"Media type
Filter by creative type. MEME means image + text. One of "ALL", "IMAGE", "VIDEO", "MEME", "IMAGE_AND_MEME", "NONE".
adTypestring"all"Ad category (keyword search only)
All ads, or only political and social-issue ads. One of "all", "political_and_issue_ads".
searchTypestring"keyword_unordered"Keyword matching (keyword search only)
Match any of the words, or the exact phrase. One of "keyword_unordered", "keyword_exact_phrase".
sortBystring"total_impressions"Sort by
Most impressions first, or most recent first. One of "total_impressions", "relevancy_monthly_grouped".
languagestring—Language
Optional 2-letter language code of the ad (EN, ES, FR…).
startDatestring—Shown from (YYYY-MM-DD)
Optional: only ads with impressions on or after this date.
endDatestring—Shown until (YYYY-MM-DD)
Optional: only ads with impressions on or before this date.
maxQueriesinteger100Max queries
Safety cap on keywords + pages + companies processed in this run. Range 1–1000.
concurrencyinteger4Concurrency
Queries processed in parallel (1–8). Range 1–8.
itemTimeoutSecsinteger600Time limit per query (seconds)
Pagination for one keyword, page or company stops cleanly shortly before this limit (60–3600). Raise it for very large per-query limits. Range 60–3600.
includeRawbooleanfalseInclude raw upstream response
Attach the unmodified upstream ad object to each ad record under `raw` (larger output).
Example input
{
  "queries": [
    "running shoes"
  ],
  "maxAdsPerQuery": 10,
  "country": "US"
}

Output

One record per input item

Records land in the run's dataset; a synchronous call returns them directly. Each has a status (ok is charged; everything else is free) and a charged flag. The run's OUTPUT record totals items and charges.

FieldTypeMeaning
inputstring | objectInput
The input query this record belongs to.
recordTypestringRow type
ad (one per ad, charged facebook-ad) | query (one summary per query, free).
statusstringStatus
ok | not_found | error | skipped_invalid | skipped_budget | skipped_free_plan
chargedbooleanCharged
Whether this record incurred a pay-per-event charge.
chargedEventstringCharged event
Pay-per-event event charged for this record.
sourcestringSource
Upstream data source (scrapecreators = ScrapeCreators API over the public ad library).
fetchedAtstringFetched at
ISO timestamp.
errorobjectError
code / message when status is not ok.
warningsarrayWarnings
Non-fatal notes (e.g. stopped early).
querystring | nullQuery
Keyword, page ID or company name the row belongs to.
queryTypestring | nullQuery type
keyword | page | company.
positioninteger | nullPosition
1-based position of the ad within the query results.
adArchiveIdstring | nullAd archive ID
Meta Ad Library ID of the ad.
adLibraryUrlstring | nullAd Library URL
Public Ad Library link to the ad (snapshot).
pageIdstring | nullPage ID
Advertiser's Facebook page ID.
pageNamestring | nullPage name
Advertiser's page name.
pageUrlstring | nullPage URL
Advertiser's Facebook page.
pageLikeCountinteger | nullPage likes
Page like count at fetch time.
pageCategoriesarrayPage categories
Page categories.
isActiveboolean | nullActive
Ad is currently running.
startDatestring | nullStart date
ISO date the ad started running.
endDatestring | nullEnd date
ISO date the ad stopped (or last seen) running.
totalActiveTimeSecsinteger | nullActive time (s)
Total active time in seconds when reported.
platformsarrayPlatforms
Publisher platforms: facebook, instagram, audience_network, messenger, threads.
adTextstring | nullAd text
Primary text (body) of the ad; first card's body for multi-version ads.
headlinestring | nullHeadline
Link title / headline.
linkDescriptionstring | nullLink description
Text under the headline.
linkUrlstring | nullLanding URL
Destination link.
displayUrlstring | nullDisplay URL
Domain shown on the ad (caption).
ctaTextstring | nullCTA text
Call-to-action button text.
ctaTypestring | nullCTA type
Call-to-action code, e.g. SHOP_NOW, LEARN_MORE.
mediaTypestring | nullMedia type
image | video | multi_images | carousel | dco | dpa | text …
imageUrlsarrayImage URLs
Creative images (original resolution where available).
videoUrlsarrayVideo URLs
Creative videos (HD where available).
thumbnailUrlstring | nullThumbnail
Video preview image or resized first image.
cardCountinteger | nullCards
Number of carousel / version cards.
collationCountinteger | nullVersions
Number of ad versions grouped under this ad.
languagesarrayLanguages
Ad languages when the library reports them.
impressionsTextstring | nullImpressions
Impressions range text when Meta discloses it (political / EU ads).
reachEstimateinteger | nullReach estimate
Estimated reach when disclosed.
spendLowernumber | nullSpend (lower)
Lower spend bound when disclosed (political ads).
spendUppernumber | nullSpend (upper)
Upper spend bound when disclosed.
currencystring | nullCurrency
Currency of the spend bounds.
targetedCountriesarrayTargeted countries
Targeted / reached or political countries when reported.
targetsEuboolean | nullTargets EU
EU transparency data present (ad details only).
euTotalReachinteger | nullEU reach
Total EU reach (ad details only).
audienceAgeMininteger | nullAudience age min
Targeted minimum age (ad details only).
audienceAgeMaxinteger | nullAudience age max
Targeted maximum age (ad details only).
audienceGenderstring | nullAudience gender
Targeted gender (ad details only).
audienceLocationsarrayAudience locations
Targeted locations (ad details only).
payersarrayPayers
Who paid for the ad (EU transparency; ad details only).
beneficiariesarrayBeneficiaries
Who benefits from the ad (EU transparency; ad details only).
reachBreakdownarrayReach breakdown
EU reach by country / age range / gender (ad details only).
adsDeliveredinteger | nullAds delivered
Ads delivered for this query (summary rows).
pagesFetchedinteger | nullPages fetched
Upstream pages fetched (summary rows).
queryFeesChargedinteger | nullPage fees charged
facebook-ads-query events charged for this query (summary rows).
totalResultsinteger | nullTotal results
Total matching ads reported by the library (summary rows; capped at 50,001 by Meta).
stopReasonstring | nullStop reason
limit | end | budget | max_pages | deadline | error | empty_pages (summary rows).
Example record
{
  "input": {
    "kind": "page",
    "value": "15087023444"
  },
  "recordType": "ad",
  "query": "15087023444",
  "queryType": "page",
  "position": 1,
  "adArchiveId": "1212560900568826",
  "adLibraryUrl": "https://www.facebook.com/ads/library?id=1212560900568826",
  "pageId": "15087023444",
  "pageName": "Nike",
  "pageUrl": "https://facebook.com/nike",
  "pageLikeCount": 37497718,
  "pageCategories": [
    "Ropa deportiva"
  ],
  "isActive": true,
  "startDate": "2025-06-17T07:00:00.000Z",
  "endDate": "2025-06-18T07:00:00.000Z",
  "platforms": [
    "facebook"
  ],
  "adText": "Que el frío no te detenga. Explora la colección de invierno con estilo y actitud Nike. 🧥",
  "headline": "Look de invierno activado",
  "linkUrl": "https://fb.com/canvas_doc/569658969305127",
  "displayUrl": "fb.com",
  "ctaText": "Learn more",
  "ctaType": "LEARN_MORE",
  "mediaType": "video",
  "imageUrls": [],
  "videoUrls": [
    "https://video.xx.fbcdn.net/…hd.mp4"
  ],
  "thumbnailUrl": "https://scontent.xx.fbcdn.net/…preview.jpg",
  "impressionsText": null,
  "spendLower": null,
  "spendUpper": null,
  "targetedCountries": [],
  "status": "ok",
  "charged": true,
  "chargedEvent": "facebook-ad",
  "source": "scrapecreators",
  "fetchedAt": "2026-10-14T10:00:00.000Z"
}

Machine-readable

This page for agents