Political and issue ads with spend — Meta ad library
meta-ad-library.meta-ads.library.politicalSearch political and issue ads and see who paid for them and roughly how much
- Price
- freeAt provider cost
- Success rate
- —No success-rate data yetNo success-rate data yet
- Latency p50
- ——
- Last verified
- —Not verified yet
GEThttps://toolswitch.dev/v1/tools/meta-ad-library.meta-ads.library.politicalPreview- Uses platform quota
- Synchronous response
- Reads public data
Parameters
spend and impressions are RANGES — {"lower_bound":"100","upper_bound":"499"} — never point values, so totals across ads can only be reported as a range. demographic_distribution and delivery_by_region come back as percentage breakdowns that sum to ~1. Political ads stay in the library for seven years, unlike commercial ones
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| Query parameters | ||||
limit | integer | Optional | 25 | |
fields | string | Required | the disclosure fields only exist on this ad_type | id,page_name,bylines,currency,spend,impressions,demographic_distribution,delivery_by_region,ad_creative_bodies,ad_delivery_start_time,ad_delivery_stop_time |
ad_type | string | Required | POLITICAL_AND_ISSUE_ADS — this is what unlocks the spend/impressions/demographic fields | POLITICAL_AND_ISSUE_ADS |
bylines | array | Optional | JSON array of exact paid-for-by disclaimers; POLITICAL_AND_ISSUE_ADS only | |
search_terms | string | Optional | climate | |
delivery_by_region | array | Optional | state / province names; POLITICAL_AND_ISSUE_ADS only | ["California"] |
ad_delivery_date_min | string | Optional | YYYY-MM-DD | |
ad_reached_countries | array | Required | ["US"] | |
- Query parameters
limitintegerOptionalExample:
25fieldsstringRequiredthe disclosure fields only exist on this ad_type
Example:
id,page_name,bylines,currency,spend,impressions,demographic_distribution,delivery_by_region,ad_creative_bodies,ad_delivery_start_time,ad_delivery_stop_timead_typestringRequiredPOLITICAL_AND_ISSUE_ADS — this is what unlocks the spend/impressions/demographic fields
Example:
POLITICAL_AND_ISSUE_ADSbylinesarrayOptionalJSON array of exact paid-for-by disclaimers; POLITICAL_AND_ISSUE_ADS only
search_termsstringOptionalExample:
climatedelivery_by_regionarrayOptionalstate / province names; POLITICAL_AND_ISSUE_ADS only
Example:
["California"]ad_delivery_date_minstringOptionalYYYY-MM-DD
ad_reached_countriesarrayRequiredExample:
["US"]
Code samples
Replace $TOOLSWITCH_KEY with the key you created in the console.
curl -X GET 'https://toolswitch.dev/v1/tools/meta-ad-library.meta-ads.library.political' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/meta-ad-library.meta-ads.library.political",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/meta-ad-library.meta-ads.library.political", {
method: "GET",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
},
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());This gateway API is in preview; its URL and authentication may change. The example parameters are sample data. Calls are billed at free, including the service fee.