{
  "openapi": "3.1.0",
  "info": {
    "title": "AdsLibrary API",
    "version": "1.1.0",
    "description": "Cross-Platform Commercial Ads Library & Competitor Ad Creative API. Search active commercial video & image ads across Meta Ad Library (Facebook/Instagram) and Google Ads Transparency, inspect advertiser brand dossiers, and audit ad destination landing pages & tracking pixels via REST, Remote MCP, and x402 Base Mainnet USDC.",
    "contact": {
      "name": "AdsLibrary API Support",
      "email": "support@adslibraryapi.com",
      "url": "https://adslibraryapi.com"
    }
  },
  "servers": [
    {
      "url": "https://api.adslibraryapi.com",
      "description": "Production Gateway"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    },
    {
      "BearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Your AdsLibrary API key (ad_live_...). Claim 3,000 Free Credits ($0.30) on sign-up at https://adslibraryapi.com/signup."
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer ad_live_... or OAuth 2.1 MCP token (mcp_at_...)."
      }
    }
  },
  "paths": {
    "/v1/ads/search": {
      "get": {
        "operationId": "searchCommercialAds",
        "summary": "Search Active Commercial Video & Image Ads (Meta + Google)",
        "description": "Search active commercial ads by keyword, niche, or brand across Meta Ad Library (Facebook/Instagram) and Google Ads Transparency. Cost: 2 Credits / ad returned (0 Credits on empty/error).",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "description": "Search keyword, niche, or brand name (e.g. CRM software, shopify).",
            "schema": { "type": "string", "example": "CRM software" }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "2-letter ISO country code (US, GB, CA, AU, DE) or ALL.",
            "schema": { "type": "string", "default": "US" }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Filter ad network rail: all (Meta + Google), social (Meta Ad Library), or search (Google Ads Transparency).",
            "schema": { "type": "string", "enum": ["all", "social", "search"], "default": "all" }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum ads to return (1–50, default 20).",
            "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 20 }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from previous response next_cursor.",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Normalized commercial ad creatives",
            "content": {
              "application/json": {
                "example": {
                  "code": 0,
                  "provider": "https://adslibraryapi.com",
                  "status": "ok",
                  "msg": "success",
                  "data": {
                    "query": "CRM software",
                    "country": "US",
                    "platform": "all",
                    "count": 2,
                    "total_available": 30,
                    "next_cursor": "AQHR2a...",
                    "has_more": true,
                    "ads": [
                      {
                        "ad_id": "4372345546373308",
                        "platform": "meta",
                        "publisher_platforms": ["facebook", "instagram"],
                        "advertiser_id": "1877258095867146",
                        "advertiser_name": "Aspire Software",
                        "page_profile_url": "https://www.facebook.com/YourAspireSoftware/",
                        "page_like_count": 4820,
                        "verified": true,
                        "is_active": true,
                        "format": "video",
                        "start_date": "2026-10-14T16:42:13.000Z",
                        "days_running": 43,
                        "winner_signal": "high_winner",
                        "winner_badge": "Running 43d · High Winner Signal",
                        "collation_count": 3,
                        "hook_copy": "You don't scale to $10M+ by guessing. The fastest-growing service teams all reached a point where basic software became a liability.",
                        "headline": "Why top landscape companies switch",
                        "cta_text": "Learn More",
                        "cta_type": "LEARN_MORE",
                        "landing_page_url": "https://www.youraspire.com/go/landscape-software-solutions",
                        "display_domain": "youraspire.com",
                        "media": {
                          "video_hd_url": "https://video-bos5-1.xx.fbcdn.net/o1/v/t2/f2/m366/sample.mp4",
                          "video_sd_url": null,
                          "image_url": null,
                          "thumbnail_url": "https://scontent-bos5-1.xx.fbcdn.net/v/t39.35426-6/sample.jpg",
                          "preview_url": null
                        },
                        "countries": ["US"],
                        "ad_library_url": "https://www.facebook.com/ads/library/?id=4372345546373308"
                      }
                    ]
                  },
                  "meta": {
                    "endpoint": "/v1/ads/search",
                    "credits_charged": 2,
                    "cached": false,
                    "took_ms": 684
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ads/advertiser": {
      "get": {
        "operationId": "getAdvertiserDossier",
        "summary": "Get Competitor Brand & Advertiser Active Ads Dossier",
        "description": "Retrieve all active commercial ads, verified advertiser status, approximate Google active ad count, format breakdown, top CTAs, and top destination landing pages for a brand domain or company name across Meta + Google. Cost: 2 Credits / ad returned.",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "description": "Target brand domain (e.g. monday.com, shopify.com).",
            "schema": { "type": "string", "example": "monday.com" }
          },
          {
            "name": "advertiser",
            "in": "query",
            "required": false,
            "description": "Brand or advertiser page name (optional if domain is provided).",
            "schema": { "type": "string", "example": "monday" }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "2-letter ISO country code (default US).",
            "schema": { "type": "string", "default": "US" }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Filter by all (default), social (Meta), or search (Google Ads Transparency).",
            "schema": { "type": "string", "enum": ["all", "social", "search"], "default": "all" }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max ads to return (1–50, default 20).",
            "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 20 }
          }
        ],
        "responses": {
          "200": {
            "description": "Unified advertiser dossier and active commercial ads",
            "content": {
              "application/json": {
                "example": {
                  "code": 0,
                  "provider": "https://adslibraryapi.com",
                  "status": "ok",
                  "msg": "success",
                  "data": {
                    "advertiser": {
                      "query": "monday.com",
                      "domain": "monday.com",
                      "brand_name": "monday.com LTD",
                      "verified": true,
                      "country": "US",
                      "approx_google_ads_count": 7300,
                      "meta_ads_sampled": 12,
                      "google_ads_sampled": 20,
                      "platforms_detected": ["meta", "google"],
                      "longest_running_days": 68,
                      "format_breakdown": { "video": 11, "image": 5, "text": 4 },
                      "top_ctas": [{ "cta": "Sign Up", "count": 7 }, { "cta": "Learn More", "count": 5 }],
                      "top_landing_pages": [{ "url": "https://monday.com/lp/crm", "count": 6 }]
                    },
                    "count": 20,
                    "ads": [
                      {
                        "ad_id": "CR04542300452393320449",
                        "platform": "google",
                        "publisher_platforms": ["youtube", "google_display"],
                        "advertiser_id": "AR15972262369074085889",
                        "advertiser_name": "monday.com LTD",
                        "verified": true,
                        "is_active": true,
                        "format": "video",
                        "start_date": "2026-10-16T16:42:13.000Z",
                        "days_running": 41,
                        "winner_signal": "high_winner",
                        "winner_badge": "Running 41d · High Winner Signal",
                        "display_domain": "monday.com",
                        "ad_library_url": "https://adstransparency.google.com/advertiser/AR15972262369074085889/creative/CR04542300452393320449?region=US"
                      }
                    ]
                  },
                  "meta": {
                    "endpoint": "/v1/ads/advertiser",
                    "credits_charged": 40,
                    "cached": false,
                    "took_ms": 912
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/ads/landing-page-audit": {
      "get": {
        "operationId": "auditAdLandingPage",
        "summary": "Audit Ad Destination Landing Page Headline, Offer, CTAs & Tracking Pixels",
        "description": "Inspect any public ad destination landing page URL in real time to extract above-the-fold H1 headline, offer structure, CTAs, redirect hops, and 12 tracking pixels (meta_pixel, gtag, gtm, tiktok_pixel, linkedin_insight, hubspot, klaviyo, segment, hotjar, clarity). Cost: 10 Credits / audit (0 Credits on error).",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "Public HTTP/HTTPS landing page URL (e.g. https://monday.com).",
            "schema": { "type": "string", "example": "https://monday.com" }
          }
        ],
        "responses": {
          "200": {
            "description": "Landing page funnel and tracking pixel audit report",
            "content": {
              "application/json": {
                "example": {
                  "code": 0,
                  "provider": "https://adslibraryapi.com",
                  "status": "ok",
                  "msg": "success",
                  "data": {
                    "url": "https://monday.com",
                    "final_url": "https://monday.com/",
                    "domain": "monday.com",
                    "http_status": 200,
                    "redirect_hops": 0,
                    "response_time_ms": 342,
                    "title": "monday.com | A new way of working",
                    "headline": "Made for work, designed to love",
                    "offer_structure": {
                      "pricing_mentions": [],
                      "has_free_trial": true,
                      "has_demo_cta": true,
                      "has_discount_offer": false,
                      "has_money_back_guarantee": false,
                      "has_no_card_claim": true,
                      "offer_tags": ["free_trial", "demo_funnel", "no_credit_card"]
                    },
                    "ctas": [
                      { "text": "Get Started", "href": "https://monday.com/signup" },
                      { "text": "Request a Demo", "href": "https://monday.com/demo" }
                    ],
                    "tracking_pixels": {
                      "meta_pixel": { "detected": true, "ids": ["295249218502011"] },
                      "gtag": { "detected": true, "ids": ["G-4K2R19M8P2"] },
                      "gtm": { "detected": true, "ids": ["GTM-W9B5K2"] },
                      "tiktok_pixel": { "detected": false, "ids": [] },
                      "linkedin_insight": { "detected": true, "ids": ["1482910"] },
                      "hubspot": { "detected": false, "ids": [] },
                      "klaviyo": { "detected": false, "ids": [] },
                      "segment": { "detected": false, "ids": [] },
                      "hotjar": { "detected": false, "ids": [] },
                      "clarity": { "detected": false, "ids": [] },
                      "snapchat_pixel": { "detected": false, "ids": [] },
                      "pinterest_tag": { "detected": false, "ids": [] }
                    },
                    "pixels_detected_count": 4,
                    "ad_readiness_score": 95
                  },
                  "meta": {
                    "endpoint": "/v1/ads/landing-page-audit",
                    "credits_charged": 10,
                    "cached": false,
                    "took_ms": 348
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Gateway Health Check",
        "description": "Free (0 Credits) health probe returning gateway status and active coverage rails.",
        "security": [],
        "responses": {
          "200": {
            "description": "Gateway healthy"
          }
        }
      }
    }
  }
}
