Sand AISand AI MAGI-2MAGI-2 现已上线 SandBase:支持原生音频的 1080p 视频立即试用

WeChat Article Search

API 文档
https://api.sandbase.ai/v1/api/wechat-search/search-article

Search WeChat Official Account articles by keyword with publish-time and sort filters plus page, offset, and continuation-state pagination.

价格
$0.114286美元 / 次调用
方法
POST
响应
JSON
参数
1 个必填 · 4 个可选

Playground

输入
Search keyword for WeChat Official Account articles.
Publish time filter for WeChat Official Account article web search.
Sort order for WeChat Official Account article web search results.
Current page number starting from 1 for WeChat web search pagination.
Search result offset returned by the previous response. Use 0 for the first page.
输出就绪

您的输出将显示在这里

完成输入,然后点击运行。

API README

WeChat Article Search API

This API returns WeChat Official Account articles that match a keyword. Each result has a snippet with the keyword highlighted, a publish timestamp, and a link to the article. The only required input is keyword.

Use cases

  • Track how Official Accounts cover a topic such as AI by searching a keyword with the LATEST sort.
  • Collect article links for a keyword to build a reading list or a content archive.
  • Find the most talked-about articles on a subject in the past week with SEVEN_DAYS and the HOT sort.
  • Check which phrases appear around a keyword by reading the highlighted snippets in desc.

Request

curl -X POST "https://api.sandbase.ai/v1/api/wechat-search/search-article" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"keyword": "人工智能"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
keywordstringYesSearch keyword for WeChat Official Account articles.
currentPageintegerNoCurrent page number starting from 1 for WeChat web search pagination.
offsetintegerNoSearch result offset returned by the previous response. Use 0 for the first page.
publishTimeTypestringNoPublish time filter for WeChat Official Account article web search.
sortTypestringNoSort order for WeChat Official Account article web search results.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "category": [
    {
      "selected": 1,
      "type": 0,
      "word": "全部"
    }
  ],
  "continueFlag": 1,
  "cookies": "{\"box_of…",
  "data": [
    {
      "boxID": "0x2-0-15529639845716571706",
      "boxPos": 1,
      "boxPosMerge": 1,
      "count": 1,
      "items": [
        {
          "date": 1793685626,
          "desc": "他说,<em class=\"highlight\">人工智能</em>已经开始改变人们的工作方式。ChatGPT等工具帮助人们提高效率,也有越来越多的人开始将<e…",
          "docID": "15529639845716571706",
          "docType": 0,
          "doc_url": "http://mp.weixin.qq.com/s?__biz=MzA5MjA5MTEwNg==&mid=2656751197&idx=7&sn=ed85b9f…",
          "itemShowType": 0,
          "mpScene": 7,
          "reportId": "15529639845716571706:mp:887366"
        }
      ],
      "real_type": 2,
      "resultType": 0,
      "subType": 0,
      "totalCount": 242,
      "type": 2,
      "useNativeRender": false
    }
  ],
  "direction": 2,
  "enableQuestionClosely": false,
  "experiment": [
    {
      "key": "mmsearch_live_double_auto_play_exp",
      "value": "1"
    }
  ],
  "isAutoPlayVideo": 1,
  "isDivide": 1,
  "isHomePage": 1,
  "lang": "zh_CN",
  "offset": 18
}

Response fields

FieldMeaning
data[].items[].doc_urlLink to the article on mp.weixin.qq.com.
data[].items[].descText snippet from the article. Matches of the keyword are wrapped in <em class="highlight"> tags.
data[].items[].dateArticle publish time as a Unix timestamp in seconds.
data[].items[].docID / data[].items[].reportIdIdentifiers for the article. reportId combines the docID with a suffix.
data[].totalCountTotal number of matching results reported for the search. It is the same value in every box.
data[].boxPosPosition of the result box in the result list, starting at 1.
offsetOffset to send as offset in the next request to get the following page.
pageNumberPage number the response refers to.
continueFlagFlag set to 1 in this response.
cookiesJSON string holding continuation state for the search, including box_offset.
searchIDIdentifier for this search request.

Notes

  • Set publishTimeType to ALL, ONE_DAY, SEVEN_DAYS or HALF_YEAR. Set sortType to LATEST or HOT to change the result order. If you omit it, the default sort applies.
  • For the next page, send the offset value from the previous response together with a higher currentPage. Use offset 0 for the first page.
  • Each element of data is a result box and holds its articles in items. In this response each box holds one article.
  • To search accounts instead of articles, use WeChat Account Search.

Pricing

$0.114286 per successful call. Failed calls are not charged.

探索更多

相关 APIs

全部 APIs
API价格响应
WeChat Search$0.114286 每次调用JSON
WeChat Search$0.057143 每次调用JSON
WeChat Search$0.114286 每次调用JSON
WeChat Search$0.01 每次调用JSON
WeChat Search$0.01 每次调用JSON

问题

常见问题

如何使用 WeChat Article Search API?

向 https://api.sandbase.ai/v1/api/wechat-search/search-article 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。

WeChat Article Search API 的价格是多少?

每次调用 $0.114286,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。

WeChat Article Search API 接受哪些参数?

必填:keyword (string)。 可选:publishTimeType(ALL, ONE_DAY, SEVEN_DAYS, HALF_YEAR 之一), sortType(COMPREHENSIVE, LATEST, HOT 之一), currentPage (integer) 和 offset (integer)。 Parameters 表和本页的 Playground 列出了每个字段。

WeChat Article Search API 返回什么?

在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。

我需要 WeChat Search 开发者账户或 API key 吗?

不需要。WeChat Article Search 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 WeChat Search API 访问权限。