当前位置
首页/数据接口/抖音关键词查询
抖音关键词查询

抖音关键词查询

查询抖音长尾关键词
AppId:10006
状态:正常
支付金额
100.00

(折合0.067元/次)

根据关键词查询长尾关键词,仅展示数据源为抖音的数据

计费规则:一次调用计费一次(翻页记一次)

接口地址https://openapi.cichacha.com/ciku/douyin/
请求方式GET
返回格式 Json
请求参数
参数类型描述是否必填
app_idstring接口AppId(本接口AppId为: 10006 )
access_keystring获取方式:用户中心->Api数据->接口管理
access_tokenstring计算方式请参照本页面《AccessToken计算规则》说明
wordstring关键词
pageint页码(不传默认为1,最大取值不超过100)
sort_fieldstring排序字段(仅支持int类型字段)
sort_directionstring排序方向(正序:asc;倒序:desc)
返回字段
参数类型描述
wordstring关键词
word_highlightstring关键词(标注分词)
index_pcint指数(PC)
index_mobileint指数(移动)
pv_pcint检索量(PC)
pv_mobileint检索量(移动)
relates_countint百度相关结果数
bid_pricefloat竞价参考价格
bid_show_reasonfloat竞价词特点
complexityint竞价复杂程度(值越大越难)
返回内容示例
{
	"code": 1,
	"data": {
		"total": 69652,
		"result": [{
			"bid_price": "0.32",
			"bid_show_reason": "高频热搜词,黑马词",
			"complexity": 4,
			"index_mobile": 1229,
			"index_pc": 931,
			"pv_mobile": 1229,
			"pv_pc": 31330,
			"relates_count": 100000000,
			"word": "seo",
			"word_highlight": "seo"
		}, {
			"bid_price": "1.03",
			"bid_show_reason": "高频热搜词,黑马词",
			"complexity": 4,
			"index_mobile": 393,
			"index_pc": 858,
			"pv_mobile": 393,
			"pv_pc": 2864,
			"relates_count": 100000000,
			"word": "seo综合查询",
			"word_highlight": "seo综合查询"
		},
         ........         
        ]
	},
	"message": "success"
}
AccessToken计算规则
  • 1.获取接入应用AppID (例如本接口AppId为:10006);
  • 2.从用户后台获取AccessKey和SecretKey;
  • 3.access_token计算方式:md5(appId+ accessKey+ md5(secretKey))
我们为您准备了相关编程语言的代码示例, 点我查看
系统级错误码
错误码返回消息错误说明
-4000app_id can not be emptyapp_id参数为空
-4001access_key can not be emptyaccess_key参数为空
-4002access_token can not be emptyaccess_token参数为空
-4003access key is invalidaccess_key可能错误或被禁用
-4004access token is invalidaccess token错误,access_token计算规则请查看本页面帮助
-3001no valid count接口可用次数不足
应用级错误码
错误码错误消息备注
-1word length can not be less than 2关键词长度不符合要求
-2word length is to large关键词长度不符合要求
-3word is forbidden违禁词
-4page size exceed limit单页数目范围超出限制(单页最大100条)
-5page number exceed limit页码范围超出限制(最大100页)
-6error params参数错误
PHPPythonGo
<?php
class Cichacha
{
    public function index()
    {
        $appId = 10000; //对应接口应用ID,此处以关键词挖掘接口为例
        $accessKey = "369c4754d0bd*********"; //用户中心-密钥管理获取
        $secretKey = "SSHGxwtRNb**************";//用户中心-密钥管理获取
        $apiUrl = "https://openapi.cichacha.com/....."; //接口地址
        $accessToken = md5($appId . $accessKey . md5($secretKey));
        $params = [ //必备参数
            "app_id" => $appId,
            "access_key" => $accessKey,
            "access_token" => $accessToken,
        ];
        $paramsApi = [ // 接口应用相关参数
            "word" => "seo" // 根据接口应用参数来增删,此处以关键词挖掘接口为例
        ];
        $res = $this->httpRequest($apiUrl, array_merge($params, $paramsApi));
        echo $res;
    }

    /**
     * HTTP请求
     * @param $url
     * @param array $data
     * @param false $isPost 是否是POST请求
     * @return bool|string
     */
    private function httpRequest($url, array $data = [], bool $isPost = false)
    {
        $ch = curl_init();
        if ($isPost == false) {
            $url = $url . "?" . http_build_query($data);
        }
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_TIMEOUT, 15);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
        if ($isPost) {
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        }
        $output = curl_exec($ch);
        curl_close($ch);
        return $output;
    }
}
?>
# -*- coding: utf-8 -*-
import hashlib
from requests import get


def md5_hex(s):
    return hashlib.md5(s.encode("utf-8")).hexdigest()


if __name__ == "__main__":
    appId = 10000  # 对应接口应用ID, 此处以关键词挖掘接口为例
    accessKey = "369c4754d0bd*********"  # 用户中心 - 密钥管理获取
    secretKey = "SSHGxwtRNb**************"  # 用户中心 - 密钥管理获取
    apiUrl = "https://openapi.cichacha.com/....."  # 接口地址
    accessToken = md5_hex(str(appId) + accessKey + md5_hex(secretKey))
    # 必要参数
    params = {
        "app_id": appId,
        "access_key": accessKey,
        "access_token": accessToken,
    }
    # 接口参数,本示例以关键词挖掘API为例
    paramsApi = {
        "word": "qq",
        "page": 1
    }
    params.update(paramsApi)
    res = get(apiUrl, params=params).json()
    print(res)

package main

import (
	"crypto/md5"
	"encoding/hex"
	"fmt"
	"io/ioutil"
	"net/http"
)

func Md5(str string) string {
	m := md5.New()
	m.Write([]byte(str))
	return hex.EncodeToString(m.Sum(nil))
}

func main() {
  appId := "10000" //对应接口应用ID,此处以关键词挖掘接口为例
  accessKey := "369c47***************" //用户中心-密钥管理获取
  secretKey := "SSHGxwt***************" //用户中心-密钥管理获取
  accessToken := Md5(fmt.Sprintf("%s%s%s", appId, accessKey, Md5(secretKey)))
  // 必备参数
  baseQueryString := fmt.Sprintf("app_id=%s&access_key=%s&access_token=%s&", appId, accessKey, accessToken)
  // 本处接口地址和参数以关键词挖掘接口为例
  apiUrl := fmt.Sprintf("https://openapi.cichacha.com/ciku/?%sword=%s&page=1", baseQueryString, "seo")
	client := &http.Client{}
	req, err := http.NewRequest("GET", apiUrl, nil)
	if err != nil {
		fmt.Println(err)
		return
	}
	res, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer res.Body.Close()
	body, err := ioutil.ReadAll(res.Body)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(string(body))
}