{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn, Google & TikTok Ads Library Scraper (Ad Spy)",
    "description": "Extract B2B & DTC ad creatives from LinkedIn Ad Library, Google Ads Transparency Center, and TikTok Creative Center via direct XHR/RPC & TLS requests (zero Playwright). Includes EU DSA impression ranges, UTM-cleaned landing domains for Clay/n8n, delta mode (onlyNew), and PPE billing.",
    "version": "1.0",
    "x-build-id": "FIZFiBfqgfTrDE1vX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vesper_studio~multi-network-ad-spy/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vesper_studio-multi-network-ad-spy",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/vesper_studio~multi-network-ad-spy/runs": {
      "post": {
        "operationId": "runs-sync-vesper_studio-multi-network-ad-spy",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/vesper_studio~multi-network-ad-spy/run-sync": {
      "post": {
        "operationId": "run-sync-vesper_studio-multi-network-ad-spy",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "networks"
        ],
        "properties": {
          "networks": {
            "title": "Ad Networks",
            "uniqueItems": true,
            "type": "array",
            "description": "Select which ad transparency / creative networks to extract from.",
            "items": {
              "type": "string",
              "enum": [
                "linkedin",
                "google",
                "tiktok"
              ],
              "enumTitles": [
                "LinkedIn Ad Library (B2B / ABM)",
                "Google Ads Transparency Center (Search / Display / YouTube + DSA)",
                "TikTok Creative Center (Top Ads)"
              ]
            },
            "default": [
              "linkedin",
              "google",
              "tiktok"
            ]
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Search keywords (used directly in LinkedIn Ad Library keyword search, as fallback query in Google Suggestions, and as optional local filter on TikTok Top Ads).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "advertisers": {
            "title": "Competitor / Advertiser Names or IDs",
            "type": "array",
            "description": "Company/advertiser names (e.g. 'HubSpot', 'Salesforce'), Google Advertiser IDs (e.g. 'AR10072600183532683265'), or domains (e.g. 'hubspot.com'). Used by LinkedIn (accountOwner) and Google Ads Transparency Center.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "domains": {
            "title": "Advertiser Domains (Google Ads)",
            "type": "array",
            "description": "Explicit domains to look up on Google Ads Transparency Center (e.g. 'hubspot.com', 'monday.com'). Any domain-like value in 'advertisers' is also queried automatically.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "countries": {
            "title": "Target Countries (ISO-2)",
            "type": "array",
            "description": "Optional ISO 3166-1 alpha-2 country codes (e.g. 'US', 'FR', 'DE', 'GB', 'CA'). Leave empty for global / all regions. EU countries unlock DSA impression ranges on LinkedIn & Google.",
            "items": {
              "type": "string"
            },
            "default": [
              "US",
              "FR"
            ]
          },
          "dateRange": {
            "title": "Date Window",
            "enum": [
              "any",
              "7d",
              "30d",
              "180d"
            ],
            "type": "string",
            "description": "Lookback period for ad activity (maps to LinkedIn dateOption, TikTok period, and Google creative recency).",
            "default": "30d"
          },
          "adFormats": {
            "title": "Ad Formats Filter",
            "uniqueItems": true,
            "type": "array",
            "description": "Filter by creative format. Leave as 'all' to capture every ad format.",
            "items": {
              "type": "string",
              "enum": [
                "all",
                "text",
                "image",
                "video",
                "carousel",
                "message"
              ],
              "enumTitles": [
                "All formats",
                "Text",
                "Image / Single Image",
                "Video",
                "Carousel / Document",
                "Message / Conversation Ad"
              ]
            },
            "default": [
              "all"
            ]
          },
          "tiktokIndustry": {
            "title": "TikTok Industry Filter (Optional)",
            "type": "string",
            "description": "Optional TikTok Creative Center industry name (e.g. 'Business Services', 'Tech & Electronics', 'App', 'E-Commerce') or numeric industry ID (e.g. '24000000000').",
            "default": ""
          },
          "tiktokOrderBy": {
            "title": "TikTok Sort Order",
            "enum": [
              "like",
              "ctr",
              "impression",
              "for_you"
            ],
            "type": "string",
            "description": "How TikTok Top Ads are ranked when fetching.",
            "default": "like"
          },
          "enrichDetails": {
            "title": "Enrich Ad Details (Landing URL, DSA Impressions & Media)",
            "type": "boolean",
            "description": "Fetch per-ad detail endpoints (LinkedIn detail page, Google GetCreativeById, TikTok detail API) to retrieve landingPageUrl, EU DSA impressionsRange, country breakdown, dates, and high-res mediaUrls.",
            "default": true
          },
          "extractLandingDomainInfo": {
            "title": "Clean UTMs & Extract Landing Domain (Clay/n8n Ready)",
            "type": "boolean",
            "description": "Strips UTM and ad-tracking parameters (utm_*, gclid, ttclid, li_fat_id, trk, etc.) from landingPageUrl and populates clean advertiserDomain for instant B2B enrichment in Clay or n8n.",
            "default": true
          },
          "onlyNew": {
            "title": "Delta Mode (Only New Ads)",
            "type": "boolean",
            "description": "Store seen ad IDs in Apify Key-Value Store and only output & charge for newly launched creatives since previous runs.",
            "default": false
          },
          "deltaStoreKey": {
            "title": "Delta State KV Key",
            "type": "string",
            "description": "Key-Value Store record name used when onlyNew=true. Customize this to isolate separate competitor watchlists.",
            "default": "seen_ads"
          },
          "maxAdsPerNetwork": {
            "title": "Max Ads Per Network",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum creatives to collect per selected network.",
            "default": 50
          },
          "maxTotalAds": {
            "title": "Max Total Ads",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on total creatives pushed across all networks in a single run.",
            "default": 150
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration (Optional)",
            "type": "object",
            "description": "Optional Apify Proxy settings. Disabled by default so Google Ads and TikTok Creative Center run proxy-free at minimal cost. Note: LinkedIn Ad Library blocks AWS datacenter IPs on Apify Cloud (HTTP 403) — enable Apify Residential Proxy when scraping LinkedIn remotely.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}