增强版搜索API(待发布) - GenericAdvancedSearch

更新时间:

本文介绍通过阿里云OpenAPI SDK调用通用增强搜索接口(GenericAdvancedSearch)的方法以及参数说明。GenericAdvancedSearch相较于GenericSearch提供了更好的权威网页、多样性网页召回,召回网页更多。增强版接口返回参数字段与格式与GenericAdvancedSearch一致。

重要

GenericAdvancedSearch 待发布 敬请期待

接口调用

请求结构体

参数

类型

是否可空

说明

约束

query

String

不可空

搜索问题

长度:>=2 and <=100

sessionId

String

可空

多轮交互的sessionId

长度:<=128

timeRange

String

可空

查询的时间范围

支持可选值:

  • OneDay:1天内

  • OneWeek:1周内

  • OneMonth:1月内

  • OneYear:1年内

  • NoLimit:无限制(默认值)

SDK

Java SDK

前提条件

已安装Java8或以上版本。

Maven依赖

<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>iqs20241111</artifactId>
    <version>1.1.3</version>
</dependency>

调用代码

package com.aliyun.iqs.example;

import com.alibaba.fastjson.JSON;
import com.aliyun.iqs20241111.Client;
import com.aliyun.iqs20241111.models.GenericAdvancedSearchRequest;
import com.aliyun.iqs20241111.models.GenericAdvancedSearchResponse;
import com.aliyun.iqs20241111.models.GenericSearchResult;
import com.aliyun.teaopenapi.models.Config;
import darabonba.core.exception.TeaException;

public class GenericAdvancedSearchMain {
    public static void main(String[] args) throws Exception {
        Client client = initClient();
        invoke(client,"维特根斯坦", "NoLimit");
    }

    private static Client initClient() throws Exception {
        // TODO: 使用您的AK/SK进行替换(建议通过环境变量加载)
        String accessKeyId = System.getenv("ACCESS_KEY");
        String accessKeySecret = System.getenv("ACCESS_SECRET");
        Config config = new Config()
            .setAccessKeyId(accessKeyId)
            .setAccessKeySecret(accessKeySecret);
        config.setEndpoint("iqs.cn-zhangjiakou.aliyuncs.com");
        return new Client(config);
    }

    private static void invoke(Client client, String query, String timeRange)  {
        GenericAdvancedSearchRequest request = new GenericAdvancedSearchRequest();
        request.setQuery(query);
        request.setTimeRange(timeRange);
        try {
            GenericAdvancedSearchResponse response = client.genericAdvancedSearch(request);
            GenericSearchResult result = response.getBody();
            System.out.println(JSON.toJSONString(result));
        } catch (TeaException e) {
            e.printStackTrace();
            System.out.println(e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            System.out.println(e.getMessage());
        }
    }
}

Python SDK

前提条件

您需要确保已安装Python3.8或以上版本。

安装SDK

pip3 install alibabacloud_iqs20241111==1.1.3

调用代码

import os
import uuid

from Tea.exceptions import TeaException
from alibabacloud_iqs20241111 import models
from alibabacloud_iqs20241111.client import Client
from alibabacloud_tea_openapi import models as open_api_models


class Sample:
    def __init__(self):
        pass

    @staticmethod
    def create_client() -> Client:
        config = open_api_models.Config(
            # TODO: 使用您的AK/SK进行替换(建议通过环境变量加载)
            access_key_id=os.environ.get('ACCESS_KEY'),
            access_key_secret=os.environ.get('ACCESS_SECRET')
        )
        config.endpoint = f'iqs.cn-zhangjiakou.aliyuncs.com'
        return Client(config)

    @staticmethod
    def main() -> None:
        client = Sample.create_client()
        run_instances_request = models.GenericAdvancedSearchRequest(
            query='杭州美食',
            time_range="NoLimit",
            session_id=str(uuid.uuid4())
        )
        try:
            response = client.generic_advanced_search(run_instances_request)
            print(f"api success, requestId:{response.body.request_id}, size :{len(response.body.page_items)}")
        except TeaException as e:
            code = e.code
            request_id = e.data.get("requestId")
            message = e.data.get("message")
            print(f"api exception, requestId:{request_id}, code:{code}, message:{message}")


if __name__ == '__main__':
    Sample.main()

Go sdk

前提条件

  • Go 环境版本必须不低于 1.10.x

安装SDK

require (
  github.com/alibabacloud-go/iqs-20241111 v1.1.3
  github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10
)

调用代码

package main

import (
	"fmt"
	"log"
	"os"

	openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
	iqs20241111 "github.com/alibabacloud-go/iqs-20241111/client"
	util "github.com/alibabacloud-go/tea-utils/v2/service"
	"github.com/alibabacloud-go/tea/tea"
)

const endpointURL = "iqs.cn-zhangjiakou.aliyuncs.com"

func createClient() (*iqs20241111.Client, error) {
	accessKeyID := os.Getenv("ACCESS_KEY")
	accessKeySecret := os.Getenv("ACCESS_SECRET")

	if accessKeyID == "" || accessKeySecret == "" {
		return nil, fmt.Errorf("ACCESS_KEY or ACCESS_SECRET environment variable is not set")
	}

	config := &openapi.Config{
		AccessKeyId:     tea.String(accessKeyID),
		AccessKeySecret: tea.String(accessKeySecret),
		Endpoint:        tea.String(endpointURL),
	}

	return iqs20241111.NewClient(config)
}

func runGenericSearch(client *iqs20241111.Client) error {
	request := &iqs20241111.GenericAdvancedSearchRequest{
		Query:     tea.String("杭州美食"),
		TimeRange: tea.String("NoLimit"),
	}
	runtime := &util.RuntimeOptions{}

	resp, err := client.GenericAdvancedSearchWithOptions(request, nil, runtime)
	if err != nil {
		return fmt.Errorf("generic advanced search failed: %w", err)
	}

	fmt.Printf("[%s] response: %s\n", *resp.Body.RequestId, resp.Body)
	return nil
}

func main() {
	client, err := createClient()
	if err != nil {
		log.Fatalf("Failed to create client: %v", err)
	}

	if err := runGenericSearch(client); err != nil {
		log.Fatalf("Error running generic search: %v", err)
	}
}

C++ SDK

前提条件

1.需要支持C++ 11环境:Windows: Visual Studio 2015或以上版本。Linux: GCC 4.9或以上版本

2.CMake 3.0以上版本

安装

1.下载核心类库代码:git clone https://github.com/aliyun/aliyun-openapi-cpp-sdk.git

2.替换/aliyun-openapi-cpp-sdk/core/src/CommonClient.cc内容为以下代码

/*
 * Copyright 1999-2019 Alibaba Cloud All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <algorithm>
#include <alibabacloud/core/AlibabaCloud.h>
#include <alibabacloud/core/CommonClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
#include <alibabacloud/core/location/LocationClient.h>
#include <ctime>
#include <iomanip>
#include <sstream>

#include <alibabacloud/core/Utils.h>

namespace AlibabaCloud {

namespace {
const std::string SERVICE_NAME = "Common";
}

CommonClient::CommonClient(const Credentials &credentials,
                           const ClientConfiguration &configuration)
    : CoreClient(SERVICE_NAME, configuration),
      credentialsProvider_(
          std::make_shared<SimpleCredentialsProvider>(credentials)),
      signer_(std::make_shared<HmacSha1Signer>()) {}

CommonClient::CommonClient(
    const std::shared_ptr<CredentialsProvider> &credentialsProvider,
    const ClientConfiguration &configuration)
    : CoreClient(SERVICE_NAME, configuration),
      credentialsProvider_(credentialsProvider),
      signer_(std::make_shared<HmacSha1Signer>()) {}

CommonClient::CommonClient(const std::string &accessKeyId,
                           const std::string &accessKeySecret,
                           const ClientConfiguration &configuration)
    : CoreClient(SERVICE_NAME, configuration),
      credentialsProvider_(std::make_shared<SimpleCredentialsProvider>(
          accessKeyId, accessKeySecret)),
      signer_(std::make_shared<HmacSha1Signer>()) {}

CommonClient::~CommonClient() {}

CommonClient::JsonOutcome
CommonClient::makeRequest(const std::string &endpoint, const CommonRequest &msg,
                          HttpRequest::Method method) const {
  auto outcome = AttemptRequest(endpoint, msg, method);
  if (outcome.isSuccess())
    return JsonOutcome(
        std::string(outcome.result().body(), outcome.result().bodySize()));
  else
    return JsonOutcome(outcome.error());
}

CommonClient::CommonResponseOutcome
CommonClient::commonResponse(const CommonRequest &request) const {
  auto outcome = makeRequest(request.domain(), request, request.httpMethod());
  if (outcome.isSuccess())
    return CommonResponseOutcome(CommonResponse(outcome.result()));
  else
    return CommonResponseOutcome(Error(outcome.error()));
}

void CommonClient::commonResponseAsync(
    const CommonRequest &request, const CommonResponseAsyncHandler &handler,
    const std::shared_ptr<const AsyncCallerContext> &context) const {
  auto fn = [this, request, handler, context]() {
    handler(this, request, commonResponse(request), context);
  };

  asyncExecute(new Runnable(fn));
}

CommonClient::CommonResponseOutcomeCallable
CommonClient::commonResponseCallable(const CommonRequest &request) const {
  auto task = std::make_shared<std::packaged_task<CommonResponseOutcome()>>(
      [this, request]() { return this->commonResponse(request); });

  asyncExecute(new Runnable([task]() { (*task)(); }));
  return task->get_future();
}

HttpRequest CommonClient::buildHttpRequest(const std::string &endpoint,
                                           const ServiceRequest &msg,
                                           HttpRequest::Method method) const {
  return buildHttpRequest(endpoint, dynamic_cast<const CommonRequest &>(msg),
                          method);
}

HttpRequest CommonClient::buildHttpRequest(const std::string &endpoint,
                                           const CommonRequest &msg,
                                           HttpRequest::Method method) const {
  if (msg.requestPattern() == CommonRequest::RpcPattern)
    return buildRpcHttpRequest(endpoint, msg, method);
  else
    return buildRoaHttpRequest(endpoint, msg, method);
}

std::string url_encode(const std::string &value) {
    std::ostringstream escaped;
    escaped.fill('0');
    escaped << std::hex;
    
    for (char c : value) {
        if (isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~') {
            escaped << c;
        } else {
            escaped << '%' << std::setw(2) << int((unsigned char) c);
        }
    }
    
    return escaped.str();
}

HttpRequest
CommonClient::buildRoaHttpRequest(const std::string &endpoint,
                                  const CommonRequest &msg,
                                  HttpRequest::Method method) const {
  const Credentials credentials = credentialsProvider_->getCredentials();

  Url url;
  if (msg.scheme().empty()) {
    url.setScheme("https");
  } else {
    url.setScheme(msg.scheme());
  }
  url.setHost(endpoint);
  url.setPath(msg.resourcePath());

  auto params = msg.queryParameters();
  std::map<std::string, std::string> queryParams;
  for (const auto &p : params) {
    if (!p.second.empty())
      queryParams[p.first] = p.second;
  }

  if (!queryParams.empty()) {
    std::stringstream queryString;
    for (const auto &p : queryParams) {
      if (p.second.empty())
        queryString << "&" << p.first;
      else
        queryString << "&" << p.first << "=" << url_encode(p.second);
    }
    url.setQuery(queryString.str().substr(1));
  }

  HttpRequest request(url);
  request.setMethod(method);

  if (msg.connectTimeout() != kInvalidTimeout) {
    request.setConnectTimeout(msg.connectTimeout());
  } else {
    request.setConnectTimeout(configuration().connectTimeout());
  }

  if (msg.readTimeout() != kInvalidTimeout) {
    request.setReadTimeout(msg.readTimeout());
  } else {
    request.setReadTimeout(configuration().readTimeout());
  }

  if (msg.headerParameter("Accept").empty()) {
    request.setHeader("Accept", "application/json");
  } else {
    request.setHeader("Accept", msg.headerParameter("Accept"));
  }

  std::stringstream ss;
  ss << msg.contentSize();
  request.setHeader("Content-Length", ss.str());
  if (msg.headerParameter("Content-Type").empty()) {
    request.setHeader("Content-Type", "application/octet-stream");
  } else {
    request.setHeader("Content-Type", msg.headerParameter("Content-Type"));
  }
  request.setHeader("Content-MD5",
                    ComputeContentMD5(msg.content(), msg.contentSize()));
  request.setBody(msg.content(), msg.contentSize());

  std::time_t t = std::time(nullptr);
  std::stringstream date;
#if defined(__GNUG__) && __GNUC__ < 5
  char tmbuff[26];
  strftime(tmbuff, 26, "%a, %d %b %Y %T", std::gmtime(&t));
  date << tmbuff << " GMT";
#else
  date << std::put_time(std::gmtime(&t), "%a, %d %b %Y %T GMT");
#endif
  request.setHeader("Date", date.str());
  request.setHeader("Host", url.host());
  request.setHeader("x-sdk-client",
                    std::string("CPP/").append(ALIBABACLOUD_VERSION_STR));
  request.setHeader("x-acs-region-id", configuration().regionId());
  if (!credentials.sessionToken().empty())
    request.setHeader("x-acs-security-token", credentials.sessionToken());
  request.setHeader("x-acs-signature-method", signer_->name());
  request.setHeader("x-acs-signature-nonce", GenerateUuid());
  request.setHeader("x-acs-signature-version", signer_->version());
  request.setHeader("x-acs-version", msg.version());

  std::stringstream plaintext;
  plaintext << HttpMethodToString(method) << "\n"
            << request.header("Accept") << "\n"
            << request.header("Content-MD5") << "\n"
            << request.header("Content-Type") << "\n"
            << request.header("Date") << "\n"
            << canonicalizedHeaders(request.headers());
  if (!queryParams.empty()) {
    std::stringstream queryString;
    for (const auto &p : queryParams) {
      if (p.second.empty())
        queryString << "&" << p.first;
      else
        queryString << "&" << p.first << "=" << p.second;
    }
    url.setQuery(queryString.str().substr(1));
  }
  if (!url.hasQuery())
    plaintext << url.path();
  else
    plaintext << url.path() << "?" << url.query();

  std::stringstream sign;
  sign << "acs " << credentials.accessKeyId() << ":"
       << signer_->generate(plaintext.str(), credentials.accessKeySecret());
  request.setHeader("Authorization", sign.str());
  return request;
}

HttpRequest
CommonClient::buildRpcHttpRequest(const std::string &endpoint,
                                  const CommonRequest &msg,
                                  HttpRequest::Method method) const {
  const Credentials credentials = credentialsProvider_->getCredentials();

  Url url;
  if (msg.scheme().empty()) {
    url.setScheme("https");
  } else {
    url.setScheme(msg.scheme());
  }
  url.setHost(endpoint);
  url.setPath(msg.resourcePath());

  auto params = msg.queryParameters();
  std::map<std::string, std::string> queryParams;
  for (const auto &p : params) {
    if (!p.second.empty())
      queryParams[p.first] = p.second;
  }

  queryParams["AccessKeyId"] = credentials.accessKeyId();
  queryParams["Format"] = "JSON";
  queryParams["RegionId"] = configuration().regionId();
  queryParams["SecurityToken"] = credentials.sessionToken();
  queryParams["SignatureMethod"] = signer_->name();
  queryParams["SignatureNonce"] = GenerateUuid();
  queryParams["SignatureVersion"] = signer_->version();
  std::time_t t = std::time(nullptr);
  std::stringstream ss;
#if defined(__GNUG__) && __GNUC__ < 5
  char tmbuff[26];
  strftime(tmbuff, 26, "%FT%TZ", std::gmtime(&t));
  ss << tmbuff;
#else
  ss << std::put_time(std::gmtime(&t), "%FT%TZ");
#endif
  queryParams["Timestamp"] = ss.str();
  queryParams["Version"] = msg.version();

  std::string bodyParamString;
  auto signParams = queryParams;
  auto bodyParams = msg.bodyParameters();
  for (const auto &p : bodyParams) {
    bodyParamString += "&";
    bodyParamString += (p.first + "=" + UrlEncode(p.second));
    signParams[p.first] = p.second;
  }

  std::stringstream plaintext;
  plaintext << HttpMethodToString(method) << "&" << UrlEncode(url.path()) << "&"
            << UrlEncode(canonicalizedQuery(signParams));
  queryParams["Signature"] =
      signer_->generate(plaintext.str(), credentials.accessKeySecret() + "&");

  std::stringstream queryString;
  for (const auto &p : queryParams)
    queryString << "&" << p.first << "=" << UrlEncode(p.second);
  url.setQuery(queryString.str().substr(1));

  HttpRequest request(url);
  if (msg.connectTimeout() != kInvalidTimeout) {
    request.setConnectTimeout(msg.connectTimeout());
  } else {
    request.setConnectTimeout(configuration().connectTimeout());
  }

  if (msg.readTimeout() != kInvalidTimeout) {
    request.setReadTimeout(msg.readTimeout());
  } else {
    request.setReadTimeout(configuration().readTimeout());
  }

  request.setMethod(method);
  request.setHeader("Host", url.host());
  request.setHeader("x-sdk-client",
                    std::string("CPP/").append(ALIBABACLOUD_VERSION_STR));

  if (!bodyParamString.empty()) {
    request.setBody(bodyParamString.c_str() + 1, bodyParamString.size() - 1);
  }
  return request;
}

} // namespace AlibabaCloud

3.Linux安装相关依赖:必须安装依赖的外部库文件 libcurl、libopenssl、libuuid、libjsoncpp。

对于 Redhat / Fedora 的系统上安装这些软件包

# use yum
yum install jsoncpp-devel openssl-devel libuuid-devel libcurl-devel

# use dnf
sudo dnf install libcurl-devel openssl-devel libuuid-devel libjsoncpp-devel

对于 Debian/Ubuntu 的系统

sudo apt-get install libcurl4-openssl-dev libssl-dev uuid-dev libjsoncpp-dev

4.对核心依赖库进行编译:在SDK根目录(aliyun-openapi-cpp-sdk)下执行sudo sh easyinstall.sh core

调用代码

#include <cstdlib>
#include <iostream>
#include <string>
#include <alibabacloud/core/AlibabaCloud.h>
#include <alibabacloud/core/CommonRequest.h>
#include <alibabacloud/core/CommonClient.h>
#include <alibabacloud/core/CommonResponse.h>

using namespace std;
using namespace AlibabaCloud;

int main(int argc, char** argv)
{
    AlibabaCloud::ClientConfiguration configuration("cn-zhangjiakou");
    // specify timeout when create client.
    configuration.setConnectTimeout(10000);
    configuration.setReadTimeout(10000);
    AlibabaCloud::Credentials credential("your ak", "your sk" );

    AlibabaCloud::CommonClient client(credential, configuration);
    AlibabaCloud::CommonRequest request(AlibabaCloud::CommonRequest::RequestPattern::RoaPattern);
    request.setHttpMethod(AlibabaCloud::HttpRequest::Method::Get);
    request.setDomain("iqs.cn-zhangjiakou.aliyuncs.com");
    request.setVersion("2024-11-11");
    request.setQueryParameter("query", "黑神话");
    request.setQueryParameter("timeRange", "NoLimit");
    request.setResourcePath("/linked-retrieval/linked-retrieval-entry/v2/linkedRetrieval/commands/genericAdvancedSearch");
    request.setRequestPattern(AlibabaCloud::CommonRequest::RequestPattern::RoaPattern);

    request.setHeaderParameter("Content-Type", "application/json");
    auto response = client.commonResponse(request);
    if (response.isSuccess()) {
        printf("request success.\n");
        printf("result: %s\n", response.result().payload().c_str());
    }
    else {
        printf("error: %s\n", response.error().detail().c_str());
    }
    AlibabaCloud::ShutdownSdk();
    return 0;
}

返回结构体

字段

字段类型

是否可空

字段说明

样例

requestId

string

不可空

请求RequestId, 排查问题时可以提供此信息

pageItems[]

cardType

string

不可空

卡片类型,目前支持

  • structure_web_info,标准网页结构;占召回结果的90%以上

  • baike_sc/baike,百科

  • news_uchq,UC新闻

  • wenda_selected,问答

structure_web_info

title

string

可空

网站标题

2024五一劳动节放假调休时间表(附放假日历)

htmlTitle

string

不可空

网站标题,html内容

<em>2024五一</em>劳动节<em>放假</em>调休<em>时间表</em>(附放假日历)-本地宝

link

string

不可空

网站地址

http://m.sh.bendibao.com/tour/278811.html

displayLink

string

不可空

可读的网站地址

m.sh.bendibao.com

htmlSnippet

string

不可空

网页动态摘要,匹配到关键字的部分内容,最长250字符

说明

此字段可以作为RAG场景的召回context,如果需要更全的网站正文,可以使用mainText

<em>2024五一</em>劳动节<em>放假安排</em>:51日至5日<em>放假</em>调休,共5天。428日(星期日)、511日(星期六)上班。

publishTime

int64

不可空

发布时间,单位(毫秒),对于部分没有发布时间的网站会使用默认值:0

1714123620000

score

double

不可空

相关度分数

mainText

string

可空

网页正文,默认正文前500字符。如需长正文(前3000字符)请联系您的阿里云客户经理进行开通。

重要

目前已支持structure_web_info、news_uchq等高频召回结果正文解析。

导语\t\t \t\t2024\t五一\t劳动\t节\t放假\t安排\t:\t5\t月\t1\t日\t至\t5\t日\t放假\t调休\t,\t共\t5\t天\t。\t4\t月\t28\t日\t(\t星期\t日\t)\t、\t5\t月\t11\t日\t(\t星期\t六\t)\t上班\t。\t\t\n\t\t2024\t五一\t劳动\t节\t放假\t安排\t\t\n\t\t5\t月\t1\t日\t至\t5\t日\t放假\t调休\t,\t共\t5\t天\t。\t4\t月\t28\t日\t(\t星期\t日\t)\t、\t5\t月\t11\t日\t(\t星期\t六\t)\t上班\t。\t\t\n\t\t第\t一\t

markdownText

string

可空

网页内容的markdown格式。

# 2024年五一放假安排:51日至5日放假调休,428日、511日上班_腾讯新闻\\n\\nurl: https://new.qq.com/rain/a/20240412A03BQ900\\n\\narticle_title: 2024年五一放假安排:51日至5日放假调休,428日、511日上班\\n\\ntime: \\n\\n---\\n根据国务院办公厅通知精神,现将2024年劳动节放假安排通知如下:51日(星期三)至55日(星期日)放假调休,共5天。428日(星期日)、511日(星期六)上班。 \\n\\n![图片](https://inews.gtimg.com/om_bt/OysnGu6kzeeO49TjK4XXd6ptAX3A07jOExNB-gvmJSekMAA/641) \\n\\n![图片](https://inews.gtimg.com/om_bt/Ox2li6FDj5pU1RRbVfFgmTX5LLJ7jg_XjAwtp-9BcCh1YAA/641) \\n\\n2024年还有哪些假期? \\n\\n端午节 \\n\\n610日放假 \\n\\n与周末连休 \\n\\n3天 \\n\\n![图片]...

images[]

imageLink

string

可空

图片地址

https://imgbdb4.bendibao.com/shbdb/news/202310/26/20231026112304_25716.jpg

width

int32

可空

宽度:像素

864

height

int32

可空

高度:像素

1704

pageMap

htmlSnippetTruncate

string

可空

网页动态摘要是否被截断,超出长度时会被截断

  • 0:未截断

  • 1:截断

0

mainTextTruncate

string

可空

网页正文是否被截断,超出长度时会被截断

  • 0:未截断

  • 1:截断

  • 2:正文不可用(如mainText空值)

1

hostname

string

可空

站点名

新华网

hostLogo

string

可空

站点的logo

https://s2.zimgs.cn/ims?kt=url&at=smstruct&key=aHR0cHM6Ly9ndy5hbGljZG4uY29tL0wxLzcyMy8xNTY1MjU2NjAwLzJhL2YwL2I0LzJhZjBiNDQxMGI5YmVlMDVjOGVlNGJmODk3MTNkNTFjLnBuZw==&sign=yx:CUlNNQVJQjFrk3Kxt2F3KWhTOFU=&tv=400_400

siteLabel

string

可空

站点标签,当前支持:

  • 权威媒体

  • 党政机关

说明

此字段可以辅助进行权威性判定,为政府认定媒体,故召回率不高。

权威媒体

weiboItems[]

可空

cardType

string

不可空

卡片类型,固定为weibo_strong;

query能够匹配到微博场景才会返回微博数据

weibo_strong

username

string

不可空

微博用户名

白鹿科技

link

string

不可空

搜索结果微博地址

https://m.weibo.cn/detail/5024099350350075?wm=90194_90009

htmlSnippet

string

不可空

微博内容

【小调查:你会买<em>小米SU7</em>吗?】#小米SU7路测覆盖300多城市#417日,@小米汽车 发文称SU7道路测试覆盖全国300多个城市,涵盖极寒,极热天气,总里程数高达540万公里,目前仍在进行中。 网页链接

publishDisplayTime

string

可空

发布时间

1小时前

images[]

string

可空

微博的附带图片

sceneItems[]

可空

type

string

不可空

类型,支持的类型请见返回体sceneItems类型及对应detail结构

time

detail

string

不可空

详细信息,结构体请见返回体sceneItems类型及对应detail结构

{

"title": "东京时间",

"targetTimeZone": "Asia/Tokyo",

"targetTimeMillisecond": "1733999009797",

"targetTime": "2024-12-12 18:23:29",

"beijingTimeZone": "PRC",

"beijingTimeMillisecond": "1733995409797"

queryContext

originalQuery

query

string

不可空

原始请求:query

最近比亚迪的销量如何

timeRange

string

可空

原始请求:timeRange

NoLimit

industry

string

可空

原始请求:industry

page

int32

可空

原始请求:page

1

rewrite

enabled

boolean

不可空

改写对本次请求是否开启。目前灰度中,可联系客户经理进行开通

true

timeRange

string

可空

改写后的timeRange,只有改写后的值与原始timeRange不一致时,才会返回

重要

当客户指定timeRange为非NoLimit值时,timeRange改写会被关闭

OneMonth

searchInformation

total

int64

不可空

总条数

8230595

searchTime

int64

不可空

搜索耗时

1441

错误码

接口错误码

Status

错误码

错误信息

404

InvalidAccessKeyId.NotFound

Specified access key is not found.

403

Retrieval.NotActivate

Please activate AI search service

403

Retrieval.Arrears

Please recharge first.

403

Retrieval.NotAuthorised

Please authorize the AliyunImarketingFullAccess to the sub-account

403

Retrieval.TestUserPeriodExpired

The test period has expired.

429

Retrieval.Throttling.User

Request was denied due to user flow control.

429

Retrieval.TestUserQueryPerDayExceeded

The query per day exceed the limit.