
Meta Ads Library API: Track Competitor Ad Campaigns
Access Meta's Ad Library data through APIMux to monitor competitor campaigns, analyze ad creatives, and discover winning strategies across Facebook and Instagram—without manual searching.
Meta's Ad Library is a goldmine for competitive intelligence: every active ad on Facebook and Instagram is publicly searchable. But manually browsing the Ad Library is tedious, and Meta doesn't offer a straightforward API for programmatic access.
APIMux provides a clean API for Meta Ads Library data, letting you track competitor campaigns, analyze ad creatives, and discover winning strategies at scale.
Why Meta Ads Intelligence Matters
If you're running paid campaigns on Facebook or Instagram, you need to know:
- What ads are your competitors running?
- What messaging and creatives are they testing?
- How long have their ads been active?
- What landing pages are they driving traffic to?
- What audiences are they targeting (inferred from ad copy)?
Manual Ad Library searches give you snapshots. APIMux gives you systematic intelligence.
APIMux's Meta Ads Capabilities
1. Search Ads
Find ads by keyword, advertiser, or topic:
apimux meta_ads search_ads \
--q "fitness app"Returns:
- Ad ID and creation date
- Advertiser name and page ID
- Ad creative snapshot
- Platforms (Facebook, Instagram, Messenger, Audience Network, Threads)
- Active status and date range
- Categories
You can filter by country, ad type, status, media type, platforms, and date range:
apimux meta_ads search_ads \
--q "fitness" \
--country US \
--ad-type all \
--active-status active \
--media-type video \
--platforms facebook,instagram \
--start-date 2026-02-01 \
--end-date 2026-02-28Filter options:
--ad-type: all, political_and_issue_ads, housing_ads, employment_ads, credit_ads--active-status: active, inactive, all--media-type: all, video, image, meme, image_and_meme, none--platforms: facebook, instagram, audience_network, messenger, threads (comma-separated)
For pagination, use the --next-page-token from the previous response:
apimux meta_ads search_ads \
--q "Nike" \
--next-page-token "abc123..."2. Get Ad Detail
Detailed information for a specific ad:
apimux meta_ads get_ad_detail --ad-id 123456789Returns:
- EU transparency data (if applicable)
- Political insights (if applicable)
- Verified voice context (if applicable)
Real-World Use Cases
Use Case 1: Competitor Campaign Monitoring
Track what your competitors are advertising:
# Search for ads from a specific advertiser
apimux meta_ads search_ads --q "Nike" > nike_ads.json
# Filter to active ads only
jq '.[] | select(.is_active == true)' nike_ads.json > active_ads.json
# Count ads by platform
jq '[.[] | .publisher_platforms[]] | group_by(.) | map({platform: .[0], count: length})' nike_ads.jsonThis shows you:
- How many active campaigns they're running
- What platforms they're prioritizing
- How their messaging varies across campaigns
Use Case 2: Creative Analysis
Identify winning ad formats:
# Get all ads for a competitor
apimux meta_ads search_ads --q "Peloton" > peloton.json
# Analyze by media type
jq 'group_by(.snapshot.media_type) | map({type: .[0].snapshot.media_type, count: length})' peloton.jsonThis reveals:
- Video vs image ad ratio
- Which creative formats they're testing most
- How long different ad types stay active
Use Case 3: Messaging Strategy
Discover what messaging resonates:
# Search for ads in your category
apimux meta_ads search_ads --q "meal kit delivery" > meal_kits.json
# Extract common themes
jq -r '.[].snapshot.title' meal_kits.json | \
tr '[:upper:]' '[:lower:]' | \
grep -oE '\b(save|free|easy|healthy|fresh|organic|quick)\b' | \
sort | uniq -c | sort -rnCommon themes:
- "free" (45 mentions)
- "fresh" (38 mentions)
- "easy" (32 mentions)
- "healthy" (28 mentions)
Insight: Competitors emphasize convenience and freshness over price.
Use Case 4: Landing Page Analysis
See where competitors drive traffic:
# Get ads and extract landing pages
apimux meta_ads search_ads --q "SaaS CRM" | \
jq -r '.[].snapshot.link_url' | \
sort | uniq -c | sort -rnResults:
- 45 ads → homepage
- 32 ads → free trial page
- 18 ads → pricing page
- 12 ads → specific feature pages
Insight: Most competitors drive to free trial, not homepage.
Use Case 5: Seasonal Campaign Tracking
Monitor how campaigns change over time:
# Get ads from different time periods
apimux meta_ads search_ads \
--q "project management software" \
--start-date 2026-01-01 \
--end-date 2026-01-31 > jan_ads.json
apimux meta_ads search_ads \
--q "project management software" \
--start-date 2026-02-01 \
--end-date 2026-02-28 > feb_ads.json
# Compare messaging
diff <(jq -r '.[].snapshot.title' jan_ads.json | sort) \
<(jq -r '.[].snapshot.title' feb_ads.json | sort)This reveals:
- New campaigns launched
- Discontinued campaigns
- Messaging shifts (e.g., "New Year productivity" → "Q1 planning")
Use Case 6: Competitive Spend Estimation
For political/social issue ads, you can see spend ranges:
# Search for political ads
apimux meta_ads search_ads \
--q "climate change" \
--ad-type political_and_issue_ads > political_ads.json
# Get detailed spend data
for ad_id in $(jq -r '.[0:10].ad_id' political_ads.json); do
apimux meta_ads get_ad_detail --ad-id "$ad_id"
done > ad_details.json
# Analyze spend ranges
jq '.political_insights.spend_range' ad_details.jsonAdvanced Techniques
Technique 1: Ad Longevity Analysis
Find ads that have been running for a long time (likely winners):
apimux meta_ads search_ads --q "Asana" > asana_ads.json
# Calculate days active
jq '[.[] | {
ad_id: .ad_id,
start: .start_date,
end: .end_date,
days_active: (((.end_date | fromdateiso8601) - (.start_date | fromdateiso8601)) / 86400 | floor)
}] | sort_by(-.days_active) | .[0:10]' asana_ads.jsonAds running 90+ days are likely performing well.
Technique 2: Platform Strategy
See which platforms competitors prioritize:
apimux meta_ads search_ads --q "Shopify" > shopify_ads.json
# Count by platform
jq '[.[].publisher_platforms[]] | group_by(.) | map({platform: .[0], count: length}) | sort_by(-.count)' shopify_ads.jsonResults:
- Facebook: 145 ads
- Instagram: 132 ads
- Audience Network: 45 ads
- Messenger: 12 ads
Insight: Shopify prioritizes Facebook and Instagram equally.
Technique 3: CTA Analysis
Identify common calls-to-action:
apimux meta_ads search_ads --q "e-commerce platform" > ecommerce_ads.json
# Extract CTAs from snapshots
jq -r '.[].snapshot.cta_text' ecommerce_ads.json | \
sort | uniq -c | sort -rnTop CTAs:
- "Start Free Trial" (67 ads)
- "Learn More" (45 ads)
- "Sign Up" (32 ads)
- "Get Started" (28 ads)
Technique 4: Competitive Timing
Track when competitors launch new campaigns:
# Get ads from the past week
apimux meta_ads search_ads \
--q "Asana" \
--start-date 2026-02-18 > asana_week1.json
# Next week
apimux meta_ads search_ads \
--q "Asana" \
--start-date 2026-02-25 > asana_week2.json
# Find new ads
comm -13 <(jq -r '.[].ad_id' asana_week1.json | sort) \
<(jq -r '.[].ad_id' asana_week2.json | sort)This reveals when competitors launch new campaigns (often tied to product launches or seasonal events).
Pricing
Credit usage depends on the current APIMux billing configuration and may vary by capability and account plan. Check the latest pricing and billing pages before planning production workloads.
Data Freshness
- Ad Library data: Updated every 24 hours
- Active status: Updated daily
- New ads appear within 24 hours of going live
Best Practices
1. Search by advertiser name, not product:
- Good: "Nike"
- Bad: "running shoes"
2. Use date filters to focus on recent campaigns:
- Recent ads (last 30 days) show current strategy
- Historical ads show evolution over time
3. Track competitors weekly:
- Set up a cron job to pull competitor ads weekly
- Compare week-over-week to spot new campaigns
4. Combine with landing page analysis:
- Use a tool like BuiltWith to see what tech stack competitors use
- Check if landing pages are optimized for mobile
Limitations
APIMux provides public Ad Library data only:
- No access to targeting criteria (age, interests, etc.)
- No access to performance metrics (CTR, conversions)
- No access to your own ad account data (use Meta's official API for that)
Ethical Considerations
Ad Library data is public, but:
- Don't copy competitors' ads verbatim
- Use insights to inform your strategy, not plagiarize
- Respect intellectual property (images, videos, copy)
Next Steps
Combine Meta Ads data with other APIMux sources:
- Meta Ads + Google Trends: Validate ad themes with search volume
- Meta Ads + Reddit: See if advertised products are discussed in communities
- Meta Ads + Amazon: Check if advertised products sell well on Amazon
Visit the documentation for complete Meta Ads API reference.
APIMux provides clean access to Meta's Ad Library. Start tracking competitor campaigns today.
Author
Categories
More Posts

Amazon Data Intelligence: 14 Capabilities for E-commerce Research
APIMux provides complete coverage of Amazon data with 14 capabilities spanning product search, reviews, sales trends, BSR tracking, and market analysis. Learn how to use these tools for product selection, competitive analysis, and market research.

Getting Started with APIMux CLI: Authentication & First API Call
A step-by-step tutorial on installing the APIMux CLI, authenticating with device-flow, and making your first API call. Learn how to explore capabilities, understand output formats, and track your usage.

Introducing APIMux: Unified Data API Platform for AI Agents
APIMux aggregates data from 9 major platforms into a single, standardized API. Built for AI agents and developers who need reliable, structured data without the complexity of managing multiple integrations.