Fetch Search Ads Pages (POST)
curl --request POST \
--url https://api.agntdata.dev/v1/data/facebook/fetch_search_ads_pages \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "",
"ad_page_id": "1633779800049051",
"country": "ALL",
"activeStatus": "ALL",
"end_cursor": "",
"after_time": "",
"before_time": "",
"sort_data": ""
}
'import requests
url = "https://api.agntdata.dev/v1/data/facebook/fetch_search_ads_pages"
payload = {
"query": "",
"ad_page_id": "1633779800049051",
"country": "ALL",
"activeStatus": "ALL",
"end_cursor": "",
"after_time": "",
"before_time": "",
"sort_data": ""
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '',
ad_page_id: '1633779800049051',
country: 'ALL',
activeStatus: 'ALL',
end_cursor: '',
after_time: '',
before_time: '',
sort_data: ''
})
};
fetch('https://api.agntdata.dev/v1/data/facebook/fetch_search_ads_pages', 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.agntdata.dev/v1/data/facebook/fetch_search_ads_pages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '',
'ad_page_id' => '1633779800049051',
'country' => 'ALL',
'activeStatus' => 'ALL',
'end_cursor' => '',
'after_time' => '',
'before_time' => '',
'sort_data' => ''
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.agntdata.dev/v1/data/facebook/fetch_search_ads_pages"
payload := strings.NewReader("{\n \"query\": \"\",\n \"ad_page_id\": \"1633779800049051\",\n \"country\": \"ALL\",\n \"activeStatus\": \"ALL\",\n \"end_cursor\": \"\",\n \"after_time\": \"\",\n \"before_time\": \"\",\n \"sort_data\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.agntdata.dev/v1/data/facebook/fetch_search_ads_pages")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"\",\n \"ad_page_id\": \"1633779800049051\",\n \"country\": \"ALL\",\n \"activeStatus\": \"ALL\",\n \"end_cursor\": \"\",\n \"after_time\": \"\",\n \"before_time\": \"\",\n \"sort_data\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agntdata.dev/v1/data/facebook/fetch_search_ads_pages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"\",\n \"ad_page_id\": \"1633779800049051\",\n \"country\": \"ALL\",\n \"activeStatus\": \"ALL\",\n \"end_cursor\": \"\",\n \"after_time\": \"\",\n \"before_time\": \"\",\n \"sort_data\": \"\"\n}"
response = http.request(request)
puts response.read_body{}Meta Ads Library Search
Fetch Search Ads Pages (POST)
This endpoint retrieves detailed information about ad pages based on a search query, returning up to 26 ads per request. Use the end_cursor parameter to retrieve additional ads if needed.
POST
/
v1
/
data
/
facebook
/
fetch_search_ads_pages
Fetch Search Ads Pages (POST)
curl --request POST \
--url https://api.agntdata.dev/v1/data/facebook/fetch_search_ads_pages \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "",
"ad_page_id": "1633779800049051",
"country": "ALL",
"activeStatus": "ALL",
"end_cursor": "",
"after_time": "",
"before_time": "",
"sort_data": ""
}
'import requests
url = "https://api.agntdata.dev/v1/data/facebook/fetch_search_ads_pages"
payload = {
"query": "",
"ad_page_id": "1633779800049051",
"country": "ALL",
"activeStatus": "ALL",
"end_cursor": "",
"after_time": "",
"before_time": "",
"sort_data": ""
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '',
ad_page_id: '1633779800049051',
country: 'ALL',
activeStatus: 'ALL',
end_cursor: '',
after_time: '',
before_time: '',
sort_data: ''
})
};
fetch('https://api.agntdata.dev/v1/data/facebook/fetch_search_ads_pages', 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.agntdata.dev/v1/data/facebook/fetch_search_ads_pages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '',
'ad_page_id' => '1633779800049051',
'country' => 'ALL',
'activeStatus' => 'ALL',
'end_cursor' => '',
'after_time' => '',
'before_time' => '',
'sort_data' => ''
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.agntdata.dev/v1/data/facebook/fetch_search_ads_pages"
payload := strings.NewReader("{\n \"query\": \"\",\n \"ad_page_id\": \"1633779800049051\",\n \"country\": \"ALL\",\n \"activeStatus\": \"ALL\",\n \"end_cursor\": \"\",\n \"after_time\": \"\",\n \"before_time\": \"\",\n \"sort_data\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.agntdata.dev/v1/data/facebook/fetch_search_ads_pages")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"\",\n \"ad_page_id\": \"1633779800049051\",\n \"country\": \"ALL\",\n \"activeStatus\": \"ALL\",\n \"end_cursor\": \"\",\n \"after_time\": \"\",\n \"before_time\": \"\",\n \"sort_data\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agntdata.dev/v1/data/facebook/fetch_search_ads_pages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"\",\n \"ad_page_id\": \"1633779800049051\",\n \"country\": \"ALL\",\n \"activeStatus\": \"ALL\",\n \"end_cursor\": \"\",\n \"after_time\": \"\",\n \"before_time\": \"\",\n \"sort_data\": \"\"\n}"
response = http.request(request)
puts response.read_body{}Authorizations
Bearer token. Pass your agntdata API key as: Authorization: Bearer agnt_live_...
Body
application/json
Search query string
Facebook Ad Page ID. Used only if query is not provided.
Country filter (e.g. ALL, US, GB)
Filter by active status (e.g. ALL, ACTIVE, INACTIVE)
Pagination cursor for next page of results
Filter ads created after this time
Filter ads created before this time
Sort order for results
Response
Successful response
The response is of type object.
⌘I