Skip to content

Google 批量流量估算

POST /v3/dataforseo_labs/google/bulk_traffic_estimation/live

本接口使用 POST 方法,路径为:

/v3/dataforseo_labs/google/bulk_traffic_estimation/live

接口可一次估算最多 1,000 个域名、子域名或网页的月度流量。除自然搜索流量外,还会分别返回付费搜索、精选摘要和本地搜索的流量估算值。

流量估算值通过以下方式计算:

> 估算流量 = 点击率(CTR)× 搜索量

系统会汇总目标在相应搜索结果类型中排名的数据。

计费说明

本接口按请求计费。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

所有 POST 数据使用 UTF-8 编码的 JSON 格式。请求体是 JSON 数组;本 Live 接口每次请求只能提交 1 个任务。

调用限制:

  • 每分钟最多提交 2,000 次 API 调用。
  • 每个 Live API 请求只能 1 个任务。
  • 同时提交的请求数最多为 30 个。
  • targets 最多可 1,000 个域名、子域名或网页。

请求参数

参数类型说明
targetsarray要估算的目标列表,可填写域名、子域名或网页。域名和子域名不应 https://www.;网页填写协议的绝对 URL,例如 https://www.example.com/page。最多支持 1,000 个目标。
location_namestring地区名。使用此参数时无需填写 location_code。可通过 /v3/dataforseo_labs/locations_and_languages 获取可用地区。忽略此参数时,返回所有可用地区的数据。示例:United Kingdom
location_codeinteger地区代码。使用此参数时无需填写 location_name。可通过 /v3/dataforseo_labs/locations_and_languages 获取可用地区代码。忽略此参数时,返回所有可用地区的数据。示例:2840
language_namestring语言名。使用此参数时无需填写 language_code。可通过 /v3/dataforseo_labs/locations_and_languages 获取可用语言。忽略此参数时,返回所有可用语言的数据。示例:English
language_codestring语言代码。使用此参数时无需填写 language_name。可通过 /v3/dataforseo_labs/locations_and_languages 获取可用语言代码。忽略此参数时,返回所有可用语言的数据。示例:en
item_typesarray指定需要返回的搜索结果类型。可选值:organicpaidfeatured_snippetlocal_pack。当数组中 organic 以外的类型时,结果会数组中的第一个类型排序。
ignore_synonymsboolean是否忽略高度相似的。设置为 true 时返回核心,排除高度相似的。默认值:false
tagstring用户自定义任务标识,最多 255 个字符。可用于识别任务并将请求与结果匹。提交的值会原样返回在响应的 data 对象中。

targets 格式要求

json
[
  "example.com",
  "blog.example.com",
  "https://www.example.com/products/page"
]

请求示例

cURL

bash
curl --location --request POST \
  "https://api.seermartech.cn/v3/dataforseo_labs/google/bulk_traffic_estimation/live" \
  --header "Authorization: Bearer smt_live_YOUR_KEY" \
  --header "Content-Type: application/json" \
  --data-raw '[
    {
      "targets": [
        "example.com",
        "cnn.com",
        "forbes.com"
      ],
      "location_code": 2840,
      "language_code": "en",
      "item_types": [
        "organic",
        "paid",
        "featured_snippet",
        "local_pack"
      ],
      "ignore_synonyms": false,
      "tag": "traffic-estimation-demo"
    }
  ]'

Python

python
import requests

url = "https://api.seermartech.cn/v3/dataforseo_labs/google/bulk_traffic_estimation/live"

headers = {
    "Authorization": "Bearer smt_live_YOUR_KEY",
    "Content-Type": "application/json",
}

payload = [
    {
        "targets": [
            "example.com",
            "cnn.com",
            "forbes.com",
        ],
        "location_name": "United States",
        "language_name": "English",
        "item_types": [
            "organic",
            "paid",
        ],
    }
]

response = requests.post(url, headers=headers, json=payload)
result = response.json()

if result.get("status_code") == 20000:
    print(result)
else:
    print(
        "请求失败,错误码:%s,错误信息:%s"
        % (result.get("status_code"), result.get("status_message"))
    )

TypeScript

typescript
import axios from "axios";

const payload = [
  {
    targets: [
      "example.com",
      "cnn.com",
      "forbes.com",
    ],
    location_name: "United States",
    language_name: "English",
    item_types: [
      "organic",
      "paid",
    ],
  },
];

axios
  .post(
    "https://api.seermartech.cn/v3/dataforseo_labs/google/bulk_traffic_estimation/live",
    payload,
    {
      headers: {
        Authorization: "Bearer smt_live_YOUR_KEY",
        "Content-Type": "application/json",
      },
    }
  )
  .then((response) => {
    const result = response.data;

    if (result.status_code === 20000) {
      console.log(result);
    } else {
      console.error(
        `请求失败,错误码:${result.status_code},错误信息:${result.status_message}`
      );
    }
  })
  .catch((error) => {
    console.error("网络或服务异常:", error.message);
  });

响应结构

接口返回 JSON 数据 tasks 数组。

顶层响应字段

字段类型说明
versionstring当前 API 版本。
status_codeinteger通用状态码。成功时通常为 20000。完整错误码请参考错误码文档。
status_messagestring通用状态信息。
timestring请求执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks_countintegertasks 数组中的任务数量。
tasks_errorintegertasks 数组中返回错误的任务数量。
tasksarray任务结果数组。

任务字段

字段类型说明
idstring任务唯一标识,UUID 格式。
status_codeinteger任务状态码,通常位于 1000060000 范围。
status_messagestring任务状态信息。
timestring任务执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
result_countintegerresult 数组中的数量。
patharray请求 URL 路径。
dataobject请求时提交的参数。
resultarray任务结果数组。

result 字段

字段类型说明
se_typestring搜索引擎类型,此接口通常为 google
location_codeinteger | null请求中的地区代码。无对应数据时为 null
language_codestring | null请求中的语言代码。无对应数据时为 null
total_countinteger数据库中与请求条件匹的结果总数。
items_countintegeritems 数组中返回的结果数量。
itemsarray含流量估算数据的目标列表。

items 字段

字段类型说明
se_typestring搜索引擎类型。
targetstring请求中的目标域名、子域名或网页。
metricsobject当前目标的流量估算数据。

metrics 字段

organic:自然搜索流量

字段类型说明
etvfloat预计月度自然搜索流量。根据目标排名的点击率与搜索量计算。
countinteger含该目标的自然搜索结果页数量。
字段类型说明
etvfloat预计月度付费搜索流量。根据目标排名的点击率与搜索量计算。
countinteger含该目标的付费搜索结果页数量。
字段类型说明
etvfloat预计月度精选摘要流量。根据目标在精选摘要类别中排名的点击率与搜索量计算。
countinteger含该目标的精选摘要条目数量。

local_pack:本地搜索流量

字段类型说明
etvfloat预计月度本地搜索流量。根据目标在本地搜索类别中排名的点击率与搜索量计算。
countinteger含该目标的本地搜索条目数量。

响应示例

json
{
  "version": "0.1.20210917",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.2930 sec.",
  "cost": 0.0103,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "01234567-89ab-cdef-0123-456789abcdef",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.2500 sec.",
      "cost": 0.0103,
      "result_count": 1,
      "path": [
        "v3",
        "dataforseo_labs",
        "google",
        "bulk_traffic_estimation",
        "live"
      ],
      "data": {
        "api": "dataforseo_labs",
        "function": "bulk_traffic_estimation",
        "se_type": "google",
        "targets": [
          "example.com",
          "cnn.com",
          "forbes.com"
        ],
        "location_code": 2840,
        "language_code": "en",
        "item_types": [
          "organic",
          "paid"
        ]
      },
      "result": [
        {
          "se_type": "google",
          "location_code": 2840,
          "language_code": "en",
          "total_count": 3,
          "items_count": 3,
          "items": [
            {
              "se_type": "google",
              "target": "example.com",
              "metrics": {
                "organic": {
                  "etv": 12500.5,
                  "count": 320
                },
                "paid": {
                  "etv": 1850.2,
                  "count": 42
                },
                "featured_snippet": {
                  "etv": 320.6,
                  "count": 8
                },
                "local_pack": {
                  "etv": 95.4,
                  "count": 3
                }
              }
            }
          ]
        }
      ]
    }
  ]
}

错误处理

请根据顶层或任务级别的 status_codestatus_message 判断请求是否成功:

  • status_code = 20000:请求或任务成功。
  • tasks_error > 0:至少有一个任务处理失败,应逐项检查 tasks 中对应任务的状态。
  • 任务级别的 status_code 可能与顶层状态码不同,应优根据任务级状态判断任务结果。
  • 生产环境建议对网络异常、HTTP 错误、响应时、参数校验失败和业务状态码异常进行统一处理。

实用场景

  • 批量评估竞品域名的自然搜索流量,快速比较不同竞品的 SEO 覆盖规模,为市场分析和竞争策略制定提供依据。
  • 拆分统计自然搜索与付费搜索流量,判断竞争对手的流量获取方式,制定 SEO 与 SEM 预算分方案。
  • 识别精选摘要和本地搜索带来的流量,评估 SERP 特殊结果的业务价值,指导结构优化和本地 SEO 投。
  • 批量监测多个子域名或网页的流量潜力,定位站点中高价值业务线和重点页面,支持优级排序。
  • 按地区和语言比较目标市场流量,分析不同国家或语言市场的搜索机会,为化 SEO 和市场扩张提供数据依据。

统一入口:官网 · LLM API · 控制台