---
updatedAt: 2025-11-18T17:03:28.000Z
agentTools:
  projectIndex: https://developer.spyfu.com/llms.txt
---

# Get Latest Domain Stats

Returns the most recent domain statistics available in SpyFu's database. This endpoint provides current SEO and PPC performance metrics to analyze the domain's latest competitive position and marketing activity.

[Visualize this API live on SpyFu](https://www.spyfu.com/domain-overview?query=example.com)

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Domain Stats API",
    "version": "v2",
    "description": "Access comprehensive domain performance metrics and historical analytics to track search visibility trends, competitive positioning, and market share evolution over time. Powered by SpyFu's unmatched historical data collection spanning 18 years of continuous monitoring across both organic and paid search channels.\n\nSpyFu's Domain Stats API provides **18 years of complete historical data** for every tracked domain, built on a foundation of **1.6 trillion search results** and **152 million domains** analyzed for comprehensive performance metrics. Our database delivers **20x more paid keywords per domain** and **2x more organic keywords per domain** than SEMRush or Ahrefs. **Every domain metric updates every 15 seconds**, ensuring you have real-time performance intelligence across all 28 supported countries.\n\nWhile competitors provide basic domain snapshots with limited history, SpyFu offers complete domain timeline analysis with 18 years of historical data and live updates every 15 seconds. Our comprehensive tracking covers both organic and paid search performance since 2007, providing unmatched insight into long-term domain evolution.\n\nWith this API, you can track domain performance trends across SEO and PPC channels over time, analyze seasonal patterns and growth trajectories, benchmark domain performance against historical baselines, identify performance inflection points and strategy changes, monitor competitive domain performance evolution, and access complete domain visibility metrics spanning nearly two decades. Understand how domains have grown their search presence and learn from successful optimization strategies implemented over years.\n\nThe Domain Stats API integrates seamlessly with SpyFu's SEO Research, Ad History, and Competitors APIs to provide complete domain intelligence, enabling you to correlate performance metrics with specific keyword strategies and competitive activities.\n\nGet started with comprehensive API documentation and interactive examples at [SpyFu Developer Portal](https://developer.spyfu.com)."
  },
  "servers": [
    {
      "url": "https://api.spyfu.com/apis/domain_stats_api"
    }
  ],
  "paths": {
    "/v2/getLatestDomainStats": {
      "get": {
        "operationId": "DomainStatsApi_GetLatestDomainStats_GET",
        "summary": "Get Latest Domain Stats",
        "description": "Returns the most recent domain statistics available in SpyFu's database. This endpoint provides current SEO and PPC performance metrics to analyze the domain's latest competitive position and marketing activity.\n\n[Visualize this API live on SpyFu](https://www.spyfu.com/domain-overview?query=example.com)",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "description": "Domain to retrieve latest statistics for.",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "example.com"
              ]
            },
            "example": "example.com"
          },
          {
            "name": "countryCode",
            "in": "query",
            "description": "Country market to search.  Specifically, this maps to the Google version to query against (google.de for Germany, etc).  Google.com (US) is the default.      [See full list of supported Countries](https://developer.spyfu.com/update/reference/country-code-enum#/)",
            "schema": {
              "type": "string",
              "examples": [
                "US"
              ],
              "default": "US",
              "enum": [
                "AR",
                "AT",
                "AU",
                "BE",
                "BR",
                "CA",
                "CH",
                "DE",
                "DK",
                "ES",
                "FR",
                "IE",
                "IN",
                "IT",
                "JP",
                "MX",
                "NL",
                "NO",
                "NZ",
                "PL",
                "PT",
                "SE",
                "SG",
                "TR",
                "UA",
                "UK",
                "US",
                "ZA"
              ]
            },
            "example": "US"
          },
          {
            "name": "pastNMonths",
            "in": "query",
            "description": "Returns the latest N months of stats for domain.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "maximum": 2147483647,
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved latest domain statistics. Returns the most recent SEO and PPC metrics including keyword counts, traffic estimates, and competitive positioning data.",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Response wrapper containing comprehensive domain performance statistics across multiple time periods with detailed SEO and PPC metrics.",
                  "type": "object",
                  "properties": {
                    "domain": {
                      "description": "Domain name for which the statistics were collected and analyzed.",
                      "type": [
                        "string",
                        "null"
                      ],
                      "examples": [
                        "example.com"
                      ]
                    },
                    "results": {
                      "description": "Array of domain performance statistics organized by time period, including SEO metrics, PPC data, traffic estimates, and competitive strength indicators.",
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "searchMonth": {
                            "description": "Month when these domain statistics were collected (1-12).",
                            "type": "integer",
                            "format": "int32",
                            "examples": [
                              5
                            ]
                          },
                          "searchYear": {
                            "description": "Year when these domain statistics were collected.",
                            "type": "integer",
                            "format": "int32",
                            "examples": [
                              2021
                            ]
                          },
                          "averageOrganicRank": {
                            "description": "Average organic search ranking position across all keywords for this domain during the specified month.",
                            "type": "number",
                            "format": "double",
                            "examples": [
                              41.08
                            ]
                          },
                          "monthlyPaidClicks": {
                            "description": "Estimated monthly clicks received from paid search advertising across all keywords, calculated based on average ad positions and click-through rates.",
                            "type": "number",
                            "format": "double",
                            "examples": [
                              61181.88
                            ]
                          },
                          "averageAdRank": {
                            "description": "Average paid search ad position across all advertised keywords during the specified month.",
                            "type": "number",
                            "format": "double",
                            "examples": [
                              1.03
                            ]
                          },
                          "totalOrganicResults": {
                            "description": "Total number of unique organic keywords where this domain appears in the top 100 search results during the specified month.",
                            "type": "integer",
                            "format": "int32",
                            "examples": [
                              302731
                            ]
                          },
                          "monthlyBudget": {
                            "description": "Estimated monthly Google Ads spending based on keyword positions, click-through rates, and cost-per-click data across all paid campaigns.",
                            "type": "number",
                            "format": "double",
                            "examples": [
                              6721.39
                            ]
                          },
                          "monthlyOrganicValue": {
                            "description": "Estimated value of organic search traffic based on keyword rankings and equivalent cost-per-click values, representing the advertising spend equivalent of organic visibility.",
                            "type": "number",
                            "format": "double",
                            "examples": [
                              384233.16
                            ]
                          },
                          "totalAdsPurchased": {
                            "description": "Total number of unique paid keywords where this domain's ads appeared on the first page of search results, measured over the last 14 data collection periods.",
                            "type": "integer",
                            "format": "int32",
                            "examples": [
                              599
                            ]
                          },
                          "monthlyOrganicClicks": {
                            "description": "Estimated monthly organic search traffic clicks received from all ranking keywords during the specified month.",
                            "type": "number",
                            "format": "double",
                            "examples": [
                              290145
                            ]
                          },
                          "strength": {
                            "description": "Domain authority score (0-100) indicating competitive strength and ranking consistency across high-value keywords, with higher scores representing stronger market position.",
                            "type": "integer",
                            "format": "int32",
                            "examples": [
                              75
                            ]
                          },
                          "totalInverseRank": {
                            "description": "Cumulative ranking score where higher organic positions receive higher point values (position 1 = 100 points, position 2 = 99 points, etc.), summed across all ranking keywords.",
                            "type": "integer",
                            "format": "int64",
                            "examples": [
                              4971564
                            ]
                          },
                          "areStatsNormalized": {
                            "description": "Indicates whether the statistics have been normalized for consistent comparison across different time periods and data collection methods.",
                            "type": "boolean",
                            "examples": [
                              true
                            ]
                          }
                        },
                        "additionalProperties": false,
                        "description": "Represents comprehensive domain performance statistics for a specific month, including SEO and PPC metrics, traffic estimates, and competitive strength indicators."
                      }
                    },
                    "resultCount": {
                      "description": "Number of results returned",
                      "type": "integer",
                      "format": "int32",
                      "examples": [
                        1
                      ],
                      "readOnly": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid parameters provided (e.g., invalid domain format or invalid country code)"
          },
          "401": {
            "description": "Unauthorized - Invalid API credentials or insufficient permissions to access domain statistics data"
          },
          "500": {
            "description": "Internal Server Error - A server-side error occurred while processing the request"
          }
        },
        "tags": [
          "Domain Stats API"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "Basic_Authentication_Token": {
        "type": "http",
        "description": "<a href=\"https://en.wikipedia.org/wiki/Basic_access_authentication#Client_side\" target=\"_blank\">Basic Authentication</a> is a standard that involves encoding your <code>SPYFU_API_ID:SECRET_KEY</code> into a Base64 string. Your <b>SpyFu API ID</b> and <b>Secret Key</b> can both be found under the <b><a href=\"https://www.spyfu.com/account/api\" target=\"_blank\">Account Settings -> API Usage</a></b> page. Additionally, you can find the Base64 string has been pre-generated on the same page under <b>Base 64 Key</b>. Finally, this encoded string is sent in the \"Authorization\" header prefixed with the keyword \"Basic\":<br>For example, to authorize as <code>00000000-0000-0000-0000-000000000000:AB12WXYZ</code> the client would send<br><pre><code>Authorization: <span class=\"token keyword\">Basic</span> <span class=\"token constructor-invocation class-name\">MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwOkFCMTJXWFla<span></code></pre>",
        "scheme": "basic"
      },
      "Query_Parameter_Token": {
        "type": "apiKey",
        "description": "An API key can be added as a query parameter. Your API key is listed as \"Secret Key\" found under the <b><a href=\"https://www.spyfu.com/account/api\" target=\"_blank\">Account Settings -> API Usage</a></b> page<br>For example, to authorize with the API key <code>AB12WXY</code><br><pre><code>/apis/example_api/GetExample?domain=spyfu.com<span class=\"token keyword\">&api_key=AB12WXYZ</span></code></pre>",
        "name": "api_key",
        "in": "query"
      },
      "HMAC_Authentication_Header": {
        "type": "apiKey",
        "description": "For even more security, each request can be individually authenticated with a timestamped <a href=\"https://en.wikipedia.org/wiki/HMAC\" target=\"_blank\"><b>HMAC</b></a> <em>(Hash Message Authentication Code)</em> signature. Composed of your secret key, a valid timestamp, the API request path, and all request parameters. <h3>Creating the signature:</h3><br>Combine the pieces that will be converted into the signature.<br><pre><code><span class=\"token keyword\">StringToSign</span> <span class=\"token operator\">=</span><br>&#x09;HTTP-Verb <span class=\"token operator\">+</span> <span class=\"token string\">\"\\n\"</span> <span class=\"token operator\">+</span><br>&#x09;Timestamp <span class=\"token operator\">+</span> <span class=\"token string\">\"\\n\"</span> <span class=\"token operator\">+</span><br>&#x09;UrlPath <span class=\"token operator\">+</span> <span class=\"token string\">\"\\n\"</span><br>&#x09;QueryParameters<span class=\"token operator\">;</span><br></code></pre><br>Create UTF-8 encodings of the above string and of your secret key.<br><pre><code><span class=\"token keyword\">byte</span><span class=\"token operator\">[]</span> SecretKeyBytes <span class=\"token operator\">=</span> <span class=\"token function\">UTF-8-Encoding-Of</span><span class=\"token operator\">(</span> Upper-Case-Of<span class=\"token operator\">(</span> SECRET_KEY <span class=\"token operator\">)</span> <span class=\"token operator\">)</span><span class=\"token operator\">;</span><br><span class=\"token keyword\">byte</span><span class=\"token operator\">[]</span> StringToSignBytes <span class=\"token operator\">=</span> <span class=\"token function\">UTF-8-Encoding-Of</span><span class=\"token operator\">(</span> StringToSign <span class=\"token operator\">)</span><span class=\"token operator\">;</span><br></code></pre><br>Use an implementation of HMAC256 using your UTF-8 secret key to encode the combined string of your request. This should then be converted to Base64 to finish creating your signature.<br><pre><code><span class=\"token keyword\">Signature</span> <span class=\"token operator\">=</span> <span class=\"token function\">Base64</span><span class=\"token operator\">(</span> <span class=\"token function\">HMAC-SHA256</span><span class=\"token operator\">(</span> SecretKeyBytes, StringToSignBytes <span class=\"token operator\">)</span> <span class=\"token operator\">)</span><span class=\"token operator\">;</span><br></code></pre><br><h3>Using the signature:</h3><br>This signature is then sent in through an Authentication header with your username.<br><pre><code>Authentication<span class=\"token operator\">:</span> <span class=\"token keyword\">UserName</span><span class=\"token operator\">:</span><span class=\"token invocation class-name\">Signature</span></code></pre>",
        "name": "Authentication",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "Basic_Authentication_Token": []
    },
    {
      "Query_Parameter_Token": []
    },
    {
      "HMAC_Authentication_Header": []
    }
  ]
}
```