Skip to content

Google Keyword Ideas 实时接口

POST /v3/dataforseo_labs/google/keyword_ideas/live

本接口使用 POST /v3/dataforseo_labs/google/keyword_ideas/live,根据最多 200 个种子所属的产品或服务类别,返回的建议及搜索数据。

每个建议可:

  • 最近一个月的搜索量;
  • 过去 12 个月的搜索量趋势;
  • 点击费用(CPC)与竞争度;
  • 首页顶部广告位的最低、最高出价;
  • 难度、搜索意图、SERP 特征;
  • 前 10 个自然排名页面的平均外链指标;
  • 可选的点击流数据及性别、年龄分布。

**数据源:**按产品类别划分的数据库。
**搜索算法:**基于性的类别匹算法,查找与种子属于相同类别的搜索词。

例如,种子为 keyword researchcontent marketing 时,可能返回:

  • free adword tools
  • find longtail keywords
  • how to do keywords research
  • seo keyword research template

默认不启用额外排序,closely_variants 默认为 false

请求地址

http
POST https://api.seermartech.cn/v3/dataforseo_labs/google/keyword_ideas/live

每次请求只能一个任务,但请求体是 JSON 数组。接口限制如下:

  • 每个任务最多指定 200 个种子; 平台限流以认证说明中的 30/60/120 次/分钟规则为准;
  • 同时处理的请求数最多为 30;
  • 所有请求数据使用 UTF-8 编码的 JSON 格式。

计费说明

接口按请求计费。启用 include_clickstream_data 后,单次请求费用按基础价格的 2 倍计算。

扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求参数

参数类型说明
keywordsarray种子数组,最多 200 个。会被转换为小写格式。
location_namestring条件填地理位置名。未指定 location_code 时填。
location_codeinteger条件填地理位置唯一标识。未指定 location_name 时填。指定 location_namelocation_code 一个。
language_namestring语言名。指定后无需指定 language_code
language_codestring语言代码。指定后无需指定 language_name
closely_variantsboolean搜索模式。true 使用词组匹,false 使用广泛匹。默认值为 false
ignore_synonymsboolean是否排除高度相似的。true 返回核心,默认值为 false
include_serp_infoboolean是否返回每个的 SERP 数据结果数量、 URL 和 SERP 特征。默认值为 false
include_clickstream_databoolean是否返回点击流指标。设为 true 时,将返回 clickstream_keyword_infokeyword_info_normalized_with_clickstreamkeyword_info_normalized_with_bing。默认值为 false
limitintegeritems 数组最多返回的数量。默认值为 700,最大值为 1000
offsetinteger结果偏移量。默认值为 0。例如设置为 10,将跳过前 10 条结果。建议在获取不 10,000 条结果时使用。
offset_tokenstring后续分页令牌。适用于获取 10,000 条结果的场景。指定该参数后,除 limit 外的参数不会参与任务处理。
filtersarray结果过滤条件,最多 8 个。不能按 relevance 过滤。
order_byarray结果排序规则,最多设置 3 条。支持升序 asc 和降序 desc
tagstring自定义任务标识,最多 255 个字符。该值会原样返回在响应的 data 对象中。

地理位置与语言

可通过以下接口查询可用的位置和语言:

http
GET https://api.seermartech.cn/v3/dataforseo_labs/locations_and_languages

示例:

json
{
  "location_name": "United Kingdom",
  "location_code": 2840,
  "language_name": "English",
  "language_code": "en"
}

如果不指定语言,接口默认使用指定位置中记录最多的语言。

过滤器

过滤器格式为:

json
[
  ["keyword_info.search_volume", ">", 100],
  "and",
  ["keyword_info.competition_level", "=", "LOW"]
]

支持的运算符:

text
regex、not_regex、<、<=、>、>=、=、<>、
in、not_in、match、not_match、
ilike、not_ilike、like、not_like

likenot_likeilikenot_ilike 支持使用 % 匹任意长度的字符串。

排序

默认性分数 relevance 降序排列,以优返回最的建议。relevance 用于排序,不能作为过滤条件,也不会出现在结果字段中。

排序示例:

json
[
  ["keyword_info.search_volume", "desc"],
  ["keyword_info.cpc", "desc"]
]

请求示例

curl

bash
curl --location --request POST \
  "https://api.seermartech.cn/v3/dataforseo_labs/google/keyword_ideas/live" \
  --header "Authorization: Bearer smt_live_YOUR_KEY" \
  --header "Content-Type: application/json" \
  --data-raw '[
    {
      "keywords": ["phone", "watch"],
      "location_code": 2840,
      "language_code": "en",
      "include_serp_info": true,
      "filters": [
        ["keyword_info.search_volume", ">", 10]
      ],
      "limit": 3
    }
  ]'

Python

python
import requests

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

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

payload = [
    {
        "keywords": ["phone", "watch"],
        "location_name": "United States",
        "language_name": "English",
        "filters": [
            ["keyword_info.search_volume", ">", 10]
        ],
        "limit": 3,
    }
]

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

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

TypeScript

typescript
import axios from "axios";

const payload = [
  {
    keywords: ["phone", "watch"],
    location_code: 2840,
    language_name: "English",
    filters: [
      ["keyword_info.search_volume", ">", 10],
    ],
    limit: 3,
  },
];

axios
  .post(
    "https://api.seermartech.cn/v3/dataforseo_labs/google/keyword_ideas/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任务状态码,通常在 10000-60000 范围。
status_messagestring任务状态信息。
timestring任务执行耗时。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
result_countintegerresult 数组中的数量。
patharray请求 URL 路径。
dataobject创建任务时提交的参数。
resultarray建议结果。

结果字段

result

字段类型说明
se_typestring搜索引擎类型,例如 google
seed_keywordsarray请求中提交的种子。经过 URL 编码的会被解码,+ 会转换为空格。
location_codeinteger请求中的地理位置代码。
language_codestring请求中的语言代码。
total_countinteger数据库中与请求的结果总数。
items_countinteger本次返回的 items 数量。
offsetinteger当前结果偏移量。
offset_tokenstring后续分页令牌。可用于获取当前任务的下一批结果。每次后续任务使用的令牌均不相同。
itemsarray建议及数据。

items

字段类型说明
se_typestring搜索引擎类型。
keywordstring返回的建议。
location_codeinteger地理位置代码。
language_codestring语言代码。
keyword_infoobject基础指标。
clickstream_keyword_infoobject/null点击流指标。在 include_clickstream_data=true 时返回。
keyword_propertiesobject附加信息。
serp_infoobject/nullSERP 数据。在 include_serp_info=true 且数据库存在数据时返回。
avg_backlinks_infoobject排名前 10 的自然结果页面的平均外链指标。
search_intent_infoobject搜索意图信息。
keyword_info_normalized_with_bingobject使用 Bing 搜索量进行归一化后的指标。
keyword_info_normalized_with_clickstreamobject使用点击流数据归一化后的指标。

keyword_info 字段

字段类型说明
se_typestring搜索引擎类型。
last_updated_timestring数据更新时间,UTC 格式:yyyy-MM-dd HH:mm:ss +00:00
competitionfloat竞争度,取值范围为 0-1,基于广告数据计算。
competition_levelstring/null付费 SERP 竞争级别,可选值为 LOWMEDIUMHIGH。未知时为 null
cpcfloat每次点击费用,原始数据通常以计价。人民币扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
search_volumeinteger平均月搜索量,表示指定区域在 Google 上的估算搜索次数。
low_top_of_page_bidfloat广告展示在首页顶部位置所需的较低出价估计值。
high_top_of_page_bidfloat广告展示在首页顶部位置所需的较高出价估计值。
categoriesarray产品和服务类别。
monthly_searchesarray过去 12 个月的月度搜索量。
search_volume_trendobject搜索量趋势变化。

search_volume_trend 字段:

字段类型说明
monthlyinteger相比上个月的搜索量变化百分比。
quarterlyinteger相比上一季度的搜索量变化百分比。
yearlyinteger相比上一年的搜索量变化百分比。

monthly_searches 数组中的对象:

字段类型说明
yearinteger年份。
monthinteger月份。
search_volumeinteger当月平均搜索量。

keyword_properties 字段

字段类型说明
se_typestring搜索引擎类型。
core_keywordstring/null同义词分组中的核心。无法识别同义词时为 null
synonym_clustering_algorithmstring/null同义词聚类算法。keyword_metrics 表示基于指标,text_processing 表示基于文本处理。
keyword_difficultyinteger难度,范围为 0-100,用于表示自然搜索结果前 10 名的难度。
detected_languagestring系统识别出的语言。
is_another_languageboolean识别出的语言是否与请求指定语言不同。
words_countinteger的单词数量。

serp_info 字段

未启用 include_serp_info,或数据库中没有该的 SERP 数据时,serp_infonull

字段类型说明
se_typestring搜索引擎类型。
check_urlstring对应的搜索结果页 URL,可用于校验结果。
serp_item_typesarraySERP 中出现的结果类型。
se_results_countstring搜索结果数量。
last_updated_timestringSERP 数据更新时间。
previous_updated_timestring上一次 SERP 数据更新时间。

常见 serp_item_types括:

text
answer_box、app、carousel、multi_carousel、featured_snippet、
google_flights、google_reviews、third_party_reviews、google_posts、
images、jobs、knowledge_graph、local_pack、hotels_pack、map、
organic、paid、people_also_ask、related_searches、shopping、
top_stories、video、events、recipes、scholarly_articles、
popular_products、podcasts、questions_and_answers、local_services、
google_hotels、math_solver、currency_box、product_considerations、
short_videos、refine_products、explore_brands、perspectives、
discussions_and_forums、compare_sites、courses、ai_overview

结果明细会针对 organicpaidfeatured_snippetlocal_pack素返回。

该对象表示自然搜索结果前 10 个页面的平均外链和排名指标。

字段类型说明
se_typestring搜索引擎类型。
backlinksfloat平均反向链接数量。
dofollowfloat平均 dofollow 链接数量。
referring_pagesfloat平均引用页面数量。
referring_domainsfloat平均引用域名数量。
referring_main_domainsfloat平均引用主域名数量。
rankfloat平均页面排名。
main_domain_rankfloat平均主域名排名。
last_updated_timestring外链数据更新时间。

search_intent_info 字段

字段类型说明
se_typestring搜索引擎类型,目前为 google
main_intentstring主要搜索意图。可选值:informationalnavigationalcommercialtransactional
foreign_intentarray/null补搜索意图,取值同 main_intent
last_updated_timestring搜索意图数据更新时间。

clickstream_keyword_info 字段

在请求中设置 include_clickstream_data=true 时返回。

字段类型说明
search_volumeinteger基于点击流数据的月平均搜索量。
last_updated_timestring点击流数据集更新时间。
gender_distributionobject按性别划分的估算点击流指标分布。
age_distributionobject按年龄划分的估算点击流指标分布。
monthly_searchesarray按月份统计的点击流搜索量。

gender_distribution

json
{
  "female": 0,
  "male": 0
}

age_distribution 支持以下字段:

text
18-24、25-34、35-44、45-54、55-64

归一化指标

keyword_info_normalized_with_bing

字段类型说明
last_updated_timestring数据集更新时间。
search_volumeinteger当前搜索量。
is_normalizedboolean是否已使用 Bing 数据完成归一化。
monthly_searchesarray按年月统计的归一化搜索量。

keyword_info_normalized_with_clickstream

字段类型说明
last_updated_timestring数据集更新时间。
search_volumeinteger当前搜索量。
is_normalizedboolean是否已使用点击流数据完成归一化。
monthly_searchesarray按年月统计的归一化搜索量。

两个 monthly_searches 数组中的对象均:

字段类型说明
yearinteger年份。
monthinteger月份。
search_volumeinteger对应月份的搜索量。

响应示例

json
{
  "version": "0.1.20240801",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.7097 sec.",
  "cost": 0.0103,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "b5a2dce9-4397-4758-aa28-65ab367d3948",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.7097 sec.",
      "cost": 0.0103,
      "result_count": 1,
      "path": [
        "v3",
        "dataforseo_labs",
        "google",
        "keyword_ideas",
        "live"
      ],
      "data": {
        "api": "dataforseo_labs",
        "function": "keyword_ideas",
        "se_type": "google",
        "keywords": ["phone", "watch"],
        "location_code": 2840,
        "language_code": "en",
        "include_serp_info": true,
        "limit": 3
      },
      "result": [
        {
          "se_type": "google",
          "seed_keywords": ["phone", "watch"],
          "location_code": 2840,
          "language_code": "en",
          "total_count": 533763,
          "items_count": 3,
          "offset": 0,
          "offset_token": "NEXT_PAGE_TOKEN",
          "items": [
            {
              "se_type": "google",
              "keyword": "cell phone signal booster",
              "location_code": 2840,
              "language_code": "en",
              "keyword_info": {
                "se_type": "google",
                "last_updated_time": "2024-08-11 18:11:54 +00:00",
                "competition": 1,
                "competition_level": "HIGH",
                "cpc": 1.05,
                "search_volume": 22200,
                "low_top_of_page_bid": 0.31,
                "high_top_of_page_bid": 1.15,
                "categories": [10002, 10013],
                "monthly_searches": [
                  {
                    "year": 2024,
                    "month": 7,
                    "search_volume": 22200
                  }
                ],
                "search_volume_trend": {
                  "monthly": 22,
                  "quarterly": 22,
                  "yearly": 0
                }
              },
              "clickstream_keyword_info": null,
              "keyword_properties": {
                "se_type": "google",
                "core_keyword": "cell phone signal booster for phone",
                "synonym_clustering_algorithm": "text_processing",
                "keyword_difficulty": 23,
                "detected_language": "en",
                "is_another_language": false,
                "words_count": 4
              },
              "serp_info": {
                "se_type": "google",
                "check_url": "https://www.google.com/search?q=cell%20phone%20signal%20booster",
                "serp_item_types": ["organic", "paid", "people_also_ask"],
                "se_results_count": "13500000",
                "last_updated_time": "2024-08-04 11:06:04 +00:00",
                "previous_updated_time": "2024-06-22 20:35:21 +00:00"
              },
              "avg_backlinks_info": {
                "se_type": "google",
                "backlinks": 111.6,
                "dofollow": 34.7,
                "referring_pages": 104.5,
                "referring_domains": 29,
                "referring_main_domains": 26.3,
                "rank": 103.5,
                "main_domain_rank": 530.7,
                "last_updated_time": "2024-08-04 11:06:06 +00:00"
              },
              "search_intent_info": {
                "se_type": "google",
                "main_intent": "transactional",
                "foreign_intent": null,
                "last_updated_time": "2023-03-03 12:40:39 +00:00"
              },
              "keyword_info_normalized_with_bing": {
                "last_updated_time": "2024-08-16 10:43:48 +00:00",
                "search_volume": 12895,
                "is_normalized": true,
                "monthly_searches": []
              },
              "keyword_info_normalized_with_clickstream": {
                "last_updated_time": "2024-08-16 10:43:48 +00:00",
                "search_volume": 15498,
                "is_normalized": true,
                "monthly_searches": []
              }
            }
          ]
        }
      ]
    }
  ]
}

错误处理

请根据顶层 status_code、任务级 status_codestatus_message 判断请求是否成功。建议对以下进行处理:

  • HTTP 请求失败;
  • 顶层状态码非 20000
  • tasks_error 大于 0;
  • 单个任务的状态码非 20000
  • 分页令牌失效或结果为空;
  • 请求参数冲突,例如同时传不匹的语言名称和语言代码。

实用场景

  • 扩展种子词库:根据核心产品词批量发现同类别,扩大 SEO覆盖范围并减少人工调研成本。
  • 筛选选题:结合搜索量、趋势和难度筛选潜力词,为博客、落地页和专题页制定优级。
  • 识别商业机会:使用竞争度、CPC 和搜索意图定位高商业价值词,支持广告投放与转化页建设。
  • 分析 SERP 竞争:获取 SERP 特征和前 10 名页面的平均外链指标,评估目标的排名门槛。
  • 刻画搜索人群:启用点击流数据后分析性别、年龄及归一化搜索量,为定位和市场细分提供依据。

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