{
  "openapi": "3.0.1",
  "info": {
    "title": "SiteVerdict — Search Console & GA4 Analyst",
    "description": "Find out why Google traffic dropped. Compares two periods in Search Console + GA4 with your own read-only Google access: ranking lost vs CTR drop vs demand vs deindexed (URL Inspection), quick wins, cannibalisation, tracking/consent red flags, top 10 actions.",
    "version": "1.0",
    "x-build-id": "eoYRcVpKcUcs6sxLj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/siteverdict~siteverdict-gsc-ga4-analyst/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-siteverdict-siteverdict-gsc-ga4-analyst",
        "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/siteverdict~siteverdict-gsc-ga4-analyst/runs": {
      "post": {
        "operationId": "runs-sync-siteverdict-siteverdict-gsc-ga4-analyst",
        "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/siteverdict~siteverdict-gsc-ga4-analyst/run-sync": {
      "post": {
        "operationId": "run-sync-siteverdict-siteverdict-gsc-ga4-analyst",
        "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": {
          "authMethod": {
            "title": "Google access",
            "enum": [
              "sample",
              "serviceAccount",
              "oauth"
            ],
            "type": "string",
            "description": "How the Actor reads YOUR data. 'Sample data' runs on a built-in fictional shop so you can see the report for free. 'Service account' (recommended): paste a Google Cloud service-account JSON key and add its email as a user in Search Console and GA4. 'OAuth': your own OAuth client + refresh token. Read-only scopes only; credentials are used in memory for the run and never written to the output.",
            "default": "sample"
          },
          "serviceAccountJson": {
            "title": "Service-account JSON key",
            "type": "string",
            "description": "Paste the full JSON key file of a Google Cloud service account (Google Cloud console > IAM & Admin > Service accounts > Keys > Add key > JSON). Enable 'Google Search Console API' and 'Google Analytics Data API' in that project, then add the service account's client_email as a user in Search Console (Restricted is enough) and as a Viewer in GA4. Stored encrypted by Apify; never logged or output."
          },
          "oauthClientId": {
            "title": "OAuth client ID",
            "type": "string",
            "description": "Only for the OAuth method: client ID of your own OAuth client (Google Cloud console > APIs & Services > Credentials)."
          },
          "oauthClientSecret": {
            "title": "OAuth client secret",
            "type": "string",
            "description": "Only for the OAuth method: the client secret of the same OAuth client."
          },
          "oauthRefreshToken": {
            "title": "OAuth refresh token",
            "type": "string",
            "description": "Only for the OAuth method: a refresh token issued to that client with the scopes webmasters.readonly and analytics.readonly (e.g. from the Google OAuth 2.0 Playground with 'Use your own OAuth credentials'). Tokens from apps left in 'Testing' status expire after 7 days."
          },
          "properties": {
            "title": "Properties to analyse",
            "type": "array",
            "description": "One entry per site: {\"label\": \"My shop\", \"gscSiteUrl\": \"sc-domain:example.com\" or \"https://www.example.com/\", \"ga4PropertyId\": \"123456789\"}. Either field may be omitted. The GA4 Property ID is the number in GA4 Admin > Property details (not the G- measurement ID). Each entry is billed once as 'property-analysed'. Ignored in sample mode."
          },
          "comparison": {
            "title": "Compare with",
            "enum": [
              "previous_period",
              "year_over_year",
              "custom"
            ],
            "type": "string",
            "description": "Previous period = the N days just before. Year over year = the same N days 52 weeks earlier (weekday-aligned; best for seasonal sites). Custom = your own dates below.",
            "default": "previous_period"
          },
          "periodDays": {
            "title": "Period length (days)",
            "minimum": 7,
            "maximum": 180,
            "type": "integer",
            "description": "Length of the current period for previous-period and year-over-year comparisons. Search Console keeps 16 months of data.",
            "default": 28
          },
          "dataLagDays": {
            "title": "Skip the most recent days",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Search Console data is usually final after 2-3 days, so the current period ends this many days before today.",
            "default": 3
          },
          "currentStartDate": {
            "title": "Custom: current period start",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "YYYY-MM-DD. Only used when 'Compare with' is Custom."
          },
          "currentEndDate": {
            "title": "Custom: current period end",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "YYYY-MM-DD, inclusive."
          },
          "previousStartDate": {
            "title": "Custom: comparison period start",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "YYYY-MM-DD. Leave empty to use the same number of days just before the current period."
          },
          "previousEndDate": {
            "title": "Custom: comparison period end",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "YYYY-MM-DD, inclusive."
          },
          "searchType": {
            "title": "Search type",
            "enum": [
              "web",
              "image",
              "video",
              "news",
              "discover",
              "googleNews"
            ],
            "type": "string",
            "description": "Which Search Console report to analyse.",
            "default": "web"
          },
          "brandTerms": {
            "title": "Brand terms",
            "type": "array",
            "description": "Words that identify brand searches (e.g. your company name and misspellings). Brand queries are excluded from opportunities and cannibalisation and reported separately.",
            "items": {
              "type": "string"
            }
          },
          "minImpressions": {
            "title": "Minimum impressions",
            "minimum": 1,
            "type": "integer",
            "description": "Queries/pages need at least this many impressions in the current period to be listed as an opportunity or cannibalisation case.",
            "default": 100
          },
          "maxUrlInspections": {
            "title": "Max URL inspections per property",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "The top losing pages are checked with Google's URL Inspection API to confirm deindexing / canonical changes. Each inspection is billed as 'url-inspected'. Google allows 2,000 inspections per site per day. 0 = off.",
            "default": 10
          },
          "includeGa4Realtime": {
            "title": "Check GA4 Realtime",
            "type": "boolean",
            "description": "Also calls runRealtimeReport (last 30 minutes) to confirm the GA4 tag is receiving data right now.",
            "default": true
          },
          "dataState": {
            "title": "Search Console data freshness",
            "enum": [
              "final",
              "all"
            ],
            "type": "string",
            "description": "'final' uses finalised data only; 'all' includes fresh (still changing) data.",
            "default": "final"
          },
          "maxRowsPerQuery": {
            "title": "Max rows per report",
            "minimum": 1000,
            "maximum": 250000,
            "type": "integer",
            "description": "Cap on rows fetched per Search Console / GA4 report (pages, queries, landing pages). Search Console exposes at most 50,000 rows per day per search type; large sites can raise this.",
            "default": 25000
          },
          "maxTableRows": {
            "title": "Rows per evidence table",
            "minimum": 5,
            "maximum": 200,
            "type": "integer",
            "description": "How many rows each finding's evidence table shows in the dataset and HTML report (full tables are in the data-* key-value record).",
            "default": 25
          },
          "inspectionLanguage": {
            "title": "URL Inspection language",
            "type": "string",
            "description": "BCP-47 language for coverage messages from the URL Inspection API.",
            "default": "en-GB"
          },
          "ctrCurve": {
            "title": "Custom CTR curve (optional)",
            "type": "array",
            "description": "Optional list of 10-20 expected CTRs (0-1) for positions 1, 2, 3... Replaces the built-in benchmark curve for opportunity estimates."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}