Use Zhipu's web search API to search the internet.
This skill requires DOUBAO_API_KEY environment variable to be set before use.
bash
# Set API key as environment variable
export DOUBAO_API_KEY="your_api_key"
Get your API key from: https://www.bigmodel.cn/usercenter/proj-mgmt/apikeys
bash
export DOUBAO_API_KEY="your_key"
curl -s -X POST "https://open.bigmodel.cn/api/paas/v4/chat/completions" \
-H "Authorization: Bearer $DOUBAO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-4-flash",
"messages": [{"role": "user", "content": "搜索: YOUR_QUERY"}],
"tools": [{"type": "web_search", "web_search": {"search_query": "YOUR_QUERY"}}]
}' | jq -r '.choices[0].message.content'
bash
export DOUBAO_API_KEY="your_key"
./search.sh "搜索内容"
ps aux
https://open.bigmodel.cn (official Zhipu API)FeatureImplementationJSON escapingjq --arg prevents injectionInput validationQuery length ≤500 charsTLSForce TLS 1.2+Error handlingGeneric messages, no leaksTimeout30 second curl timeout
Official: https://open.bigmodel.cn/api/paas/v4/chat/completions