{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Ads Transparency Scraper + LinkedIn Ad Library API",
    "description": "Scrape any competitor's ads from the Google Ads Transparency Center (Search, Display, YouTube) and the LinkedIn Ad Library: advertiser, format, ad text, image/video, first and last shown, days running, regions. Search by name, domain or advertiser ID. No login, no browser. $1 per 1,000 ads.",
    "version": "0.1",
    "x-build-id": "9WN9Z9oBUgWcAdkdh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/johnveds15~ad-library-competitor-ads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-johnveds15-ad-library-competitor-ads",
        "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/johnveds15~ad-library-competitor-ads/runs": {
      "post": {
        "operationId": "runs-sync-johnveds15-ad-library-competitor-ads",
        "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/johnveds15~ad-library-competitor-ads/run-sync": {
      "post": {
        "operationId": "run-sync-johnveds15-ad-library-competitor-ads",
        "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": {
          "competitors": {
            "title": "Competitors",
            "type": "array",
            "description": "One per line: a company name (HubSpot), a website domain (hubspot.com) or a Google advertiser id (AR13611357312189988865). Names and domains are searched on both libraries; an AR id is Google-only. Up to 50.",
            "default": [
              "hubspot.com"
            ],
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "title": "Ad libraries",
            "type": "array",
            "description": "Which public ad libraries to search. LinkedIn refuses Apify datacenter IPs (403, tested 2026-10-04): add LinkedIn only together with a RESIDENTIAL proxy group below.",
            "items": {
              "type": "string",
              "enum": [
                "google",
                "linkedin"
              ],
              "enumTitles": [
                "Google Ads Transparency Center",
                "LinkedIn Ad Library"
              ]
            },
            "default": [
              "google"
            ]
          },
          "maxAdsPerSource": {
            "title": "Max ads per competitor per library",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Caps rows and cost. Newest ads come first.",
            "default": 40
          },
          "googleRegion": {
            "title": "Google: region",
            "type": "string",
            "description": "Only ads shown in this country: a 2-letter code (US, GB, DE, ...) or a Google geo id (2840). 'anywhere' = all regions.",
            "default": "anywhere"
          },
          "linkedinCountries": {
            "title": "LinkedIn: countries",
            "type": "array",
            "description": "2-letter codes (US, GB, ...). Empty = all countries.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "linkedinDateOption": {
            "title": "LinkedIn: date range",
            "enum": [
              "any",
              "last-30-days",
              "current-month",
              "current-year",
              "last-year"
            ],
            "type": "string",
            "description": "Only ads that ran in this window.",
            "default": "any"
          },
          "linkedinExactAdvertiser": {
            "title": "LinkedIn: only the competitor's own ads",
            "type": "boolean",
            "description": "LinkedIn's advertiser search is fuzzy (searching 'hubspot' also returns partners and people promoting their own posts). On = keep only ads whose advertiser name contains the competitor name. Off = keep everything LinkedIn returns.",
            "default": true
          },
          "includeDetails": {
            "title": "Fetch per-ad details",
            "type": "boolean",
            "description": "One extra request per ad: Google adds the regions each ad ran in (with the last-shown date per region) and its variation count; LinkedIn adds the full ad text, the advertiser's company page and the 'Paid for by' entity. Slower; same price.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy (optional)",
            "type": "object",
            "description": "Off by default: Google answers plain requests. LinkedIn needs the RESIDENTIAL group (datacenter IPs get 403). Also turn on if Google reports 'blocked' on a large run.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}