{
  "openapi": "3.0.1",
  "info": {
    "title": "Ad Intel: Google, Meta & TikTok Ad Library Monitor",
    "description": "One input → Google, Meta & TikTok ad libraries (LinkedIn: beta, opt-in). Resolves brands/domains, unified schema, new/changed/stopped diffs. Pay per ad only — no start fee.",
    "version": "0.1",
    "x-build-id": "42UMDktZTcjv6P1Gk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/chaptersoft~ad-intel-unified-ad-library/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-chaptersoft-ad-intel-unified-ad-library",
        "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/chaptersoft~ad-intel-unified-ad-library/runs": {
      "post": {
        "operationId": "runs-sync-chaptersoft-ad-intel-unified-ad-library",
        "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/chaptersoft~ad-intel-unified-ad-library/run-sync": {
      "post": {
        "operationId": "run-sync-chaptersoft-ad-intel-unified-ad-library",
        "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": [
          "queries"
        ],
        "properties": {
          "queries": {
            "title": "Advertisers to look up",
            "type": "array",
            "description": "One per line. Any mix of: website domain (nike.com), brand name (Notion Labs), Facebook page URL or page ID, Meta Ad Library URL, Google Ads Transparency advertiser URL or AR… ID, LinkedIn company URL or LinkedIn Ad Library URL (used only when LinkedIn is selected). Domains and names are searched on every selected platform; platform-specific URLs only on their platform.",
            "items": {
              "type": "string"
            }
          },
          "platforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Which ad libraries to search. Default: Google, Meta and TikTok. TikTok only publishes ads shown in the EU/EEA, Switzerland and the UK; if none of your countries are there, TikTok searches DE, FR, IT, ES and GB. LinkedIn is off by default: it is experimental and currently blocked by LinkedIn (its Ad Library answers HTTP 403), so it usually returns no ads. Select it only if you want to test it.",
            "items": {
              "type": "string",
              "enum": [
                "google",
                "meta",
                "linkedin",
                "tiktok"
              ],
              "enumTitles": [
                "Google Ads Transparency Center (Search, YouTube, Display, Maps, Play, Shopping)",
                "Meta Ad Library (Facebook, Instagram, Messenger, Audience Network, Threads)",
                "LinkedIn Ad Library (experimental, currently blocked by LinkedIn)",
                "TikTok Ads Library (ads shown in EU/EEA, Switzerland, UK)"
              ]
            },
            "default": [
              "google",
              "meta",
              "tiktok"
            ]
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "ISO 3166-1 alpha-2 codes (US, GB, DE, FR, BR…) or ALL. Meta runs one search per country and merges/dedupes them.",
            "default": [
              "US"
            ],
            "items": {
              "type": "string"
            }
          },
          "activeStatus": {
            "title": "Ad status",
            "enum": [
              "active",
              "inactive",
              "all"
            ],
            "type": "string",
            "description": "Return currently running ads, stopped ads, or both.",
            "default": "active"
          },
          "mediaType": {
            "title": "Media type",
            "enum": [
              "all",
              "image",
              "video",
              "text"
            ],
            "type": "string",
            "description": "Filter by creative type. Applied in the platform query where supported (Google, Meta).",
            "default": "all"
          },
          "dateFrom": {
            "title": "Shown from (YYYY-MM-DD)",
            "type": "string",
            "description": "Only ads shown/started on or after this date. Leave empty for no limit."
          },
          "dateTo": {
            "title": "Shown until (YYYY-MM-DD)",
            "type": "string",
            "description": "Only ads shown/started on or before this date."
          },
          "maxAdsPerPlatform": {
            "title": "Max ads per advertiser per platform",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap that also caps your cost: max cost ≈ queries × platforms × this × price per ad.",
            "default": 50
          },
          "outputMode": {
            "title": "Output (monitoring mode)",
            "enum": [
              "all",
              "new",
              "newOrChanged",
              "changes"
            ],
            "type": "string",
            "description": "Every ad is compared against previous runs stored in a named key-value store. 'New only' is ideal for scheduled runs + webhooks/Slack alerts. You are only charged for ads written to the dataset.",
            "default": "all"
          },
          "monitorKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name for this watchlist's state. Leave empty to derive it from queries + platforms + countries, so the same input always compares with its own history. Use different names to keep separate histories."
          },
          "stateStoreName": {
            "title": "State key-value store name",
            "type": "string",
            "description": "Named store that keeps history between runs (named stores are never auto-deleted).",
            "default": "ad-intel-monitor"
          },
          "fetchDetails": {
            "title": "Fetch ad details",
            "type": "boolean",
            "description": "Google: per-country impressions, surfaces, ad text from preview, video links. LinkedIn: impressions, targeting, payer. Turn off for maximum speed.",
            "default": true
          },
          "ocrTextAds": {
            "title": "Google: read text ads shown only as images (OCR)",
            "type": "boolean",
            "description": "Many Google Search text ads are published only as a rendered snapshot image. On (default): read headline, description and display URL from that image with OCR (tagged extensions.textSource=ocr with a confidence score). English-trained, so non-Latin scripts are less reliable.",
            "default": true
          },
          "metaKeywordSearch": {
            "title": "Meta: treat queries as keywords",
            "type": "boolean",
            "description": "Off (default): brand names/domains are resolved to the advertiser's Facebook page so you get only their ads. On: full-text keyword search across all advertisers.",
            "default": false
          },
          "metaAdType": {
            "title": "Meta: ad category",
            "enum": [
              "all",
              "political_and_issue_ads",
              "housing_ads",
              "employment_ads",
              "credit_ads"
            ],
            "type": "string",
            "description": "Meta Ad Library category. Political/issue ads include spend and EU reach data.",
            "default": "all"
          },
          "tiktokKeywordSearch": {
            "title": "TikTok: fall back to keyword search",
            "type": "boolean",
            "description": "Off (default): only ads from the advertiser whose name matches your query (found via TikTok's advertiser search; a 'did you mean' list is written to OUTPUT otherwise). On: if no advertiser matches, return keyword matches (tagged matchType=keyword).",
            "default": false
          },
          "downloadMedia": {
            "title": "Download images to storage",
            "type": "boolean",
            "description": "Saves creatives to the run's key-value store (URLs from ad platforms expire). Adds storedMedia links to each ad.",
            "default": false
          },
          "downloadVideos": {
            "title": "Also download videos",
            "type": "boolean",
            "description": "Also store video files (can be large). Requires \"Download images to storage\".",
            "default": false
          },
          "includeRaw": {
            "title": "Include raw platform fields",
            "type": "boolean",
            "description": "Adds the untouched platform record under raw (large).",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Used for LinkedIn, which blocks datacenter IPs (Residential is the default). Google, Meta and TikTok always connect directly first and switch to Apify datacenter proxy automatically if blocked, so they never need Residential.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "googleProxy": {
            "title": "Use proxy for Google too",
            "type": "boolean",
            "description": "Google's public RPC usually works without proxy. Enable only if you see 429 errors; uses Apify datacenter proxy (or your own proxy URLs).",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}