Native OpenCode tools for live web search, news, page retrieval, sitemap discovery, and trending topics.
Install for the current project:
opencode plugin opencode-search1apiOr install globally:
opencode plugin opencode-search1api --globalUse one of these methods:
- Set
SEARCH1API_KEYin the OpenCode environment. - Install
search1api-cliand runs1 loginonce; the plugin reuses the same OAuth session. - Configure the plugin with an
apiKeyoption inopencode.json.
{
"plugin": [
["opencode-search1api", { "apiKey": "your-api-key" }]
]
}Prefer an environment variable or secret manager over committing credentials to configuration files.
Get an API key at search1api.com.
search1api_search— search the live websearch1api_news— search current newssearch1api_ask— automatic source routing and relevance ranking (5 credits)search1api_crawl— retrieve readable page contentsearch1api_sitemap— discover site linkssearch1api_trending— explore GitHub or Hacker News trends
npm install
npm testMIT
Search supports bingcn, yandex, and grokipedia; sogou is removed.
Search and news support day, week, month, and year. Search accepts
page on engines with native pagination.
The default Ask tool accepts only a natural-language query. The server
chooses engines and a time window and returns query, intent, ranked
results, and errors. Ask results include source and relevance; this
endpoint returns search results rather than a generated answer. Each call
costs 5 credits. Use ordinary search when the engine and keywords are known.
Engine-specific search/news attributes stay inside optional per-result
metadata: GitHub uses kind, stars, language, and num_comments;
Hacker News news results use story_url, points, and num_comments.
published_date stays optional at the result top level. Zero counts are
preserved and unavailable fields are omitted. Credit Grokipedia results as
"Powered by xAI".
search1api_ask is registered by default. Authenticated requests use
search1api-cli>=2.0; existing shared OAuth sessions and API keys still work.