{
  "openapi": "3.0.1",
  "info": {
    "title": "Hybrid Ad Intelligence Scraper",
    "description": "Scrape competitor ads from Google Ads Transparency & Meta Ads Library, optionally enriched with Poweradspy metrics. Features LLM self-healing fallback, landing page tech detection (Shopify, WooCommerce), global deduplication, and automated inspiration reports.",
    "version": "1.0",
    "x-build-id": "qxttgQYL9wFmeP4gf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/solutionssmart~hybrid-ad-intelligence-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-solutionssmart-hybrid-ad-intelligence-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/solutionssmart~hybrid-ad-intelligence-scraper/runs": {
      "post": {
        "operationId": "runs-sync-solutionssmart-hybrid-ad-intelligence-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/solutionssmart~hybrid-ad-intelligence-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-solutionssmart-hybrid-ad-intelligence-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "auto",
              "free",
              "poweradspy"
            ],
            "type": "string",
            "description": "Select how the Actor should behave. Auto will use Poweradspy if credentials exist, otherwise free sources.",
            "default": "auto"
          },
          "freeSources": {
            "title": "Free Sources",
            "type": "array",
            "description": "Select public ad libraries to scrape in free/auto mode.",
            "items": {
              "type": "string",
              "enum": [
                "google_ads_transparency",
                "meta_ads_library"
              ],
              "enumTitles": [
                "Google Ads Transparency",
                "Meta Ads Library"
              ]
            },
            "default": [
              "google_ads_transparency"
            ]
          },
          "searchKeywords": {
            "title": "Search Keywords (Legacy)",
            "type": "string",
            "description": "Single keyword string for backward compatibility."
          },
          "keywords": {
            "title": "Keywords List",
            "type": "array",
            "description": "Multiple keywords to search across sources.",
            "items": {
              "type": "string"
            }
          },
          "advertiserNames": {
            "title": "Advertiser Names",
            "type": "array",
            "description": "Filter by specific advertiser names (if supported by source).",
            "items": {
              "type": "string"
            }
          },
          "adPlatform": {
            "title": "Ad Platform",
            "enum": [
              "facebook",
              "instagram",
              "google",
              "youtube",
              "tiktok",
              "all"
            ],
            "type": "string",
            "description": "Target platform (Poweradspy / Meta options).",
            "default": "facebook"
          },
          "poweradspyEmail": {
            "title": "Poweradspy Email",
            "type": "string",
            "description": "Your Poweradspy account email."
          },
          "poweradspyPassword": {
            "title": "Poweradspy Password",
            "type": "string",
            "description": "Your Poweradspy account password."
          },
          "enablePoweradspyEnrichment": {
            "title": "Enable Enrichment",
            "type": "boolean",
            "description": "Matches free results with Poweradspy for additional metrics.",
            "default": false
          },
          "maxResultsPerSource": {
            "title": "Max Results Per Source",
            "type": "integer",
            "description": "Maximum number of ad results to collect from each source (e.g. Google, Meta, Poweradspy).",
            "default": 50
          },
          "googleAdvertisersToScan": {
            "title": "Google advertisers to scan",
            "type": "integer",
            "description": "Cost-control setting for Google Ads Transparency. Maximum number of advertiser suggestion pages to open per keyword.",
            "default": 2
          },
          "googleDetailPagesToVisit": {
            "title": "Google detail pages to visit",
            "type": "integer",
            "description": "Cost-control setting for Google Ads Transparency. Number of creative detail pages to open for richer metadata after collecting cheap preview cards.",
            "default": 3
          },
          "maxTotalResults": {
            "title": "Max Total Results",
            "type": "integer",
            "description": "Maximum total unique ads to keep after deduplication across all sources.",
            "default": 100
          },
          "dedupeBy": {
            "title": "Deduplicate By",
            "type": "array",
            "description": "Fields used to identify duplicate ads; ads matching on these keys are merged into one.",
            "items": {
              "type": "string",
              "enum": [
                "landingPageUrl",
                "creativeUrl",
                "title"
              ],
              "enumTitles": [
                "Landing Page URL",
                "Creative Media URL",
                "Ad Title/Text"
              ]
            },
            "default": [
              "landingPageUrl",
              "creativeUrl"
            ]
          },
          "fallbackToMockAdsWhenEmpty": {
            "title": "Fallback to mock ads when empty",
            "type": "boolean",
            "description": "When free sources return 0 ads (e.g. Google DOM changed), return sample mock ads so the run has output. Set to false to get 0 items instead.",
            "default": true
          },
          "extractionEngine": {
            "title": "Extraction Engine",
            "enum": [
              "selectors",
              "stagehand_fallback"
            ],
            "type": "string",
            "description": "Use CSS selectors only, or allow Stagehand (LLM) fallback when selectors fail.",
            "default": "stagehand_fallback"
          },
          "stagehandEnabled": {
            "title": "Enable Stagehand Module",
            "type": "boolean",
            "description": "When extraction fails, use Stagehand (LLM) to extract ad data from the page.",
            "default": true
          },
          "stagehandModelProvider": {
            "title": "Stagehand Model Config (JSON)",
            "type": "object",
            "description": "E.g. {\"provider\": \"openai\"}",
            "default": {
              "provider": "openai"
            }
          },
          "enableLandingPlatformDetection": {
            "title": "Enable Landing Platform Detection",
            "type": "boolean",
            "description": "Detect landing page platform (e.g. Shopify, WooCommerce) via HTTP requests.",
            "default": true
          },
          "enrichmentMaxConcurrency": {
            "title": "Enrichment Concurrency",
            "type": "integer",
            "description": "Number of concurrent HTTP requests for landing platform detection.",
            "default": 3
          },
          "enrichmentMaxRequestsPerMinute": {
            "title": "Enrichment RPM Limit",
            "type": "integer",
            "description": "Maximum HTTP requests per minute for landing page analysis.",
            "default": 30
          },
          "enrichmentHttpTimeoutMs": {
            "title": "Enrichment HTTP Timeout",
            "type": "integer",
            "description": "Timeout in milliseconds for each landing page HTTP request.",
            "default": 15000
          },
          "reportFormat": {
            "title": "Report Format",
            "enum": [
              "none",
              "html",
              "markdown"
            ],
            "type": "string",
            "description": "Format of the inspiration report saved to the Key-Value store.",
            "default": "html"
          },
          "includeHtmlReport": {
            "title": "Legacy HTML Report (Deprecated)",
            "type": "boolean",
            "description": "Also generate an HTML report; use reportFormat for preferred output.",
            "default": false
          },
          "headless": {
            "title": "Headless Browser",
            "type": "boolean",
            "description": "Run browser in headless mode (no visible window).",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional Apify proxy configuration for browser requests."
          },
          "metaAccessToken": {
            "title": "Meta Developer Token (Optional)",
            "type": "string",
            "description": "Meta/Facebook developer access token for Meta Ads Library API."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}