{
  "openapi": "3.0.1",
  "info": {
    "title": "Ad Library Intelligence (Google, LinkedIn & TikTok)",
    "description": "Monitor competitors' ads in the Google Ads Transparency Center and LinkedIn Ad Library, and top ads in TikTok Creative Center. Normalized ad records plus change events: new ads, ended ads, creative refreshes, new regions and new landing domains.",
    "version": "0.1",
    "x-build-id": "ONIjI8LoyX9wUN6Ew"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/almoutasem_nabil~ad-library-intelligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-almoutasem_nabil-ad-library-intelligence",
        "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/almoutasem_nabil~ad-library-intelligence/runs": {
      "post": {
        "operationId": "runs-sync-almoutasem_nabil-ad-library-intelligence",
        "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/almoutasem_nabil~ad-library-intelligence/run-sync": {
      "post": {
        "operationId": "run-sync-almoutasem_nabil-ad-library-intelligence",
        "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",
        "properties": {
          "advertisers": {
            "title": "Advertisers",
            "type": "array",
            "description": "Advertisers to check: { name, domain, googleAdvertiserId (AR…), linkedinCompanyId or linkedinUrl }. Name alone works on both libraries (LinkedIn is searched by advertiser name); add the domain or the Google id to avoid ambiguity (the run summary lists candidates when a name is ambiguous)."
          },
          "platforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Which libraries to read. Google and LinkedIn are advertiser-based (see Advertisers); TikTok is query-based (see TikTok queries) and uses a headless browser. LinkedIn requests go through Apify residential proxies automatically, because LinkedIn blocks datacenter IPs; that traffic is billed to your account as residential proxy usage (about $0.30-0.40 per 1,000 LinkedIn ads).",
            "items": {
              "type": "string",
              "enum": [
                "google",
                "linkedin",
                "tiktok"
              ],
              "enumTitles": [
                "Google Ads Transparency Center",
                "LinkedIn Ad Library",
                "TikTok Creative Center (Top Ads)"
              ]
            },
            "default": [
              "google",
              "linkedin",
              "tiktok"
            ]
          },
          "googleRegion": {
            "title": "Google region",
            "type": "string",
            "description": "Region filter for the Google Ads Transparency Center: 'anywhere' or an ISO-2 country code (US, AE, SA, GB...).",
            "default": "anywhere"
          },
          "tiktokQueries": {
            "title": "TikTok queries",
            "type": "array",
            "description": "TikTok has no per-advertiser search, so each entry is a Top Ads query: { keyword, region (ISO-2, default SA), objective (e.g. conversion, traffic, app_install), period (7|30|180, default 30) }. Without login TikTok shows the top 20 ads per query. Region/period/objective queries are reliable; keyword queries are often sparse on TikTok's side and may return nothing."
          },
          "activeOnly": {
            "title": "Active ads only",
            "type": "boolean",
            "description": "Keep only ads that are currently running (Google: shown within the last 7 days; LinkedIn: listed in the library without an end date).",
            "default": true
          },
          "lastNDays": {
            "title": "Last N days",
            "minimum": 0,
            "type": "integer",
            "description": "Ignore ads whose last-shown date is older than this many days. 0 = no limit.",
            "default": 90
          },
          "maxAdsPerAdvertiser": {
            "title": "Max ads per advertiser",
            "minimum": 0,
            "type": "integer",
            "description": "Cap per advertiser (and per TikTok query). 0 = unlimited. Google needs one extra paced request per new ad to resolve its regions, so a first snapshot of many advertisers takes minutes. The prefilled 5 keeps a first test run to a minute or two; use 20-200 for real monitoring.",
            "default": 200
          },
          "emitChangesOnly": {
            "title": "Emit changes only",
            "type": "boolean",
            "description": "Output only change events (new_ad, ad_ended, creative_refresh, new_landing_domain, new_region, advertiser_error) compared with the previous run under the same trackingId. A run with nothing to report contains one free no_changes row that says why.",
            "default": false
          },
          "emitBaselineAsNew": {
            "title": "Emit baseline as new",
            "type": "boolean",
            "description": "On the first run for a trackingId, emit every ad as new_ad instead of a silent baseline.",
            "default": false
          },
          "trackingId": {
            "title": "Tracking ID",
            "type": "string",
            "description": "Name of the watch list. State is kept in the 'ad-intel-state' key-value store under this key. Required with 'Emit changes only'."
          },
          "refreshThreshold": {
            "title": "Creative refresh threshold",
            "minimum": 1,
            "type": "integer",
            "description": "New ads from one advertiser (or TikTok query) in a single run that count as a creative_refresh event.",
            "default": 5
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Google and LinkedIn advertiser sources checked in parallel (LinkedIn is additionally paced to one request per second; TikTok queries always run one at a time).",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy for Google and TikTok; Apify datacenter proxies (the default) work for both. LinkedIn always uses Apify residential proxies, whatever is set here.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}