Skip to content
    ↑↓ select↵ openesc close
    maxchang3

    Zhihu Websearch

    opencode-zhihu-websearch·v0.0.1·Model Providers

    Zhihu Web Search as an OpenCode websearch provider

    GitHub stars

    0

    Monthly installs

    19

    19 in 7 days

    Composite score

    28.0

    Multi-signal model

    Last commit

    3 days ago

    2026-10-02

    Install and configure

    opencode.json

    Writes to this project's opencode.json — applies to this repository only.

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-zhihu-websearch@0.0.1"]
    }

    OpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.

    English | 简体中文

    Zhihu Web Search (Global Search) as an OpenCode websearch provider.

    Zhihu Global Search is a high-trust search service for AI applications, combining high-quality Zhihu content with authoritative web sources to deliver real-time, structured, and traceable results. It offers high-quality, highly relevant results for Chinese-language queries.

    Requirements

    Install

    opencode plugin add opencode-zhihu-websearch
    

    Or add it to opencode.jsonc:

    {
      "$schema": "https://opencode.ai/config.json",
      "plugins": ["opencode-zhihu-websearch"],
      "websearch": { "provider": "zhihu" },
    }
    

    Without websearch.provider, OpenCode asks you to pick a provider the first time you search.

    Credentials

    Run /connect and pick Zhihu, or set ZHIHU_ACCESS_SECRET before starting OpenCode. A stored credential takes priority over the environment variable.

    Options

    Plugin options are optional:

    {
      "plugins": [
        {
          "package": "opencode-zhihu-websearch",
          "options": { "count": 8, "searchDB": "realtime" },
        },
      ],
    }
    
    Option Values Default Description
    count 1-20 10 Number of results
    searchDB all, realtime, static all Search index
    filter Filter expression none Filter results by site or publish time
    endpoint URL Zhihu Global Search API Override the search endpoint

    filter uses Zhihu's filter syntax: host supports == and != with a double-quoted value, publish_time (Unix seconds) supports ==, !=, >, >=, < and <=, and conditions combine with uppercase AND/OR and parentheses. Filtering on zhihu.com itself is not supported. Escape the quotes in JSON:

    "options": { "filter": "host!=\"example.com\" AND publish_time>=1735689600" }
    

    Development

    bun install
    bun run typecheck
    bun run test
    
    # optional: hits the real API, needs ZHIHU_ACCESS_SECRET
    LIVE=1 bun run test:live
    

    License

    MIT

    Similar plugins