Facebook Ad Library scraper API. Live data from any public link.
Get public ads, advertisers and transcripts by link or search, with ads in the same fields as on 3 other platforms. We handle the proxies, blocks and platform changes.
GET socialtap.dev/v1/facebook/ad
Live data from 33 platforms.
What Facebook Ad Library data can you get?
Ads from Meta's public Ad Library, on Facebook, Instagram, Messenger, Threads and the Audience Network, with creatives, run dates and advertiser. Search ads by keyword, list an advertiser's ads, or get one ad with its EU and UK audience, the payer, reach and spend of political and social-issue ads, and the transcript of its video. Find advertisers by name, with their Page ID and followers. Part of the Facebook API.
Ads
Ad Transcript
Why not the official Facebook Ad Library API?
Meta's Ad Library API needs identity verification, and outside the EU and UK it only returns ads about social issues, elections or politics.
No approval to wait for
One API key works on every endpoint. There's no app to get reviewed and no account to connect.
Anything public
Read what anyone can see without logging in, not only the accounts you manage or that authorized your app.
No daily quota
You pay per request. Plans have no rate limit, only a ceiling that stops a runaway loop.
Call the Facebook Ad Library API from your code.
Copy the request for your language, or hand it to your agent.
const params = new URLSearchParams({
url: "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=DE&id=1103375555695370&media_type=all",
});
const res = await fetch(`https://socialtap.dev/v1/facebook/ad?${params}`, {
headers: { "x-api-key": process.env.SOCIALTAP_API_KEY ?? "" },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
const { data, meta } = body;
console.log(data, meta.credits_charged);import os
import requests
res = requests.get(
"https://socialtap.dev/v1/facebook/ad",
params={"url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=DE&id=1103375555695370&media_type=all"},
headers={"x-api-key": os.environ["SOCIALTAP_API_KEY"]},
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['error']['code']}: {body['error']['message']}")
data, meta = body["data"], body["meta"]
print(data, meta["credits_charged"])require "json"
require "net/http"
uri = URI("https://socialtap.dev/v1/facebook/ad")
uri.query = URI.encode_www_form('url' => 'https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=DE&id=1103375555695370&media_type=all')
req = Net::HTTP::Get.new(uri)
req["x-api-key"] = ENV.fetch("SOCIALTAP_API_KEY")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
body = JSON.parse(res.body)
raise "#{body["error"]["code"]}: #{body["error"]["message"]}" unless res.is_a?(Net::HTTPSuccess)
pp body["data"]
puts body["meta"]["credits_charged"]<?php
$query = http_build_query([
'url' => 'https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=DE&id=1103375555695370&media_type=all',
]);
$ch = curl_init('https://socialtap.dev/v1/facebook/ad?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['x-api-key: ' . getenv('SOCIALTAP_API_KEY')],
]);
$body = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body['data']);
echo $body['meta']['credits_charged'], PHP_EOL;package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
"os"
)
func main() {
q := url.Values{}
q.Set("url", "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=DE&id=1103375555695370&media_type=all")
req, err := http.NewRequest("GET", "https://socialtap.dev/v1/facebook/ad?"+q.Encode(), nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("x-api-key", os.Getenv("SOCIALTAP_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
var body struct {
Data json.RawMessage `json:"data"`
Meta map[string]any `json:"meta"`
Error *struct {
Code string `json:"code"`
Message string `json:"message"`
} `json:"error"`
}
if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
log.Fatal(err)
}
if body.Error != nil {
log.Fatalf("%s: %s", body.Error.Code, body.Error.Message)
}
fmt.Println(string(body.Data), body.Meta["credits_charged"])
}curl -G 'https://socialtap.dev/v1/facebook/ad' \
--data-urlencode 'url=https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=DE&id=1103375555695370&media_type=all' \
-H "x-api-key: $SOCIALTAP_API_KEY"GET https://socialtap.dev/v1/facebook/adDocs const params = new URLSearchParams({
query: "baileys",
});
const res = await fetch(`https://socialtap.dev/v1/facebook/search_advertisers?${params}`, {
headers: { "x-api-key": process.env.SOCIALTAP_API_KEY ?? "" },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
const { data, page, meta } = body;
console.log(data, meta.credits_charged);import os
import requests
res = requests.get(
"https://socialtap.dev/v1/facebook/search_advertisers",
params={"query": "baileys"},
headers={"x-api-key": os.environ["SOCIALTAP_API_KEY"]},
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['error']['code']}: {body['error']['message']}")
data, page, meta = body["data"], body["page"], body["meta"]
print(data, meta["credits_charged"])require "json"
require "net/http"
uri = URI("https://socialtap.dev/v1/facebook/search_advertisers")
uri.query = URI.encode_www_form('query' => 'baileys')
req = Net::HTTP::Get.new(uri)
req["x-api-key"] = ENV.fetch("SOCIALTAP_API_KEY")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
body = JSON.parse(res.body)
raise "#{body["error"]["code"]}: #{body["error"]["message"]}" unless res.is_a?(Net::HTTPSuccess)
pp body["data"]
puts body["meta"]["credits_charged"]<?php
$query = http_build_query([
'query' => 'baileys',
]);
$ch = curl_init('https://socialtap.dev/v1/facebook/search_advertisers?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['x-api-key: ' . getenv('SOCIALTAP_API_KEY')],
]);
$body = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body['data']);
echo $body['meta']['credits_charged'], PHP_EOL;package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
"os"
)
func main() {
q := url.Values{}
q.Set("query", "baileys")
req, err := http.NewRequest("GET", "https://socialtap.dev/v1/facebook/search_advertisers?"+q.Encode(), nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("x-api-key", os.Getenv("SOCIALTAP_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
var body struct {
Data json.RawMessage `json:"data"`
Page json.RawMessage `json:"page"`
Meta map[string]any `json:"meta"`
Error *struct {
Code string `json:"code"`
Message string `json:"message"`
} `json:"error"`
}
if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
log.Fatal(err)
}
if body.Error != nil {
log.Fatalf("%s: %s", body.Error.Code, body.Error.Message)
}
fmt.Println(string(body.Data), body.Meta["credits_charged"])
}curl 'https://socialtap.dev/v1/facebook/search_advertisers?query=baileys' \
-H "x-api-key: $SOCIALTAP_API_KEY"GET https://socialtap.dev/v1/facebook/search_advertisersDocs const params = new URLSearchParams({
url: "https://www.facebook.com/ads/library/?id=1448538159982118",
});
const res = await fetch(`https://socialtap.dev/v1/facebook/ad_transcript?${params}`, {
headers: { "x-api-key": process.env.SOCIALTAP_API_KEY ?? "" },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
const { data, meta } = body;
console.log(data, meta.credits_charged);import os
import requests
res = requests.get(
"https://socialtap.dev/v1/facebook/ad_transcript",
params={"url": "https://www.facebook.com/ads/library/?id=1448538159982118"},
headers={"x-api-key": os.environ["SOCIALTAP_API_KEY"]},
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['error']['code']}: {body['error']['message']}")
data, meta = body["data"], body["meta"]
print(data, meta["credits_charged"])require "json"
require "net/http"
uri = URI("https://socialtap.dev/v1/facebook/ad_transcript")
uri.query = URI.encode_www_form('url' => 'https://www.facebook.com/ads/library/?id=1448538159982118')
req = Net::HTTP::Get.new(uri)
req["x-api-key"] = ENV.fetch("SOCIALTAP_API_KEY")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
body = JSON.parse(res.body)
raise "#{body["error"]["code"]}: #{body["error"]["message"]}" unless res.is_a?(Net::HTTPSuccess)
pp body["data"]
puts body["meta"]["credits_charged"]<?php
$query = http_build_query([
'url' => 'https://www.facebook.com/ads/library/?id=1448538159982118',
]);
$ch = curl_init('https://socialtap.dev/v1/facebook/ad_transcript?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['x-api-key: ' . getenv('SOCIALTAP_API_KEY')],
]);
$body = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body['data']);
echo $body['meta']['credits_charged'], PHP_EOL;package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
"os"
)
func main() {
q := url.Values{}
q.Set("url", "https://www.facebook.com/ads/library/?id=1448538159982118")
req, err := http.NewRequest("GET", "https://socialtap.dev/v1/facebook/ad_transcript?"+q.Encode(), nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("x-api-key", os.Getenv("SOCIALTAP_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
var body struct {
Data json.RawMessage `json:"data"`
Meta map[string]any `json:"meta"`
Error *struct {
Code string `json:"code"`
Message string `json:"message"`
} `json:"error"`
}
if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
log.Fatal(err)
}
if body.Error != nil {
log.Fatalf("%s: %s", body.Error.Code, body.Error.Message)
}
fmt.Println(string(body.Data), body.Meta["credits_charged"])
}curl -G 'https://socialtap.dev/v1/facebook/ad_transcript' \
--data-urlencode 'url=https://www.facebook.com/ads/library/?id=1448538159982118' \
-H "x-api-key: $SOCIALTAP_API_KEY"GET https://socialtap.dev/v1/facebook/ad_transcriptDocs const params = new URLSearchParams({
handle: "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=20531316728&search_type=page&media_type=all",
});
const res = await fetch(`https://socialtap.dev/v1/facebook/ads?${params}`, {
headers: { "x-api-key": process.env.SOCIALTAP_API_KEY ?? "" },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
const { data, page, meta } = body;
console.log(data, meta.credits_charged);import os
import requests
res = requests.get(
"https://socialtap.dev/v1/facebook/ads",
params={"handle": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=20531316728&search_type=page&media_type=all"},
headers={"x-api-key": os.environ["SOCIALTAP_API_KEY"]},
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['error']['code']}: {body['error']['message']}")
data, page, meta = body["data"], body["page"], body["meta"]
print(data, meta["credits_charged"])require "json"
require "net/http"
uri = URI("https://socialtap.dev/v1/facebook/ads")
uri.query = URI.encode_www_form('handle' => 'https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=20531316728&search_type=page&media_type=all')
req = Net::HTTP::Get.new(uri)
req["x-api-key"] = ENV.fetch("SOCIALTAP_API_KEY")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
body = JSON.parse(res.body)
raise "#{body["error"]["code"]}: #{body["error"]["message"]}" unless res.is_a?(Net::HTTPSuccess)
pp body["data"]
puts body["meta"]["credits_charged"]<?php
$query = http_build_query([
'handle' => 'https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=20531316728&search_type=page&media_type=all',
]);
$ch = curl_init('https://socialtap.dev/v1/facebook/ads?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['x-api-key: ' . getenv('SOCIALTAP_API_KEY')],
]);
$body = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body['data']);
echo $body['meta']['credits_charged'], PHP_EOL;package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
"os"
)
func main() {
q := url.Values{}
q.Set("handle", "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=20531316728&search_type=page&media_type=all")
req, err := http.NewRequest("GET", "https://socialtap.dev/v1/facebook/ads?"+q.Encode(), nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("x-api-key", os.Getenv("SOCIALTAP_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
var body struct {
Data json.RawMessage `json:"data"`
Page json.RawMessage `json:"page"`
Meta map[string]any `json:"meta"`
Error *struct {
Code string `json:"code"`
Message string `json:"message"`
} `json:"error"`
}
if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
log.Fatal(err)
}
if body.Error != nil {
log.Fatalf("%s: %s", body.Error.Code, body.Error.Message)
}
fmt.Println(string(body.Data), body.Meta["credits_charged"])
}curl -G 'https://socialtap.dev/v1/facebook/ads' \
--data-urlencode 'handle=https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=20531316728&search_type=page&media_type=all' \
-H "x-api-key: $SOCIALTAP_API_KEY"GET https://socialtap.dev/v1/facebook/adsDocs const params = new URLSearchParams({
country: "US",
query: "coffee",
});
const res = await fetch(`https://socialtap.dev/v1/facebook/search_ads?${params}`, {
headers: { "x-api-key": process.env.SOCIALTAP_API_KEY ?? "" },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
const { data, page, meta } = body;
console.log(data, meta.credits_charged);import os
import requests
res = requests.get(
"https://socialtap.dev/v1/facebook/search_ads",
params={"country": "US", "query": "coffee"},
headers={"x-api-key": os.environ["SOCIALTAP_API_KEY"]},
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['error']['code']}: {body['error']['message']}")
data, page, meta = body["data"], body["page"], body["meta"]
print(data, meta["credits_charged"])require "json"
require "net/http"
uri = URI("https://socialtap.dev/v1/facebook/search_ads")
uri.query = URI.encode_www_form('country' => 'US', 'query' => 'coffee')
req = Net::HTTP::Get.new(uri)
req["x-api-key"] = ENV.fetch("SOCIALTAP_API_KEY")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
body = JSON.parse(res.body)
raise "#{body["error"]["code"]}: #{body["error"]["message"]}" unless res.is_a?(Net::HTTPSuccess)
pp body["data"]
puts body["meta"]["credits_charged"]<?php
$query = http_build_query([
'country' => 'US',
'query' => 'coffee',
]);
$ch = curl_init('https://socialtap.dev/v1/facebook/search_ads?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['x-api-key: ' . getenv('SOCIALTAP_API_KEY')],
]);
$body = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body['data']);
echo $body['meta']['credits_charged'], PHP_EOL;package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
"os"
)
func main() {
q := url.Values{}
q.Set("country", "US")
q.Set("query", "coffee")
req, err := http.NewRequest("GET", "https://socialtap.dev/v1/facebook/search_ads?"+q.Encode(), nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("x-api-key", os.Getenv("SOCIALTAP_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
var body struct {
Data json.RawMessage `json:"data"`
Page json.RawMessage `json:"page"`
Meta map[string]any `json:"meta"`
Error *struct {
Code string `json:"code"`
Message string `json:"message"`
} `json:"error"`
}
if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
log.Fatal(err)
}
if body.Error != nil {
log.Fatalf("%s: %s", body.Error.Code, body.Error.Message)
}
fmt.Println(string(body.Data), body.Meta["credits_charged"])
}curl 'https://socialtap.dev/v1/facebook/search_ads?country=US&query=coffee' \
-H "x-api-key: $SOCIALTAP_API_KEY"GET https://socialtap.dev/v1/facebook/search_adsDocs Other platforms, same key.
Posts and profiles come back in the same fields wherever they're from.
- 31 endpoints
TikTok
Posts, profiles, comments and more
- 28 endpoints
Instagram
Posts, profiles, comments and more
- 14 endpoints
Facebook
Posts, profiles, comments and more
- 6 endpoints
YouTube
Posts, profiles, comments and more
- 13 endpoints
Reddit
Posts, profiles, comments and more
- 6 endpoints
Threads
Posts, profiles and comments
- 12 endpoints
Spotify
Tracks, artists, playlists and more
- 10 endpoints
Amazon
Products, posts, profiles and more
- 10 endpoints
Apple Music
Tracks, artists, playlists and more
- 10 endpoints
Pinterest
Pins, profiles, boards and more
- 7 endpoints
Rumble
Posts, profiles, comments and more
- 7 endpoints
X
Posts, profiles and communities
- 5 endpoints
Bluesky
Posts, profiles and comments
- 5 endpoints
Twitch
Videos, profiles, transcripts and more
- 4 endpoints
LinkedIn
Posts and profiles
- 4 endpoints
Telegram
Posts and channels
- 4 endpoints
TikTok Shop
Products and reviews
- 3 endpoints
Kwai
Posts and profiles
- 3 endpoints
Snapchat
Spotlights, profiles and comments
- 3 endpoints
SoundCloud
Tracks and artists
- 3 endpoints
Truth Social
Posts and profiles
- 2 endpoints
Kick
Posts and transcripts
- 1 endpoint
Komi
Pages
- 1 endpoint
Lnk.Bio
Profiles
- 1 endpoint
Linkme
Profiles
- 1 endpoint
Linktree
Profiles
- 1 endpoint
Pillar
Pages
- 3 endpoints
TikTok Ad Library
Ads
- 4 endpoints
Facebook Events
Events
- 3 endpoints
Facebook Marketplace
Listings and places
- 6 endpoints
Google Ads Transparency Center
Ads and advertisers
- 2 endpoints
LinkedIn Ad Library
Ads
Where do I find an ad's Library ID?
How do I get an advertiser's ads?
Do ads that stopped running work?
What do I send?
Is the data live?
What does null mean in a response?
Are the fields the same on every platform?
What happens when a platform changes its pages?
Do you read private or logged-in content?
Can my AI agent use it?
Try it on a Facebook Ad Library link you have.
Get a key and send your first request in a minute. The same key works on every platform.
- No credit card
- Failed requests are free
- Works on all 218 endpoints