API 控制台

API Key

登录后管理你的 API Key。会员无限制调用 API。

POST /api/v1/site-data/

Authorization: Bearer YOUR_API_KEY · Content-Type: application/json

通过该接口可以获取哪些数据

一次请求可以任选一种或组合多种数据维度。下面列出每个维度能够返回的主要信息;实际字段可能因数据源覆盖和目标站点状态为空。

dimensions.dr

域名权威度(DR)

快速判断一个域名的外链实力和相对权威度,适合竞品筛选、外链机会排序和站点质量初步评估。

  • 0–100 的 Domain Rating
  • DR 数据来源与归属链接

dimensions.registration

域名注册与 DNS 信息

了解域名存在时间、注册状态和基础 DNS 配置,用于判断站点资历、续期风险与域名基础设施。

  • 注册、到期及最近更新时间
  • 注册商名称与 IANA ID
  • 域名状态、Nameserver 与 DNSSEC
  • 对应的 RDAP 来源地址

dimensions.traffic

流量、排名与受众来源

获取第三方估算的访问规模和用户参与度,并查看流量来自哪里、主要市场和搜索关键词。

  • 月度预估访问量及数据月份
  • 平均访问时长、每次访问页数与跳出率
  • 全球、国家及行业分类排名
  • 直接、搜索、社交、引荐、邮件等来源占比
  • 主要国家、月度访问趋势及热门关键词(含份额、搜索量与 CPC)

dimensions.onpage

首页结构与基础 SEO

读取网站首页的可公开结构化信息,用于快速检查页面内容完整度和常见技术 SEO 问题。

  • 最终 URL、HTTP 状态、Title、Description 与 Canonical
  • H1、H2 标题内容
  • 内链、外链、图片和正文词数
  • HTTPS、重定向、4xx/5xx、标题、描述、H1、图片 Alt 等检查项

流量数据为第三方估算,不等同于站点后台统计;null 表示当前没有可用数据,不代表数值为 0。

参数与完整字段合同

下面的字段结构直接来自可执行合同生成的 OpenAPI,展开可查看嵌套类型、枚举、默认值和全部安全业务字段。四维支持任意 15 种非空组合;onpage 传对象 {profile: basic},不是 true。

query: action · domain · dimensions · cache · wait_ms

result: action · request_id

response: schema_version · request_id · status · domain · registrable_domain · dimensions · usage · retry_after_seconds

SiteDataRequest

SiteDataRequest

{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "action": {
          "default": "query",
          "type": "string",
          "const": "query"
        },
        "domain": {
          "type": "string",
          "minLength": 1,
          "maxLength": 253
        },
        "dimensions": {
          "type": "object",
          "properties": {
            "dr": {
              "default": false,
              "type": "boolean"
            },
            "registration": {
              "default": false,
              "type": "boolean"
            },
            "traffic": {
              "default": false,
              "type": "boolean"
            },
            "onpage": {
              "default": false,
              "anyOf": [
                {
                  "type": "boolean",
                  "const": false
                },
                {
                  "type": "object",
                  "properties": {
                    "profile": {
                      "default": "basic",
                      "type": "string",
                      "const": "basic"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "additionalProperties": false,
          "anyOf": [
            {
              "required": [
                "dr"
              ],
              "properties": {
                "dr": {
                  "const": true
                }
              }
            },
            {
              "required": [
                "registration"
              ],
              "properties": {
                "registration": {
                  "const": true
                }
              }
            },
            {
              "required": [
                "traffic"
              ],
              "properties": {
                "traffic": {
                  "const": true
                }
              }
            },
            {
              "required": [
                "onpage"
              ],
              "properties": {
                "onpage": {
                  "type": "object"
                }
              }
            }
          ]
        },
        "cache": {
          "default": "prefer",
          "type": "string",
          "enum": [
            "prefer",
            "only"
          ]
        },
        "wait_ms": {
          "default": 10000,
          "type": "integer",
          "minimum": 0,
          "maximum": 10000
        }
      },
      "required": [
        "domain",
        "dimensions"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "const": "result"
        },
        "request_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        }
      },
      "required": [
        "action",
        "request_id"
      ],
      "additionalProperties": false
    }
  ]
}
SiteDataResult

SiteDataResult

{
  "type": "object",
  "properties": {
    "schema_version": {
      "type": "string",
      "const": "site-data.v1"
    },
    "request_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "status": {
      "type": "string",
      "enum": [
        "complete",
        "partial",
        "pending",
        "failed"
      ]
    },
    "domain": {
      "type": "string",
      "minLength": 1
    },
    "registrable_domain": {
      "type": "string",
      "minLength": 1
    },
    "dimensions": {
      "type": "object",
      "properties": {
        "dr": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "const": "ahrefs"
                },
                "queried_target": {
                  "type": "string",
                  "minLength": 1
                },
                "fetched_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "data_as_of": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cached": {
                  "type": "boolean"
                },
                "stale": {
                  "type": "boolean"
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_INPUT",
                            "UNAUTHORIZED",
                            "FORBIDDEN",
                            "IDEMPOTENCY_CONFLICT",
                            "RATE_LIMITED",
                            "DAILY_LIMIT_EXCEEDED",
                            "CACHE_MISS",
                            "TARGET_REJECTED",
                            "TARGET_DNS_FAILED",
                            "PROVIDER_UNAVAILABLE",
                            "UPSTREAM_INVALID",
                            "REQUEST_EXPIRED",
                            "REQUEST_NOT_FOUND",
                            "INTERNAL_ERROR"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        },
                        "retry_after_seconds": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "const": "ok"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "domain_rating": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 100
                    },
                    "attribution": {
                      "type": "object",
                      "properties": {
                        "text": {
                          "type": "string",
                          "minLength": 1
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        }
                      },
                      "required": [
                        "text",
                        "url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "domain_rating",
                    "attribution"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "source",
                "queried_target",
                "fetched_at",
                "data_as_of",
                "cached",
                "stale",
                "error",
                "status",
                "data"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "const": "ahrefs"
                },
                "queried_target": {
                  "type": "string",
                  "minLength": 1
                },
                "fetched_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "data_as_of": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cached": {
                  "type": "boolean"
                },
                "stale": {
                  "type": "boolean"
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_INPUT",
                            "UNAUTHORIZED",
                            "FORBIDDEN",
                            "IDEMPOTENCY_CONFLICT",
                            "RATE_LIMITED",
                            "DAILY_LIMIT_EXCEEDED",
                            "CACHE_MISS",
                            "TARGET_REJECTED",
                            "TARGET_DNS_FAILED",
                            "PROVIDER_UNAVAILABLE",
                            "UPSTREAM_INVALID",
                            "REQUEST_EXPIRED",
                            "REQUEST_NOT_FOUND",
                            "INTERNAL_ERROR"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        },
                        "retry_after_seconds": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "no_data",
                    "unsupported",
                    "pending",
                    "unavailable",
                    "error"
                  ]
                },
                "data": {
                  "type": "null"
                }
              },
              "required": [
                "source",
                "queried_target",
                "fetched_at",
                "data_as_of",
                "cached",
                "stale",
                "error",
                "status",
                "data"
              ],
              "additionalProperties": false
            }
          ]
        },
        "registration": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "const": "rdap"
                },
                "queried_target": {
                  "type": "string",
                  "minLength": 1
                },
                "fetched_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "data_as_of": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cached": {
                  "type": "boolean"
                },
                "stale": {
                  "type": "boolean"
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_INPUT",
                            "UNAUTHORIZED",
                            "FORBIDDEN",
                            "IDEMPOTENCY_CONFLICT",
                            "RATE_LIMITED",
                            "DAILY_LIMIT_EXCEEDED",
                            "CACHE_MISS",
                            "TARGET_REJECTED",
                            "TARGET_DNS_FAILED",
                            "PROVIDER_UNAVAILABLE",
                            "UPSTREAM_INVALID",
                            "REQUEST_EXPIRED",
                            "REQUEST_NOT_FOUND",
                            "INTERNAL_ERROR"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        },
                        "retry_after_seconds": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "const": "ok"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "registered_at": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "expires_at": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updated_at": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "registrar_name": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "registrar_iana_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "statuses": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "nameservers": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "dnssec": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "registered_at",
                    "expires_at",
                    "updated_at",
                    "registrar_name",
                    "registrar_iana_id",
                    "statuses",
                    "nameservers",
                    "dnssec",
                    "source_url"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "source",
                "queried_target",
                "fetched_at",
                "data_as_of",
                "cached",
                "stale",
                "error",
                "status",
                "data"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "const": "rdap"
                },
                "queried_target": {
                  "type": "string",
                  "minLength": 1
                },
                "fetched_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "data_as_of": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cached": {
                  "type": "boolean"
                },
                "stale": {
                  "type": "boolean"
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_INPUT",
                            "UNAUTHORIZED",
                            "FORBIDDEN",
                            "IDEMPOTENCY_CONFLICT",
                            "RATE_LIMITED",
                            "DAILY_LIMIT_EXCEEDED",
                            "CACHE_MISS",
                            "TARGET_REJECTED",
                            "TARGET_DNS_FAILED",
                            "PROVIDER_UNAVAILABLE",
                            "UPSTREAM_INVALID",
                            "REQUEST_EXPIRED",
                            "REQUEST_NOT_FOUND",
                            "INTERNAL_ERROR"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        },
                        "retry_after_seconds": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "no_data",
                    "unsupported",
                    "pending",
                    "unavailable",
                    "error"
                  ]
                },
                "data": {
                  "type": "null"
                }
              },
              "required": [
                "source",
                "queried_target",
                "fetched_at",
                "data_as_of",
                "cached",
                "stale",
                "error",
                "status",
                "data"
              ],
              "additionalProperties": false
            }
          ]
        },
        "traffic": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "const": "scrappa_similarweb"
                },
                "queried_target": {
                  "type": "string",
                  "minLength": 1
                },
                "fetched_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "data_as_of": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cached": {
                  "type": "boolean"
                },
                "stale": {
                  "type": "boolean"
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_INPUT",
                            "UNAUTHORIZED",
                            "FORBIDDEN",
                            "IDEMPOTENCY_CONFLICT",
                            "RATE_LIMITED",
                            "DAILY_LIMIT_EXCEEDED",
                            "CACHE_MISS",
                            "TARGET_REJECTED",
                            "TARGET_DNS_FAILED",
                            "PROVIDER_UNAVAILABLE",
                            "UPSTREAM_INVALID",
                            "REQUEST_EXPIRED",
                            "REQUEST_NOT_FOUND",
                            "INTERNAL_ERROR"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        },
                        "retry_after_seconds": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "refresh": {
                  "default": null,
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "expected_period": {
                          "type": "string",
                          "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
                        },
                        "update_status": {
                          "type": "string",
                          "enum": [
                            "current",
                            "pending",
                            "cooldown",
                            "unavailable",
                            "period_unknown"
                          ]
                        },
                        "next_check_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "expected_period",
                        "update_status",
                        "next_check_at"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "const": "ok"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "is_estimate": {
                      "type": "boolean",
                      "const": true
                    },
                    "period": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "estimated_visits": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "average_visit_duration_seconds": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "pages_per_visit": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "bounce_rate": {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "global_rank": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "country_rank": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "provider_data": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "domain": {
                              "type": "string"
                            },
                            "site_name": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "title": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "description": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "category": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "global_rank": {
                              "default": null,
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "Rank": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "string"
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "rank": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "string"
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "string"
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "country_rank": {
                              "default": null,
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "Rank": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "string"
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "rank": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "string"
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "string"
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "Country": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "string"
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "CountryCode": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "country_code": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "category_rank": {
                              "default": null,
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "Rank": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "string"
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "rank": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "string"
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "string"
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "Category": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "engagement": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "visits": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "time_on_site": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "page_per_visit": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "bounce_rate": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "month": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "year": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "period": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "estimated_visits": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "average_visit_duration_seconds": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "pages_per_visit": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "traffic_sources": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "direct": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "search": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "social": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "referrals": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "mail": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "paid_referrals": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "top_countries": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "country_code": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "country_id": {
                                        "anyOf": [
                                          {
                                            "anyOf": [
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "share": {
                                        "anyOf": [
                                          {
                                            "anyOf": [
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "estimated_monthly_visits": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "pattern": "^\\d{4}-(0[1-9]|1[0-2])-01$"
                                  },
                                  "additionalProperties": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "string"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "top_keywords": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "keyword": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "share": {
                                        "anyOf": [
                                          {
                                            "anyOf": [
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "volume": {
                                        "anyOf": [
                                          {
                                            "anyOf": [
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "cpc": {
                                        "anyOf": [
                                          {
                                            "anyOf": [
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "string"
                                              }
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "screenshot": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^https?:\\/\\/"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "domain",
                            "site_name",
                            "title",
                            "description",
                            "category",
                            "global_rank",
                            "country_rank",
                            "country_code",
                            "category_rank",
                            "engagement",
                            "traffic_sources",
                            "top_countries",
                            "estimated_monthly_visits",
                            "top_keywords",
                            "screenshot"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "is_estimate",
                    "period",
                    "estimated_visits",
                    "average_visit_duration_seconds",
                    "pages_per_visit",
                    "bounce_rate",
                    "global_rank",
                    "country_rank",
                    "provider_data"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "source",
                "queried_target",
                "fetched_at",
                "data_as_of",
                "cached",
                "stale",
                "error",
                "refresh",
                "status",
                "data"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "const": "scrappa_similarweb"
                },
                "queried_target": {
                  "type": "string",
                  "minLength": 1
                },
                "fetched_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "data_as_of": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cached": {
                  "type": "boolean"
                },
                "stale": {
                  "type": "boolean"
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_INPUT",
                            "UNAUTHORIZED",
                            "FORBIDDEN",
                            "IDEMPOTENCY_CONFLICT",
                            "RATE_LIMITED",
                            "DAILY_LIMIT_EXCEEDED",
                            "CACHE_MISS",
                            "TARGET_REJECTED",
                            "TARGET_DNS_FAILED",
                            "PROVIDER_UNAVAILABLE",
                            "UPSTREAM_INVALID",
                            "REQUEST_EXPIRED",
                            "REQUEST_NOT_FOUND",
                            "INTERNAL_ERROR"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        },
                        "retry_after_seconds": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "refresh": {
                  "default": null,
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "expected_period": {
                          "type": "string",
                          "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
                        },
                        "update_status": {
                          "type": "string",
                          "enum": [
                            "current",
                            "pending",
                            "cooldown",
                            "unavailable",
                            "period_unknown"
                          ]
                        },
                        "next_check_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "expected_period",
                        "update_status",
                        "next_check_at"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "no_data",
                    "unsupported",
                    "pending",
                    "unavailable",
                    "error"
                  ]
                },
                "data": {
                  "type": "null"
                }
              },
              "required": [
                "source",
                "queried_target",
                "fetched_at",
                "data_as_of",
                "cached",
                "stale",
                "error",
                "refresh",
                "status",
                "data"
              ],
              "additionalProperties": false
            }
          ]
        },
        "onpage": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "const": "dataforseo_onpage"
                },
                "queried_target": {
                  "type": "string",
                  "minLength": 1
                },
                "fetched_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "data_as_of": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cached": {
                  "type": "boolean"
                },
                "stale": {
                  "type": "boolean"
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_INPUT",
                            "UNAUTHORIZED",
                            "FORBIDDEN",
                            "IDEMPOTENCY_CONFLICT",
                            "RATE_LIMITED",
                            "DAILY_LIMIT_EXCEEDED",
                            "CACHE_MISS",
                            "TARGET_REJECTED",
                            "TARGET_DNS_FAILED",
                            "PROVIDER_UNAVAILABLE",
                            "UPSTREAM_INVALID",
                            "REQUEST_EXPIRED",
                            "REQUEST_NOT_FOUND",
                            "INTERNAL_ERROR"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        },
                        "retry_after_seconds": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "const": "ok"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "final_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "http_status_code": {
                      "type": "integer",
                      "minimum": 100,
                      "maximum": 599
                    },
                    "title": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "canonical": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uri"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "h1": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "h2": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "internal_links": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "external_links": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "images": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "word_count": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "checks": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "anyOf": [
                          {
                            "type": "boolean"
                          },
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  },
                  "required": [
                    "final_url",
                    "http_status_code",
                    "title",
                    "description",
                    "canonical",
                    "h1",
                    "h2",
                    "internal_links",
                    "external_links",
                    "images",
                    "word_count",
                    "checks"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "source",
                "queried_target",
                "fetched_at",
                "data_as_of",
                "cached",
                "stale",
                "error",
                "status",
                "data"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "const": "dataforseo_onpage"
                },
                "queried_target": {
                  "type": "string",
                  "minLength": 1
                },
                "fetched_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "data_as_of": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cached": {
                  "type": "boolean"
                },
                "stale": {
                  "type": "boolean"
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "INVALID_INPUT",
                            "UNAUTHORIZED",
                            "FORBIDDEN",
                            "IDEMPOTENCY_CONFLICT",
                            "RATE_LIMITED",
                            "DAILY_LIMIT_EXCEEDED",
                            "CACHE_MISS",
                            "TARGET_REJECTED",
                            "TARGET_DNS_FAILED",
                            "PROVIDER_UNAVAILABLE",
                            "UPSTREAM_INVALID",
                            "REQUEST_EXPIRED",
                            "REQUEST_NOT_FOUND",
                            "INTERNAL_ERROR"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        },
                        "retry_after_seconds": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "no_data",
                    "unsupported",
                    "pending",
                    "unavailable",
                    "error"
                  ]
                },
                "data": {
                  "type": "null"
                }
              },
              "required": [
                "source",
                "queried_target",
                "fetched_at",
                "data_as_of",
                "cached",
                "stale",
                "error",
                "status",
                "data"
              ],
              "additionalProperties": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "usage": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "used": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "remaining": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "reset_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        }
      },
      "required": [
        "limit",
        "used",
        "remaining",
        "reset_at"
      ],
      "additionalProperties": false
    },
    "retry_after_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "schema_version",
    "request_id",
    "status",
    "domain",
    "registrable_domain",
    "dimensions",
    "usage",
    "retry_after_seconds"
  ],
  "additionalProperties": false
}
SiteDataError

SiteDataError

{
  "type": "object",
  "properties": {
    "schema_version": {
      "type": "string",
      "const": "site-data.v1"
    },
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "INVALID_INPUT",
            "UNAUTHORIZED",
            "FORBIDDEN",
            "IDEMPOTENCY_CONFLICT",
            "RATE_LIMITED",
            "DAILY_LIMIT_EXCEEDED",
            "CACHE_MISS",
            "TARGET_REJECTED",
            "TARGET_DNS_FAILED",
            "PROVIDER_UNAVAILABLE",
            "UPSTREAM_INVALID",
            "REQUEST_EXPIRED",
            "REQUEST_NOT_FOUND",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "retry_after_seconds": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": false
    },
    "request_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "schema_version",
    "error",
    "request_id"
  ],
  "additionalProperties": false
}

complete / partial / pending / failed 是整体状态,不应把 partial 当成完整成功。各维度分别返回 ok / no_data / unsupported / pending / unavailable / error;null 不代表 0。traffic.provider_data 展示合同允许的供应商业务字段,并非未过滤的原始上游响应。

HTTP 状态与错误

HTTP响应说明
200Terminal complete/partial result, including cache-only misses with failed status. No fabricated values.
202At least one selected dimension remains pending; completed dimensions are preserved.
400Invalid action, hostname, dimensions, profile or wait budget.
401Missing, invalid, expired or revoked API Key.
403Ineligible or suspended account, insufficient scopes or rejected public-target policy.
404Unknown request or request owned by another account.
409Idempotency key conflicts with the accepted query identity.
410The owning caller's result retention period has expired.
429当前请求暂时无法受理,请遵循响应中的重试提示。
500Internal failure; no credentials or upstream raw body exposed.
502Invalid upstream payload; never pass through raw provider responses.
503Service unavailable or all selected providers failed. A dimension result envelope is retained when a query was accepted.

429 请遵循响应中的重试提示。401 / 403 检查密钥与付费资格;503 保留已返回的 request_id,用 result 续取,不循环创建新 query。网络结果未知时保留原载荷与 Idempotency-Key,再次显式重试。

服务器接入示例

cURL

# Server-side shell. Requires curl and jq. Never ship YOUR_API_KEY to a browser.
API_KEY='YOUR_API_KEY'
IDEMPOTENCY_KEY="$(uuidgen)" # Keep this value for retries of this query.
headers_file=$(mktemp)
body_file=$(mktemp)
trap 'rm -f "$headers_file" "$body_file"' EXIT
payload='{"action":"query","domain":"example.com","dimensions":{"dr":true,"registration":false,"traffic":false,"onpage":false},"cache":"prefer","wait_ms":0}'
while true; do
  status=$(curl --silent --show-error --output "$body_file" --dump-header "$headers_file" --write-out '%{http_code}' \
    'https://buildorskip.dev/api/v1/site-data/' \
    -H "Authorization: Bearer $API_KEY" -H 'Content-Type: application/json' \
    -H "Idempotency-Key: $IDEMPOTENCY_KEY" --data "$payload") || break
  cat "$body_file"
  wait_seconds=$(awk 'tolower($1)=="retry-after:" {gsub("\r", "", $2); print $2}' "$headers_file" | tail -1)
  [ -n "$wait_seconds" ] || wait_seconds=0
  wait_seconds=$(jq -n --arg header "$wait_seconds" --slurpfile body "$body_file" '[5, ($header|tonumber), ($body[0].retry_after_seconds // 0)] | max')
  if [ "$status" = 429 ] && [ "$(jq -r '.error.code' "$body_file")" = RATE_LIMITED ]; then
    sleep "$wait_seconds"; continue # Same query identity or same result ID.
  fi
  if [ "$(jq -r '.status' "$body_file")" != pending ]; then break; fi
  payload=$(jq -c '{action:"result",request_id:.request_id}' "$body_file")
  sleep "$wait_seconds"
done

JavaScript

// Node.js 20+. Server-side only. Keep this idempotency key if a response is lost.
const apiKey = 'YOUR_API_KEY';
const idempotencyKey = crypto.randomUUID();
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
let payload = {
  "action": "query",
  "domain": "example.com",
  "dimensions": {
    "dr": true,
    "registration": false,
    "traffic": false,
    "onpage": false
  },
  "cache": "prefer",
  "wait_ms": 0
};
while (true) {
  const response = await fetch('https://buildorskip.dev/api/v1/site-data/', {
    method: 'POST', headers: { 'Authorization': 'Bearer ' + apiKey,
      'Content-Type': 'application/json', 'Idempotency-Key': idempotencyKey },
    body: JSON.stringify(payload),
  });
  const body = await response.json();
  console.log(body);
  const wait = Math.max(5, Number(response.headers.get('retry-after')) || 0,
    body.retry_after_seconds || 0) * 1000;
  if (response.status === 429 && body.error?.code === 'RATE_LIMITED') {
    await sleep(wait); continue; // Retry the same payload, never a new query ID.
  }
  if (body.status !== 'pending') break; // Includes terminal and expired/error results.
  payload = { action: 'result', request_id: body.request_id };
  await sleep(wait);
}

Python

# Python 3 standard library. Server-side only.
import json, time, uuid, urllib.request, urllib.error
api_key = 'YOUR_API_KEY'
idempotency_key = str(uuid.uuid4())  # Retain for unknown-response retries.
payload = json.loads('{"action":"query","domain":"example.com","dimensions":{"dr":true,"registration":false,"traffic":false,"onpage":false},"cache":"prefer","wait_ms":0}')
while True:
    request = urllib.request.Request('https://buildorskip.dev/api/v1/site-data/',
        data=json.dumps(payload).encode(), method='POST', headers={
            'Authorization': 'Bearer ' + api_key, 'Content-Type': 'application/json',
            'Idempotency-Key': idempotency_key})
    try:
        response = urllib.request.urlopen(request, timeout=30)
    except urllib.error.HTTPError as error:
        response = error
    with response:
        status = response.status
        body = json.load(response)
        wait = max(5, int(response.headers.get('Retry-After', '0')),
                   body.get('retry_after_seconds') or 0)
    print(json.dumps(body, ensure_ascii=False, indent=2))
    if status == 429 and body.get('error', {}).get('code') == 'RATE_LIMITED':
        time.sleep(wait)
        continue
    if body.get('status') != 'pending':
        break
    payload = {'action': 'result', 'request_id': body['request_id']}
    time.sleep(wait)