Search
curl --request GET \
--url https://api.example.com/api/v1/scrape/facebook/adLibrary/search/ads \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/scrape/facebook/adLibrary/search/ads"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/scrape/facebook/adLibrary/search/ads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/scrape/facebook/adLibrary/search/ads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/scrape/facebook/adLibrary/search/ads"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/scrape/facebook/adLibrary/search/ads")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/scrape/facebook/adLibrary/search/ads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyFacebook Ad Library Scraper
Search
Searches the Meta Ad Library by keyword and returns matching ads. Each result includes ad_archive_id, page_name, is_active, publisher_platform, and a snapshot with body text, images, videos, and cta_text. Results cap around 1,500 via GET due to cursor size limits; switch to POST method with body params for larger result sets.
GET
/
api
/
v1
/
scrape
/
facebook
/
adLibrary
/
search
/
ads
Search
curl --request GET \
--url https://api.example.com/api/v1/scrape/facebook/adLibrary/search/ads \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/scrape/facebook/adLibrary/search/ads"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/scrape/facebook/adLibrary/search/ads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/scrape/facebook/adLibrary/search/ads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/scrape/facebook/adLibrary/search/ads"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/scrape/facebook/adLibrary/search/ads")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/scrape/facebook/adLibrary/search/ads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Keyword to search for |
sort_by | string | No | Sort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions. |
search_type | string | No | If you want to search by exact phrase or not |
ad_type | string | No | Search for all ads or only political and issue ads |
country | string | No | This can only be one country. It has to be the 2 letter code for the country. It defaults to ALL. |
status | string | No | Status of the ad. Defaults to ACTIVE. |
media_type | string | No | Media type of the ad. Defaults to ALL. Meme just means the ad has text and an image. No clue why they call it meme. |
start_date | string | No | Impressions start date. Needs to be in YYYY-MM-DD format. |
end_date | string | No | Impressions end date. Needs to be in YYYY-MM-DD format. |
cursor | string | No | Cursor to paginate through results |
trim | boolean | No | Set to true for a trimmed down version of the response |
Response Example
{
"success": true,
"data": {
"searchResults": [
{
"ad_archive_id": "1378176106734781",
"end_date": 1747638000,
"is_aaa_eligible": false,
"is_active": true,
"page_id": "119749581219299",
"page_name": "Makhumalo",
"political_countries": [],
"reach_estimate": null,
"snapshot": {
"branded_content": null,
"page_id": "119749581219299",
"page_is_deleted": false,
"page_profile_uri": "https://www.facebook.com/61550737114480/",
"root_reshared_post": null,
"byline": null,
"disclaimer_label": null,
"page_name": "Makhumalo",
"page_profile_picture_url": "https://scontent-sjc3-1.xx.fbcdn.net/v/t39.35426-6/499107970_2293645317822147_4932735414928456888_n.jpg?stp=dst-jpg_s60x60_tt6&_nc_cat=106&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=DBNo3Z6ft4AQ7kNvwESjMWN&_nc_oc=AdnZGvglABgVlSJ6UIGIbWgFeUL2LnoBSuMbBvti20zRjb_UUDRzhGxAZ0ip3ye1EQI&_nc_zt=14&_nc_ht=scontent-sjc3-1.xx&_nc_gid=49D7P4N6a4mVqUW8WdOxag&oh=00_AfMEXcKVf3KYJpFehTTToe8MXUZslTHE9P-xS2eyVCeGKA&oe=685A4903",
"body": {
"text": "This is my second pair. I only take them off to go to sleep. I put them on first thing in the morning. I am 59 and have neuropathy in my feet, they bring me comfort every day.” -Lydia P.👍👍👍\n❤️These orthopedic shoes provide great comfort and ease foot and knee pain! 😍\n✅ Ideal for wide feet \n✅ comfortable \n✅ they are ideal for everyday life.\nGet Yours Now : https://www.ghemshop.com/products/buckled-square"
},
"is_reshared": false,
"brazil_tax_id": null,
"caption": "ghemshop.com",
"cards": [],
"cta_text": "Shop now",
"cta_type": "SHOP_NOW",
"country_iso_code": null,
"current_page_name": "Makhumalo",
"display_format": "IMAGE",
"event": null,
"images": [
{
"original_image_url": "https://scontent-sjc3-1.xx.fbcdn.net/v/t39.35426-6/499507599_4016645891948767_4341363175504946673_n.jpg?_nc_cat=105&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=3EJ6TbZR3GEQ7kNvwErfuF4&_nc_oc=AdkQPpJ9OYN_J3P5xTetGSb9FDCFZzfoLSj59Bbp6s-g5HGg-zTECrgOm8mjkJfk5JE&_nc_zt=14&_nc_ht=scontent-sjc3-1.xx&_nc_gid=49D7P4N6a4mVqUW8WdOxag&oh=00_AfMTuIozb2-VJgGP7NCIx0pG91b48CzMgm_1eT7STgBvew&oe=685A6906",
"resized_image_url": "https://scontent-sjc3-1.xx.fbcdn.net/v/t39.35426-6/499504336_1222720305887055_488411876974522066_n.jpg?stp=dst-jpg_s600x600_tt6&_nc_cat=104&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=DYkDYH-EJrQQ7kNvwF-b_ov&_nc_oc=Adn2l2fDwHaN4h6W-OxxgoYkb0IUAeCpYH5bociuO_oxVL9L0wLg5vqnNfJa0ehQwqY&_nc_zt=14&_nc_ht=scontent-sjc3-1.xx&_nc_gid=49D7P4N6a4mVqUW8WdOxag&oh=00_AfNkQcMpUNFcM7tF1M5tAHmVwABzLx5QKUU8CFo69NP3Rg&oe=685A4518",
"watermarked_resized_image_url": "",
"image_crops": []
}
],
"link_description": "🔥Best Seller-Last Day Sale 60% OFF🔥 Buckled Square Heel Sandals for Women",
"link_url": "https://www.ghemshop.com/products/buckled-square",
"page_categories": [
"Musician"
],
"page_entity_type": "PERSON_PROFILE",
"page_is_profile_page": false,
"page_like_count": 7,
"title": "🔥Best Seller-Last Day Sale 60% OFF🔥 Buckled Square Heel Sandals for Women",
"videos": [],
"additional_info": null,
"ec_certificates": [],
"extra_images": [],
"extra_links": [],
"extra_texts": [],
"extra_videos": []
},
"total_active_time": null,
"spend": null,
"start_date": 1747638000,
"publisher_platform": [
"FACEBOOK"
],
"url": "https://www.facebook.com/ads/library?id=1378176106734781",
"start_date_string": "2025-05-19T07:00:00.000Z",
"end_date_string": "2025-05-19T07:00:00.000Z"
}
],
"searchResultsCount": 50001,
"cursor": "AQHRLKHyzb3ZNTn1O3qr6lG7ncS9gfboI0HWGSDETVUnipTSXVY8E4Wb-568JBicOvYS"
}
}
Last modified on September 21, 2026

