{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Ads Affiliate Checker — Ad Links & Redirects",
    "description": "Detect sponsored results, affiliate links, redirects, tracking domains, and ad landing pages from supplied SERP snapshots or controlled live checks.",
    "version": "1.0",
    "x-build-id": "5iaeo0oBwHObiokle"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/junipr~google-ads-affiliate-checker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-junipr-google-ads-affiliate-checker",
        "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/junipr~google-ads-affiliate-checker/runs": {
      "post": {
        "operationId": "runs-sync-junipr-google-ads-affiliate-checker",
        "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/junipr~google-ads-affiliate-checker/run-sync": {
      "post": {
        "operationId": "run-sync-junipr-google-ads-affiliate-checker",
        "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": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keywords to check Google Ads for. Max 100 keywords per run.",
            "default": [
              "best vpn service"
            ],
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Country code for Google search (ISO 3166-1 alpha-2, e.g., US, GB, DE). Affects which ads are shown.",
            "default": "US"
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Language code for Google search (ISO 639-1, e.g., en, es, fr).",
            "default": "en"
          },
          "location": {
            "title": "Location",
            "type": "string",
            "description": "Specific location for geo-targeted ads (e.g., 'New York, NY', 'London'). Leave empty for country-level results.",
            "default": ""
          },
          "followRedirects": {
            "title": "Follow Redirects",
            "type": "boolean",
            "description": "Follow redirect chains to find final destination URL. Required for affiliate detection.",
            "default": false
          },
          "maxRedirects": {
            "title": "Max Redirects",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of redirects to follow per ad link (1-20).",
            "default": 3
          },
          "detectCloaking": {
            "title": "Detect Cloaking",
            "type": "boolean",
            "description": "Detect URL cloaking techniques (JavaScript redirects, meta refresh, iframe wraps).",
            "default": false
          },
          "checkLandingPage": {
            "title": "Check Landing Page",
            "type": "boolean",
            "description": "Load the final landing page to check for additional affiliate markers (cookies, scripts).",
            "default": false
          },
          "customAffiliatePatterns": {
            "title": "Custom Affiliate Patterns",
            "type": "array",
            "description": "Additional URL patterns to detect as affiliate links (regex strings). Use for private/custom affiliate networks.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeOrganicResults": {
            "title": "Include Organic Results",
            "type": "boolean",
            "description": "Also capture organic results for context (top 10).",
            "default": false
          },
          "includeAdCopy": {
            "title": "Include Ad Copy",
            "type": "boolean",
            "description": "Include the ad headline and description text in output.",
            "default": true
          },
          "onlyAffiliateAds": {
            "title": "Only Affiliate Ads",
            "type": "boolean",
            "description": "Only output ads detected as affiliate links (filter out direct advertiser ads).",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings. Residential proxies are required — Google blocks datacenter IPs for SERP scraping.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "maxChargeUsd": {
            "title": "Max Charge USD",
            "minimum": 0,
            "type": "number",
            "description": "Stop before paid output would exceed the configured max charge.",
            "default": 50
          },
          "debugMode": {
            "title": "Debug Mode",
            "type": "boolean",
            "description": "Write extra free diagnostics to the key-value store.",
            "default": false
          },
          "saveRawHtmlToKvs": {
            "title": "Save Raw HTML to KVS",
            "type": "boolean",
            "description": "Save raw snapshots as free debug artifacts when enabled.",
            "default": false
          },
          "requestTimeout": {
            "title": "Request Timeout (ms)",
            "minimum": 1000,
            "maximum": 120000,
            "type": "integer",
            "description": "Maximum time to wait for a request or page load.",
            "default": 30000
          },
          "maxRetries": {
            "title": "Max Retries",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "Maximum retry attempts per source.",
            "default": 1
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "Maximum concurrent requests. High-risk marketplace and SERP actors default to a low value.",
            "default": 1
          },
          "serpMode": {
            "title": "SERP Mode",
            "enum": [
              "suppliedSnapshot",
              "provider"
            ],
            "type": "string",
            "description": "Use suppliedSnapshot by default. Provider mode requires an approved SERP provider key. Direct live Google scraping is not the default.",
            "default": "suppliedSnapshot"
          },
          "suppliedSerpSnapshots": {
            "title": "Supplied SERP Snapshots",
            "type": "array",
            "description": "SERP snapshot objects with keyword and html/providerJson fields.",
            "items": {
              "type": "object"
            },
            "default": []
          },
          "serpProviderApiKey": {
            "title": "SERP Provider API Key",
            "type": "string",
            "description": "API key for approved provider mode."
          },
          "sourceMode": {
            "title": "Source Mode",
            "enum": [
              "livePublic",
              "suppliedSnapshot",
              "provider"
            ],
            "type": "string",
            "description": "Use public live targets, supplied snapshots, or provider-backed source data when supported.",
            "default": "livePublic"
          },
          "suppliedSnapshotHtml": {
            "title": "Supplied Snapshot HTML",
            "type": "string",
            "description": "Optional HTML snapshot for deterministic public-data extraction tests or controlled source capture."
          },
          "suppliedSnapshotJson": {
            "title": "Supplied Snapshot JSON",
            "type": "string",
            "description": "Optional JSON snapshot/provider response for deterministic public-data extraction tests or controlled source capture."
          },
          "suppliedSnapshotText": {
            "title": "Supplied Snapshot Text",
            "type": "string",
            "description": "Optional plain text snapshot for text-analysis actors."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}