{
  "openapi": "3.0.1",
  "info": {
    "title": "Ad Library Scraper — Google, Meta & LinkedIn",
    "description": "Scrape ads from the Google Ads Transparency Center, Meta Ad Library (Facebook and Instagram) and LinkedIn Ad Library in one run. Find competitor ads by keyword, brand or domain and get ad copy, creatives, images, video URLs, impressions and run dates. Export to JSON, CSV or Excel.",
    "version": "1.0",
    "x-build-id": "Ef4DZ33Eugfpjhv8T"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mediocre_interest~ads-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mediocre_interest-ads-library-scraper",
        "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/mediocre_interest~ads-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-mediocre_interest-ads-library-scraper",
        "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/mediocre_interest~ads-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-mediocre_interest-ads-library-scraper",
        "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": {
          "platforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Which ad platforms to scrape. LinkedIn costs roughly one request per ad, so large runs there are slower than Google or Meta.",
            "items": {
              "type": "string",
              "enum": [
                "google",
                "meta",
                "linkedin"
              ]
            },
            "default": [
              "google",
              "meta",
              "linkedin"
            ]
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Free-text keywords. Meta and LinkedIn search ad copy. Google has no ad-text search, so terms are matched against advertiser names or domains instead.",
            "items": {
              "type": "string"
            }
          },
          "advertisers": {
            "title": "Advertisers",
            "type": "array",
            "description": "Advertiser names, Google advertiser IDs (AR…), Meta numeric page IDs, or LinkedIn company IDs.",
            "items": {
              "type": "string"
            }
          },
          "domains": {
            "title": "Domains",
            "type": "array",
            "description": "Advertiser websites, e.g. nike.com. Google filters natively; Meta and LinkedIn have no domain filter and fall back to a keyword search.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Direct URLs",
            "type": "array",
            "description": "Ad Library or Ads Transparency Center URLs to scrape directly.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "matchMode": {
            "title": "Match mode",
            "enum": [
              "phrase",
              "broad"
            ],
            "type": "string",
            "description": "How strictly search terms must match. \"phrase\" requires the words to appear together and uses Meta exact-phrase search; \"broad\" matches the words anywhere, returning far more but much noisier results.",
            "default": "phrase"
          },
          "filterIrrelevant": {
            "title": "Drop irrelevant ads",
            "type": "boolean",
            "description": "Discard ads whose own text does not contain the search terms. Applies to keyword and domain searches on Meta and LinkedIn only — Google exposes no ad copy and is never filtered, and advertiser/URL searches are always kept.",
            "default": true
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "ISO-2 country codes. Meta uses the first entry as its country filter; Google maps them to region codes. LinkedIn has no country filter on search.",
            "default": [
              "US"
            ],
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Earliest ad delivery date, YYYY-MM-DD. Google filters client-side; Meta filters server-side; LinkedIn ignores it."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Latest ad delivery date, YYYY-MM-DD. Google filters client-side; Meta filters server-side; LinkedIn ignores it."
          },
          "googleMaxAdvertisersPerTerm": {
            "title": "Max advertisers per term",
            "minimum": 1,
            "type": "integer",
            "description": "How many matching advertisers to pull creatives from when a keyword is resolved on Google.",
            "default": 3
          },
          "metaActiveStatus": {
            "title": "Ad status",
            "enum": [
              "all",
              "active",
              "inactive"
            ],
            "type": "string",
            "description": "Filter by whether the ad is still running.",
            "default": "all"
          },
          "metaMediaType": {
            "title": "Media type",
            "enum": [
              "all",
              "image",
              "video",
              "meme"
            ],
            "type": "string",
            "description": "Restrict results to a creative media type.",
            "default": "all"
          },
          "metaAdType": {
            "title": "Ad type",
            "enum": [
              "all",
              "political_and_issue_ads",
              "housing_ads",
              "employment_ads",
              "credit_ads"
            ],
            "type": "string",
            "description": "Restrict results to a special ad category, such as political and issue ads. Meta only reports spend and impressions for political and issue ads.",
            "default": "all"
          },
          "linkedinFetchDetails": {
            "title": "Fetch full ad details",
            "type": "boolean",
            "description": "Fetch each ad's detail page for full ad copy, run dates, the impressions range and the per-country breakdown. This costs one extra request per ad. Turning it off returns only what the search card shows: advertiser, headline and truncated copy.",
            "default": true
          },
          "maxAdsPerQuery": {
            "title": "Max ads per query",
            "minimum": 1,
            "type": "integer",
            "description": "Cap on ads collected for each search term, advertiser, or domain. This is per query, so several queries multiply it.",
            "default": 20
          },
          "maxRequestsPerCrawl": {
            "title": "Max requests per crawl",
            "minimum": 1,
            "type": "integer",
            "description": "Overall safety limit on the number of requests. LinkedIn uses roughly one request per ad, so raise this for large LinkedIn runs.",
            "default": 1000
          },
          "includeRaw": {
            "title": "Include raw payload",
            "type": "boolean",
            "description": "Keep each platform's original response under a `raw` key alongside the normalized fields.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional locally, but required on the Apify platform for Meta, which blocks platform IPs. Use the RESIDENTIAL group; datacenter proxies are blocked too."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}