Skip to the content

Scraper API

Meta Ad Library

meta_ads.searchAvailable

Meta Ad Library search

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.

Give it a keyword, or the id of an advertiser's Facebook Page, with the library's own filters.

1 unit a record, for runs that return data. Runs that fail cost nothing. How units work

Counted
1 unit a record
Inputs
11
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.search/runs

{
"input": {
"query": "trail running",
"country": "GB",
"media_type": "video",
"max_results": 5
}
}

sent, and answered

a record of the run38 fields

{
position: 1
ad_id: "1131615619314178"
url: "https://www.facebook.com/ads/library/?id=1131615619314178"
page_id: "240202269366256"
page_name: "i-Run"
page_url: "https://facebook.com/i.run.running.trail"
page_profile_picture: "https://scontent-hou1-1.xx.fbcdn.net/v/t39.35426-6/853760481_229492678…
page_categories: [ "Sporting Goods" ]
page_likes: 175571
… 29 more fields

ok1 unit a record

A record this scraper returned for this input. The first 9 of its 38 fields are set down here; the whole record is below.

facebook.com
The page Meta Ad Library search reads, as a browser shows it
The page this scraper reads, photographed in a browser on 19 November 2026. It belongs to its publisher, who has no part in this service.

What it is used for

Watch a competitor's ads
List every ad an advertiser's Page runs with page_id, and see from started_on and ended_on which creatives it keeps running and which it drops.
Collect ad creative for a market
Search a keyword in one country with a media_type and gather each ad's text, title, cta_text, images and videos for a swipe file.
Track political ad spend
Search with ad_type political_and_issue and read paid_for_by, spend_min, spend_max and impressions_min for each ad, as the library states them.

What you send

A keyword, or the id of an advertiser's Facebook Page, with the library's own filters. These are its 11 inputs, as its schema has them.

querystring Optional
Words to search the ads for. Give this or page_id.
page_idstring Optional
The id of an advertiser's Facebook Page: every ad of that Page. It is page_id in the records.
exact_phraseboolean Optional
true returns only ads that contain the words as one phrase.Default false
countrystring Optional
A two-letter country code such as US or DE, or ALL, the default.Default ALL
statusstring Optional
active, inactive or all. active unless you say otherwise.Default active
ad_typestring Optional
all, political_and_issue, housing, employment or financial.Default all
media_typestring Optional
all, image, video, meme or none.Default all
platformslist of strings Optional
Any of facebook, instagram, messenger, audience_network, threads and whatsapp. Every platform when left out.
ran_fromstring Optional
Only ads that ran on or after this day.
ran_tostring Optional
Only ads that ran on or before this day.
max_resultsinteger Optional
The most ads to return: 1 to 150, 30 unless you say otherwise.Default 30

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.search/runs?wait=60" \
  -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"query":"trail running","country":"GB","media_type":"video","max_results":5}}'

# 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.search", {
    "query": "trail running",
    "country": "GB",
    "media_type": "video",
    "max_results": 5,
})
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.search", {
  query: "trail running",
  country: "GB",
  media_type: "video",
  max_results: 5,
});
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.search", map[string]any{"query": "trail running", "country": "GB", "media_type": "video", "max_results": 5})
	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.search", Map.of("query", "trail running", "country", "GB", "media_type", "video", "max_results", 5));
        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.search --input 'query=trail running' --input country=GB --input media_type=video --input max_results=5

Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh

What comes back

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. A record has 38 fields. One we could not read is null, never an empty string or a zero.

A record meta_ads.search returned
{
  "position": 1,
  "ad_id": "1131615619314178",
  "url": "https://www.facebook.com/ads/library/?id=1131615619314178",
  "page_id": "240202269366256",
  "page_name": "i-Run",
  "page_url": "https://facebook.com/i.run.running.trail",
  "page_profile_picture": "https://scontent-hou1-1.xx.fbcdn.net/v/t39.35426-6/853760481_2294926784575469_8829169459759243307_n.jpg?stp=dst-jpg_s60x60_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=lAMJdKmCkwYQ7kNvwGM48m-&_nc_oc=AdpEFi45zcPjfQGT9ZxnqUKtVEk16CV_J3oLCYqG9saXE05IN8zkcvN8dxE1Ws7L2Y0&_nc_zt=14&_nc_ht=scontent-hou1-1.xx&_nc_gid=sjS4RkEK5ujaT4zfS9dOGA&_nc_ss=79180&oh=00_AQS8uqVu2zLnC6xXtLTgk1MJPp0ZNtqZjIpcpwbpEvS61A&oe=6B03FA8E",
  "page_categories": [
    "Sporting Goods"
  ],
  "page_likes": 175571,
  "active": true,
  "started_on": "2026-10-16",
  "ended_on": null,
  "format": "dco",
  "platforms": [
    "facebook",
    "instagram"
  ],
  "content_removed": false,
  "text": "Soyez #Runstoppable avec i-Run ! N°1 de vente en ligne d'équipement Running.",
  "title": "i-run.fr",
  "caption": "i-run.fr",
  "link_url": "http://i-run.fr/",
  "link_description": "Official shop",
  "cta_text": "Learn more",
  "cta_type": "LEARN_MORE",
  "images": [],
  "videos": [],
  "cards": [
    {
      "title": "i-run.fr",
      "text": "Soyez #Runstoppable avec i-Run ! N°1 de vente en ligne d'équipement Running.",
      "caption": "i-run.fr",
      "link_url": "http://i-run.fr/",
      "link_description": "Official shop",
      "cta_text": "Learn More",
      "image": null,
      "video": "https://video-hou1-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQNMb6KJld5O9Jn6vFIwoBBA148virPiQtp8YZkEWy5AnLrFYPsWlXVWCehZOIBRn_9GvCPP9xpqDpvnQRJhzRj5LHXID4mXlV8gNQBgFzbdYA.mp4?_nc_cat=108&_nc_sid=b66105&_nc_ht=video-hou1-1.xx.fbcdn.net&_nc_ohc=NERwZLV_40MQ7kNvwFjwr_U&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5WSV9VU0VDQVNFX1BST0RVQ1RfVFlQRS4uQzMuNzIwLmRhc2hfaDI2NC1iYXNpYy1nZW4yXzcyMHAiLCJ4cHZfYXNzZXRfaWQiOjE0NzI4MTE2MDQ3MDk3NTAsImFzc2V0X2FnZV9kYXlzIjozNCwidmlfdXNlY2FzZV9pZCI6MTAxMzksImR1cmF0aW9uX3MiOjI1LCJ1cmxnZW5fc291cmNlIjoid3d3In0%3D&ccb=17-1&vs=84438e5739047437&_nc_vs=HBksFQIYRWZiX2VwaGVtZXJhbC9GMkRGMTlCQzc3NDg0MjE2QUExRkE5NTJFNDc3OEVGNV9tdF8xX3ZpZGVvX2Rhc2hpbml0Lm1wNBUAAsgBEgAVAhhAZmJfcGVybWFuZW50L0ExNkQ3QzA0NTYwODQyQjlBOTYxQ0VDOTE0MTI2MkM3X2F1ZGlvX2Rhc2hpbml0Lm1wNBUCAsgBEgAoABgAGwOIB3VzZV9vaWwBMRJwcm9ncmVzc2l2ZV9yZWNpcGUBMRJjb3B5X3NhbXBsZV9ncm91cHMBMRUAACbsxajI9eCdBRUCKAJDMywXQDkqfvnbItEYGWRhc2hfaDI2NC1iYXNpYy1nZW4yXzcyMHARAHUAZbaeAQA&_nc_gid=sjS4RkEK5ujaT4zfS9dOGA&_nc_ss=79180&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=Ui_khRxnEm5A7xsDf010iOyESliC7ClXsdb90NHVZPsEJRyrQeWEMqQledcKKPFRvW93MWD24M7tIw_IomLstQA2SNok6FepnuPBcBHUDPCNO_QOLwoYQ0tbbl8&oh=00_AQT012hZTjbNXYy8bsYYsBk_NmyQ-3AERqReimCoVG1kHQ&oe=6B03FB10",
      "video_preview_image": "https://scontent-hou1-1.xx.fbcdn.net/v/t39.35426-6/853374087_1123626296916593_8296056637409549530_n.jpg?_nc_cat=109&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=UlnAMC03_a0Q7kNvwEEQdvL&_nc_oc=Adomg0Kk1G5oq1pqr_nZNOMCdgxtvh6XIJTZVNt_lawrHw0LT7N8qkguL3joJf2Q7E0&_nc_zt=14&_nc_ht=scontent-hou1-1.xx&_nc_gid=sjS4RkEK5ujaT4zfS9dOGA&_nc_ss=79180&oh=00_AQTPLKKz--vRv-yRm5oF5Y9uMRWsMpOe8UkhnszCTE3WdQ&oe=6B041A01"
    },
    {
      "title": "i-run.fr",
      "text": "Soyez #Runstoppable avec i-Run ! N°1 de vente en ligne d'équipement Running.",
      "caption": "i-run.fr",
      "link_url": "http://i-run.fr/",
      "link_description": "Official shop",
      "cta_text": "Learn More",
      "image": null,
      "video": "https://video-hou1-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQNMb6KJld5O9Jn6vFIwoBBA148virPiQtp8YZkEWy5AnLrFYPsWlXVWCehZOIBRn_9GvCPP9xpqDpvnQRJhzRj5LHXID4mXlV8gNQBgFzbdYA.mp4?_nc_cat=108&_nc_sid=b66105&_nc_ht=video-hou1-1.xx.fbcdn.net&_nc_ohc=NERwZLV_40MQ7kNvwFjwr_U&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5WSV9VU0VDQVNFX1BST0RVQ1RfVFlQRS4uQzMuNzIwLmRhc2hfaDI2NC1iYXNpYy1nZW4yXzcyMHAiLCJ4cHZfYXNzZXRfaWQiOjE0NzI4MTE2MDQ3MDk3NTAsImFzc2V0X2FnZV9kYXlzIjozNCwidmlfdXNlY2FzZV9pZCI6MTAxMzksImR1cmF0aW9uX3MiOjI1LCJ1cmxnZW5fc291cmNlIjoid3d3In0%3D&ccb=17-1&vs=84438e5739047437&_nc_vs=HBksFQIYRWZiX2VwaGVtZXJhbC9GMkRGMTlCQzc3NDg0MjE2QUExRkE5NTJFNDc3OEVGNV9tdF8xX3ZpZGVvX2Rhc2hpbml0Lm1wNBUAAsgBEgAVAhhAZmJfcGVybWFuZW50L0ExNkQ3QzA0NTYwODQyQjlBOTYxQ0VDOTE0MTI2MkM3X2F1ZGlvX2Rhc2hpbml0Lm1wNBUCAsgBEgAoABgAGwOIB3VzZV9vaWwBMRJwcm9ncmVzc2l2ZV9yZWNpcGUBMRJjb3B5X3NhbXBsZV9ncm91cHMBMRUAACbsxajI9eCdBRUCKAJDMywXQDkqfvnbItEYGWRhc2hfaDI2NC1iYXNpYy1nZW4yXzcyMHARAHUAZbaeAQA&_nc_gid=sjS4RkEK5ujaT4zfS9dOGA&_nc_ss=79180&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=UuzJwmpu7fKdSlc5XU7plx82ukSA8ggCUdxcAez6iOZ_gP-Pn6juHCrk63O5NJBpCck-ujng8O7S_nyItO_7yo3iqv7hsaglmGsz2ILAskwWzvRFxuGx9RoIwUE&oh=00_AQT012hZTjbNXYy8bsYYsBk_NmyQ-3AERqReimCoVG1kHQ&oe=6B03FB10",
      "video_preview_image": "https://scontent-hou1-1.xx.fbcdn.net/v/t39.35426-6/853374087_1123626296916593_8296056637409549530_n.jpg?_nc_cat=109&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=UlnAMC03_a0Q7kNvwEEQdvL&_nc_oc=Adomg0Kk1G5oq1pqr_nZNOMCdgxtvh6XIJTZVNt_lawrHw0LT7N8qkguL3joJf2Q7E0&_nc_zt=14&_nc_ht=scontent-hou1-1.xx&_nc_gid=sjS4RkEK5ujaT4zfS9dOGA&_nc_ss=79180&oh=00_AQTPLKKz--vRv-yRm5oF5Y9uMRWsMpOe8UkhnszCTE3WdQ&oe=6B041A01"
    }
  ],
  "versions": 1,
  "categories": [],
  "paid_for_by": null,
  "currency": null,
  "spend": null,
  "spend_min": null,
  "spend_max": null,
  "impressions": null,
  "impressions_min": null,
  "impressions_max": null,
  "estimated_audience": null,
  "contains_ai_media": false,
  "fetched_at": "2026-11-19T18:07:40.993436Z"
}

The scraper returned this record for the input above, reading a saved copy of the page, not the live site.

Values shortened for this page: cards: 5 items, the first 2 shown.

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_images or text.
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 - 600K or >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.

The whole schema, in its reference

Units and limits

Counted per record
Billed per record: a run that returns data costs 1 unit for each record 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

  • Spend, impressions and who paid are stated for ads about social issues, elections or politics, as ranges. Other ads do not have them.
  • The addresses of images and videos are signed by Meta and stop working after a while.
  • 150 ads a run at most. When the library stops answering part-way, the run ends as partial with the ads read so far.

The bounds its schema sets

status
active, inactive, all; active unless you say otherwise
ad_type
all, political_and_issue, housing, employment, financial; all unless you say otherwise
media_type
all, image, video, meme, none; all unless you say otherwise
platforms
at most 6 items
max_results
1 to 150; 30 unless you say otherwise

Scraper API pricing: how units workThe five ways a run ends

Questions

What does Meta Ad Library search return?

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. 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?

A keyword, or the id of an advertiser's Facebook Page, with the library's own filters. Optional: query, page_id, exact_phrase, country, status, ad_type, media_type, platforms, ran_from, ran_to and max_results.

How is it counted?

Billed per record: a run that returns data costs 1 unit for each record 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.

How much does one run return?

Its schema sets these bounds: status active, inactive, all (active unless you say otherwise); ad_type all, political_and_issue, housing, employment, financial (all unless you say otherwise); media_type all, image, video, meme, none (all unless you say otherwise); platforms at most 6 items; max_results 1 to 150 (30 unless you say otherwise). A run may take up to 5 minutes.

What does it not do?

Spend, impressions and who paid are stated for ads about social issues, elections or politics, as ranges. Other ads do not have them. The addresses of images and videos are signed by Meta and stop working after a while. 150 ads a run at most. When the library stops answering part-way, the run ends as partial with the ads read so far.

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.search and the same input. It costs what the same API call costs.

Used in these playbooks

A playbook runs Meta Ad Library search as one of its steps and hands back the finished list. Its runs of this scraper cost what they cost here, and the playbook adds nothing.

  • Marketing

    Ad Creative Research

    A competitor's ads on Meta, Google Ads and LinkedIn, with copy, landing page and how long each has run, longest first.

  • Sales

    Ad-Activity Trigger

    Companies running ads about your topic on Meta and LinkedIn now, sized up, with their marketing lead to contact.

Meta Ad Library

The ads in the Meta Ad Library, the public register of advertising on Facebook, Instagram, Messenger and Threads.

  • An ad's Library ID, or its address in the Ad Library. 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.

Meta Ad Library on the line-up

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.