{
  "openapi": "3.0.1",
  "info": {
    "title": "SEO Forensics Agent",
    "description": "See how Google actually ranks a page. Audit, competitor gap, and content brief, each cited to the 2024 Google leak and real search patents.",
    "version": "0.1",
    "x-build-id": "Qmr5IzqfSbD99PJHf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bigasif~seo-analyzer-agent/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bigasif-seo-analyzer-agent",
        "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/bigasif~seo-analyzer-agent/runs": {
      "post": {
        "operationId": "runs-sync-bigasif-seo-analyzer-agent",
        "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/bigasif~seo-analyzer-agent/run-sync": {
      "post": {
        "operationId": "run-sync-bigasif-seo-analyzer-agent",
        "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",
        "required": [
          "targetUrl"
        ],
        "properties": {
          "targetUrl": {
            "title": "Target URL",
            "pattern": "^https?://",
            "type": "string",
            "description": "The page you want to analyze and optimize (include https://)."
          },
          "seedKeyword": {
            "title": "Primary keyword / topic",
            "type": "string",
            "description": "The main keyword or topic to research and optimize for. If left blank, it is inferred from the page's title and H1."
          },
          "runOnpageAudit": {
            "title": "Run on-page audit",
            "type": "boolean",
            "description": "Crawl the page and flag technical/on-page SEO issues (title, meta, headings, links, images, structured data). Works with no API key.",
            "default": true
          },
          "runKeywordResearch": {
            "title": "Run SERP & keyword research",
            "type": "boolean",
            "description": "Pull Google results for the keyword and extract competitors, People-Also-Ask, and related searches. Uses the apify/google-search-scraper Actor (consumes platform credits).",
            "default": true
          },
          "runContentOptimization": {
            "title": "Run AI content optimization",
            "type": "boolean",
            "description": "Generate an SEO content brief (title, meta, outline, entities, gaps, internal links) with Claude. Requires an Anthropic API key.",
            "default": true
          },
          "runCompetitorGap": {
            "title": "Run competitive gap analysis",
            "type": "boolean",
            "description": "Fetch and analyze the top-ranking pages for the keyword and show what they cover that your page doesn't (grounded in information gain, US11354342B2). The raw comparison works with no API key; the AI gap analysis needs one. Requires SERP research to be on.",
            "default": true
          },
          "competitorCount": {
            "title": "Competitors to analyze",
            "minimum": 2,
            "maximum": 8,
            "type": "integer",
            "description": "How many top-ranking pages to fetch and compare against (one per domain).",
            "default": 4
          },
          "anthropicApiKey": {
            "title": "Anthropic API key",
            "type": "string",
            "description": "Your Anthropic API key (sk-ant-...). Required for AI content optimization and keyword synthesis. Stored encrypted; never logged."
          },
          "model": {
            "title": "Claude model",
            "enum": [
              "claude-opus-5",
              "claude-sonnet-5",
              "claude-haiku-4-5"
            ],
            "type": "string",
            "description": "Which Claude model powers the AI steps.",
            "default": "claude-opus-5"
          },
          "researchMode": {
            "title": "AI research mode",
            "enum": [
              "agentic",
              "standard"
            ],
            "type": "string",
            "description": "How the AI content brief is grounded. 'Agentic' lets Claude autonomously query the Google leak + patents with tools and iterate (deepest analysis, more API calls). 'Standard' retrieves the matching evidence in one pass (faster, cheaper).",
            "default": "agentic"
          },
          "country": {
            "title": "SERP country",
            "enum": [
              "us",
              "gb",
              "ca",
              "au",
              "in",
              "de",
              "fr",
              "es",
              "br"
            ],
            "type": "string",
            "description": "Country to localize Google search results for.",
            "default": "us"
          },
          "resultsPerKeyword": {
            "title": "Results per keyword",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many organic Google results to pull for the keyword.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}