{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Rank Tracker: Keyword Positions with History",
    "description": "Check where your domains and competitors rank in Google organic results for a keyword list, with stored per-project history (change vs last run, best and worst position) and early stop so you pay only for result pages fetched.",
    "version": "0.1",
    "x-build-id": "Uose9GCz9fWbWzkeM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lasting_bonnethead~google-rank-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lasting_bonnethead-google-rank-tracker",
        "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/lasting_bonnethead~google-rank-tracker/runs": {
      "post": {
        "operationId": "runs-sync-lasting_bonnethead-google-rank-tracker",
        "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/lasting_bonnethead~google-rank-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-lasting_bonnethead-google-rank-tracker",
        "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",
            "maxItems": 1000,
            "type": "array",
            "description": "Search queries to check, one per line. Up to 1000 per run. Whitespace is trimmed and duplicates (case-insensitive) are removed. If both Keywords and Your domains are empty, a quick demo check runs (\"running shoes\" for nike.com vs adidas.com, top 10).",
            "items": {
              "type": "string"
            }
          },
          "targetDomains": {
            "title": "Your domains",
            "maxItems": 10,
            "type": "array",
            "description": "Domains whose positions you want to track (1-10), e.g. example.com. Protocol, www. and paths are stripped. A result matches if its hostname equals the domain or is a subdomain of it (see \"Match subdomains\").",
            "items": {
              "type": "string"
            }
          },
          "competitorDomains": {
            "title": "Competitor domains",
            "maxItems": 10,
            "type": "array",
            "description": "Optional, up to 10. Tracked and output exactly like your domains, with isCompetitor: true. Paging stops once all your domains and competitors are found.",
            "items": {
              "type": "string"
            }
          },
          "matchSubdomains": {
            "title": "Match subdomains",
            "type": "boolean",
            "description": "If on, store.example.com counts as example.com. If off, only example.com and www.example.com match.",
            "default": true
          },
          "countryCode": {
            "title": "Country (gl)",
            "type": "string",
            "description": "Two-letter country code passed to Google as gl, e.g. us, gb, de, in.",
            "default": "us"
          },
          "languageCode": {
            "title": "Language (hl)",
            "type": "string",
            "description": "Interface language passed to Google as hl, e.g. en, de, pt-BR.",
            "default": "en"
          },
          "googleDomain": {
            "title": "Google domain",
            "type": "string",
            "description": "Which Google domain to query, e.g. google.com, google.co.uk, google.de.",
            "default": "google.com"
          },
          "device": {
            "title": "Device",
            "enum": [
              "desktop",
              "mobile"
            ],
            "type": "string",
            "description": "Desktop or mobile results. Mobile sends a mobile browser User-Agent.",
            "default": "desktop"
          },
          "location": {
            "title": "Location (optional)",
            "type": "string",
            "description": "City-level location as a Google canonical name, e.g. \"Austin,Texas,United States\". Converted to Google's uule parameter. Leave empty for country-level results."
          },
          "uule": {
            "title": "Raw uule (optional)",
            "type": "string",
            "description": "Advanced: a raw uule value starting with w+ (overrides Location)."
          },
          "maxDepth": {
            "title": "Max depth (results)",
            "minimum": 10,
            "maximum": 100,
            "type": "integer",
            "description": "How deep to look, 10 to 100 in steps of 10. Results are fetched 10 per page and paging stops as soon as every tracked domain is found, so you only pay for pages actually fetched.",
            "default": 100
          },
          "projectName": {
            "title": "Project name",
            "type": "string",
            "description": "History is stored per project in the named key-value store \"rank-tracker-history\". Use one project per site or client. Runs with the same project name compare against each other.",
            "default": "default"
          },
          "resetHistory": {
            "title": "Reset history",
            "type": "boolean",
            "description": "Delete the stored history for this project and start over. Previous positions, best/worst and check counts are lost.",
            "default": false
          },
          "includeSerpFeatures": {
            "title": "Include SERP features",
            "type": "boolean",
            "description": "Add the list of SERP features seen on page 1 (ads, featured snippet, AI overview, People Also Ask, local pack, etc.) and the total results text to each row.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many keywords are checked in parallel.",
            "default": 5
          },
          "debugSaveHtml": {
            "title": "Debug: save raw HTML",
            "type": "boolean",
            "description": "Save the HTML of every fetched result page to the run's default key-value store. For troubleshooting only.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}