{
  "openapi": "3.0.1",
  "info": {
    "title": "SERP MCP Tracker + AI SEO — Ahrefs $129/mo Alt",
    "description": "Track SERP rankings daily — 99%+ run success. Skyfire/x402 payment-ready. AI SEO audits at $0.003/result. RAG pipeline tool for AI agents. Replaces Ahrefs ($129/mo), SEMrush ($139/mo), AccuRanker ($129/mo) at 10-100x cheaper. MCP/n8n. Tavily/Serper/Brave alt.",
    "version": "1.9",
    "x-build-id": "P1u2oaBtprRs7AQ18"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/harvestlab~google-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-harvestlab-google-search-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/harvestlab~google-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-harvestlab-google-search-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/harvestlab~google-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-harvestlab-google-search-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": {
          "queries": {
            "title": "Search Queries",
            "type": "array",
            "description": "One or more search queries to scrape Google results for.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Search Query (CLI alias)",
            "type": "string",
            "description": "CLI alias for a single-query run. Collapsed into queries[]. Hidden from Console form."
          },
          "query": {
            "title": "Search Query (CLI alias)",
            "type": "string",
            "description": "CLI alias for a single-query run. Collapsed into queries[]. Hidden from Console form."
          },
          "searchTerm": {
            "title": "Search Query (CLI alias)",
            "type": "string",
            "description": "CLI alias for a single-query run. Collapsed into queries[]. Hidden from Console form."
          },
          "maxResults": {
            "title": "Max Results Per Query",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum organic results to scrape per query (1-100). Google shows ~10 results per SERP page, so values above 10 require pagination (slower: +2-3s per extra page). Typical SEO audits use 10-30; deep keyword research uses 50-100.",
            "default": 10
          },
          "maxItems": {
            "title": "Max Items (CLI alias)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "CLI alias for maxResults. Hidden from Console form."
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter ISO 3166-1 alpha-2 country code for localized results. Controls the 'gl' parameter Google uses for geo-targeting. Pair with a matching language for best results (e.g. 'us'+'en', 'de'+'de', 'jp'+'ja').",
            "default": "us"
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Two-letter ISO 639-1 language code for result language. Controls the 'hl' parameter Google uses to filter results and UI language. Common values: 'en', 'de', 'fr', 'es', 'it', 'ja', 'pt', 'nl'.",
            "default": "en"
          },
          "includePeopleAlsoAsk": {
            "title": "Include People Also Ask",
            "type": "boolean",
            "description": "Extract 'People Also Ask' questions from search results.",
            "default": true
          },
          "includeRelatedSearches": {
            "title": "Include Related Searches",
            "type": "boolean",
            "description": "Extract related search suggestions from bottom of results.",
            "default": true
          },
          "includeFeaturedSnippet": {
            "title": "Include Featured Snippet",
            "type": "boolean",
            "description": "Extract the featured snippet / answer box if Google shows one for the query.",
            "default": true
          },
          "includeKnowledgePanel": {
            "title": "Include Knowledge Panel",
            "type": "boolean",
            "description": "Extract knowledge panel data (entity info, facts) when available.",
            "default": true
          },
          "trackSerpDiff": {
            "title": "Track SERP changes (rank-tracker mode)",
            "type": "boolean",
            "description": "Persist the top 10 organic URLs per query across runs and emit a `serp_diff` item on every run with rank changes, new/dropped domains, and featured-snippet flips. Pair with Apify scheduler to build a daily rank-tracker without any external service. Charges a small fee ($0.002) only when a significant change is detected (>=2-position shift, new/dropped top-10 domain, or featured-snippet flip). First run establishes the baseline and is NOT charged. Cross-run state is stored in a named Apify key-value store (one snapshot slot per query/country/language triple).",
            "default": false
          },
          "alertWebhookUrl": {
            "title": "SERP Alert Webhook URL (optional)",
            "type": "string",
            "description": "POST a compact JSON payload to this URL whenever a tracked query's SERP diff change_score meets the threshold below. Turns the actor into a real-time rank-movement alert service — pipe into Slack/Discord/Zapier/Make/n8n/your own endpoint. Fire-and-forget: 5s timeout, 1 retry on failure, webhook errors never fail the run. Only fires on second-run-onward (needs a prior snapshot for deltas). Setting this automatically enables trackSerpDiff. Adds an `alert-dispatched` charge ($0.002) per successful webhook. Leave empty to disable."
          },
          "alertMinChangeScore": {
            "title": "Minimum Change Score to Alert",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Minimum SERP-diff change_score required to fire a webhook. Default 2 means at least two significant changes (rank shifts of >=2 positions, new/dropped top-10 domains, or featured-snippet flips) must occur before an alert is sent. Raise to reduce noise on volatile commercial queries; lower to 1 for sensitive monitoring. Only applies when alertWebhookUrl is set.",
            "default": 2
          },
          "enableAiAnalysis": {
            "title": "Enable AI Analysis",
            "type": "boolean",
            "description": "Run AI-powered SEO and SERP analysis. Requires an LLM API key.",
            "default": false
          },
          "llmProvider": {
            "title": "LLM Provider",
            "enum": [
              "openrouter",
              "anthropic",
              "google",
              "openai",
              "ollama"
            ],
            "type": "string",
            "description": "Which AI provider to use for analysis.",
            "default": "openrouter"
          },
          "openrouterApiKey": {
            "title": "OpenRouter API Key",
            "type": "string",
            "description": "OpenRouter API key — alternative: set OPENROUTER_API_KEY env var. Get one at openrouter.ai/keys"
          },
          "anthropicApiKey": {
            "title": "Anthropic API Key",
            "type": "string",
            "description": "Anthropic API key — alternative: set ANTHROPIC_API_KEY env var. Get one at console.anthropic.com/settings/keys"
          },
          "googleApiKey": {
            "title": "Google AI API Key",
            "type": "string",
            "description": "Google AI (Gemini) API key — alternative: set GOOGLE_API_KEY env var. Get one at aistudio.google.com/app/apikey"
          },
          "openaiApiKey": {
            "title": "OpenAI API Key",
            "type": "string",
            "description": "OpenAI API key — alternative: set OPENAI_API_KEY env var. Get one at platform.openai.com/api-keys"
          },
          "ollamaBaseUrl": {
            "title": "Ollama Base URL",
            "type": "string",
            "description": "Base URL for Ollama API. Default: http://localhost:11434"
          },
          "llmModel": {
            "title": "LLM Model",
            "type": "string",
            "description": "Specific model to use. Leave empty for the provider default (google/gemini-2.0-flash-001 for OpenRouter, claude-sonnet-4-20250514 for Anthropic, gemini-2.0-flash for Google AI, gpt-4o-mini for OpenAI, llama3.1 for Ollama)."
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings. Strongly recommended — enable Apify residential proxy to avoid Google's CAPTCHA / 'unusual traffic' blocks, especially for popular head-term queries. Datacenter proxy or no proxy may trigger reCAPTCHA on common queries.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}