Scraper API
Meta Ad Librarymeta_ads.adAvailable
Meta Ad Library ad
That ad: the advertiser's Page, the dates it ran, its text, headline, link, button, images and videos, the platforms, and for a political or issue ad who paid, the amount spent and the impressions.
Give it an ad's Library ID, or its address in the Ad Library.
1 unit a run, for runs that return data. Runs that fail cost nothing. How units work
- Counted
- 1 unit a run
- Inputs
- 1, 1 required
- Record
- 38 fields
- A run takes
- up to 5 minutes
- Records kept
- 7 days
- Measured
- its success, on the status page
POST/v1/scrapers/meta_ads.ad/runs
sent, and answered
a record of the run38 fields
ok1 unit a run
A record this scraper returned for this input. The first 9 of its 38 fields are set down here; the whole record is below.

What it is used for
- Check one ad by its Library ID
- Read the ad behind a Library ID: who runs it, whether it is
active, theplatformsit runs on and the days it ran. - Keep a record of an ad
- Save an ad's
text,title,link_urland media while it runs, since the library shows no content once Meta removes it. - Follow a political ad's figures
- Read the same ad again over its life to see its
spendandimpressionsranges grow, with who paid for it.
What you send
An ad's Library ID, or its address in the Ad Library. It is the one input.
adstring Required- The Library ID shown on the ad, or its address: https://www.facebook.com/ads/library/?id=…
A request, ready to send
It starts a run with the input shown at the top of this page, waits up to 60 seconds for it, and reads its records. Put your key in the variable it reads.
# Start a run and wait up to 60 seconds for it to finish
curl -X POST "https://api.enrichednow.com/v1/scrapers/meta_ads.ad/runs?wait=60" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"ad":"317161109571794"}}'
# Read its records, with the id the first call answered
curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY"from enrichednow import EnrichedNow
client = EnrichedNow() # reads ENRICHEDNOW_API_KEY
# Start a run, wait for it to end, and get its records
result = client.scrape("meta_ads.ad", {"ad": "317161109571794"})
print(result.run.id, result.run.status, result.run.record_count)
# Read its records: pages are fetched as you go
for record in result.records:
print(record)Install it with pip install enrichednow, then save as run.py and run python3 run.py
import EnrichedNow from "enrichednow";
const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
const { run, records } = await client.scrape("meta_ads.ad", { ad: "317161109571794" });
console.log(run.id, run.status, run.record_count);
// Read its records: pages are fetched as you go
for await (const record of records) console.log(record);Install it with npm install enrichednow, then save as run.mjs and run node run.mjs
package main
import (
"context"
"fmt"
"log"
"time"
enrichednow "github.com/enrichednow/enrichednow-go"
)
func main() {
client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
if err != nil {
log.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
// Start a run, wait for it to end, and get its records
run, records, err := client.Scrape(ctx, "meta_ads.ad", map[string]any{"ad": "317161109571794"})
if err != nil {
log.Fatal(err)
}
fmt.Println(run.ID, run.Status, run.RecordCount)
// Read its records: pages are fetched as you go
for records.Next() {
fmt.Println(string(records.Current()))
}
if err := records.Err(); err != nil {
log.Fatal(err)
}
}Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go
import com.enrichednow.EnrichedNowClient;
import com.enrichednow.ScrapeResult;
import java.util.Map;
public class Run {
public static void main(String[] args) {
EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
ScrapeResult result = client.scrape("meta_ads.ad", Map.of("ad", "317161109571794"));
System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
// Read its records: pages are fetched as you go
for (Map<String, Object> record : result.records()) {
System.out.println(record);
}
}
}Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java
enrichednow run meta_ads.ad --input-json '{"ad":"317161109571794"}'Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh
What comes back
That ad: the advertiser's Page, the dates it ran, its text, headline, link, button, images and videos, the platforms, and for a political or issue ad who paid, the amount spent and the impressions. A record has 38 fields. One we could not read is null, never an empty string or a zero.
{
"position": null,
"ad_id": "317161109571794",
"url": "https://www.facebook.com/ads/library/?id=317161109571794",
"page_id": "108824017345866",
"page_name": "Meta",
"page_url": "https://facebook.com/Meta",
"page_profile_picture": "https://scontent-hou1-1.xx.fbcdn.net/v/t1.6435-9/119568341_200337161527884_7846459746434232698_n.png?stp=dst-png_s60x60&_nc_cat=100&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=EN9pA0UEMoEQ7kNvwEpqLkj&_nc_oc=Adp4n_U5BbjRSWLXyn277KmegfjOBmhgZ4j-o4B9ENmrC253fAkUXbytvJZEidgty8M&_nc_zt=23&_nc_ht=scontent-hou1-1.xx&_nc_gid=qtvElj29BGhpX0E4L1VhTQ&_nc_ss=79180&oh=00_AQReXztCH-7ZtsS11Mv4YQydKKpZelanVUVcZJVl2Fl4JQ&oe=6B25B58E",
"page_categories": [
"Internet Company"
],
"page_likes": 106779245,
"active": false,
"started_on": "2020-09-22",
"ended_on": "2020-10-05",
"format": "video",
"platforms": [
"facebook"
],
"content_removed": false,
"text": "The Voting Information Center—one-tap voting registration information from election experts and authorities in one place.",
"title": "Voting Information Center",
"caption": "fb.com/votinginfocenter",
"link_url": "http://facebook.com/votinginformationcenter",
"link_description": "Get prepared for this election",
"cta_text": "Learn more",
"cta_type": "LEARN_MORE",
"images": [],
"videos": [
{
"url": "https://video-hou1-1.xx.fbcdn.net/o1/v/t2/f2/m412/AQNN757NtitUcJnpv0ODeMH6fXo-yFM-X90P2W82Zsrc70oOzST9lrKgscKf21SHBUtZ9pdKMclY8s32B0eRJ7o.mp4?_nc_cat=106&_nc_sid=ef5aa3&_nc_ht=video-hou1-1.xx.fbcdn.net&_nc_ohc=iIPhYB3vNdIQ7kNvwFTxmrN&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5WSV9VU0VDQVNFX1BST0RVQ1RfVFlQRS4uQzMuMzQwLmFzaWNfaHExX3NkX3Byb2dyZXNzaXZlIiwieHB2X2Fzc2V0X2lkIjo4MzE0MTAwMzMxNDk2MzYsImFzc2V0X2FnZV9kYXlzIjozNTYsInZpX3VzZWNhc2VfaWQiOjEwNjgwLCJkdXJhdGlvbl9zIjoxNSwidXJsZ2VuX3NvdXJjZSI6Ind3dyJ9&ccb=17-1&_nc_gid=qtvElj29BGhpX0E4L1VhTQ&_nc_ss=79180&_nc_map=urlgen_bucketless&_nc_zt=28&oh=00_AQQ1svOVdWpe2-6AAW4cHTm2Yzgyqvp7E6NGVGvSjH5img&oe=6B03E648",
"preview_image": "https://scontent-hou1-1.xx.fbcdn.net/v/t39.35426-6/120065387_2711663819108220_8472417301728012411_n.jpg?_nc_cat=105&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=V-1K2-yACCkQ7kNvwGnMYur&_nc_oc=Adqjwh7xCVGZP8WhsP4htxQsLWSFbatylr0gopl168SsJPKyBZHHxBE_hB6GRj_4H6Q&_nc_zt=14&_nc_ht=scontent-hou1-1.xx&_nc_gid=qtvElj29BGhpX0E4L1VhTQ&_nc_ss=79180&oh=00_AQQ0VpuTAnKOVmMJhsY9SvRCIP5EQuiQ24UCs6tezfkypQ&oe=6B04084A"
}
],
"cards": [],
"versions": null,
"categories": [
"political"
],
"paid_for_by": "Facebook, Inc.",
"currency": "USD",
"spend": ">$1M",
"spend_min": 1000000,
"spend_max": null,
"impressions": ">1M",
"impressions_min": 1000000,
"impressions_max": null,
"estimated_audience": ">1M",
"contains_ai_media": false,
"fetched_at": "2026-11-19T18:07:40.989498Z"
}The scraper returned this record for the input above, reading a saved copy of the page, not the live site.
The fields of a record
positioninteger or null- The ad's place in the results, from 1. Null for an ad asked for by its id.
ad_idstring- The ad's Library ID.
urlstring- The ad's page in the Ad Library.
page_idstring or null- The id of the Facebook Page that runs the ad.
page_namestring or null- The name of the Page that runs the ad.
page_urlstring or null- The Page's address on Facebook.
page_profile_picturestring or null- The Page's profile picture.
page_categorieslist of strings- What the Page says it is, e.g.
Clothing (Brand). page_likesinteger or null- How many people like the Page.
activeboolean or null- Whether the ad is running now.
started_ondate or null- The day the ad started running.
ended_ondate or null- The last day the ad ran. Null while it is still running.
formatstring or null- The kind of creative, in Meta's own words in lower case:
image,video,carousel,dco(several versions put together from the advertiser's texts and media),dpa(filled from a product catalogue),multi_imagesortext. platformslist of strings- Where the ad runs:
facebook,instagram,messenger,audience_network,threads,whatsapp. content_removedboolean- True when Meta removed the ad's content (it did not follow the advertising standards, or its disclaimer did not follow the policy for political ads). The library then shows no text or media, and none is returned.
textstring or null- The ad's main text. An ad filled from a product catalogue shows the catalogue's placeholders in place of a product's name.
titlestring or null- The headline beside the button.
captionstring or null- The line above the headline, usually the site the ad links to, e.g.
nike.com. link_urlstring or null- Where the ad leads.
link_descriptionstring or null- The description under the headline.
cta_textstring or null- The button's label, e.g.
Shop now. cta_typestring or null- Meta's code for the button, e.g.
SHOP_NOW,LEARN_MORE,INSTALL_MOBILE_APP. imageslist of strings- The ad's images. The addresses are signed and stop working after a while.
videoslist of objects- The ad's videos.Each holds
url,preview_image. cardslist of objects- The cards of a carousel, or the versions of an ad that has several, in order.Each holds
title,text,caption,link_url,link_description,cta_text,image,video,video_preview_image. versionsinteger or null- How many ads use this creative and text, where the library groups them.
categorieslist of strings- The special categories the ad is filed under, in lower case,
political,housing,employment,credit. Empty for an ordinary ad. paid_for_bystring or null- Who paid for the ad, as its disclaimer says. Ads about social issues, elections or politics carry one.
currencystring or null- The currency of the amount spent, e.g.
USD. Stated for ads about social issues, elections or politics. spendstring or null- The amount spent, as the range the library shows, e.g.
$35K - $40K. Stated for ads about social issues, elections or politics. spend_mininteger or null- The lower end of the amount spent, in
currency. Null when the library states only an upper end. spend_maxinteger or null- The upper end of the amount spent. Null when the library states only a lower end, e.g.
>$1M. impressionsstring or null- How often the ad was shown, as the range the library shows, e.g.
500K - 600Kor>1M. Stated for ads about social issues, elections or politics. impressions_mininteger or null- The lower end of the impressions. Null when the library states only an upper end.
impressions_maxinteger or null- The upper end of the impressions. Null when the library states only a lower end.
estimated_audiencestring or null- The estimated audience size, as the range the library shows, e.g.
500K - 1M. contains_ai_mediaboolean or null- True when the advertiser disclosed that the ad contains digitally created or altered media.
fetched_atdatetime- When the library was read, in UTC.
Units and limits
- Counted per request
- Billed per request: a run that returns data costs 1 unit, however many records it returns.
- A miss costs nothing
- A run that fails, that meets something not supported yet, or that you cancel costs nothing. You pay for runs that return data.
- What bounds a run
- A run may take up to 5 minutes. Its records are read in pages of up to 1,000 and are kept for 7 days.
What it does not do
- An id the library has no ad for ends as failed, with the reason not_found, and costs nothing.
- One ad a run. To list an advertiser's ads, use meta_ads.search with its page_id.
Questions
What does Meta Ad Library ad return?
That ad: the advertiser's Page, the dates it ran, its text, headline, link, button, images and videos, the platforms, and for a political or issue ad who paid, the amount spent and the impressions. A record has 38 fields, among them position, ad_id, url, page_id, page_name and page_url. A value that could not be read is null, never an empty string or a zero.
What do I send?
An ad's Library ID, or its address in the Ad Library. The input ad is required.
How is it counted?
Billed per request: a run that returns data costs 1 unit, however many records it returns. A run that fails, that meets something not supported yet, or that you cancel costs nothing. The first 1,000 units each month are free.
What does it not do?
An id the library has no ad for ends as failed, with the reason not_found, and costs nothing. One ad a run. To list an advertiser's ads, use meta_ads.search with its page_id.
How long are the records kept, and in what format do they come?
Records are kept for 7 days after the run ended, and read in pages of up to 1,000. They come as JSON, as NDJSON with one record a line, or as CSV with a column for each field.
Can an AI assistant call it?
Yes. Through the EnrichedNow MCP server an assistant calls the tool run_scraper with the scraper_id meta_ads.ad and the same input. It costs what the same API call costs.
Meta Ad Library
The ads in the Meta Ad Library, the public register of advertising on Facebook, Instagram, Messenger and Threads.
Meta Ad Library search
meta_ads.searchA keyword, or the id of an advertiser's Facebook Page, with the library's own filters. The ads the library lists, in its order: the advertiser's Page, the dates the ad ran, its text, headline, link, button, images and videos, the platforms it runs on, and for political and issue ads who paid, the amount spent and the impressions.
Meta Ad Library on the line-up
- Industry
- Companies and B2B
- Where
- Worldwide
Run it on an input of your own.
Create an account, make a key, and send the request above with your own input. The first 1,000 units each month are free.