Web Search API — 网页 搜索 API
v1.0.1网页/News/Finance/Video/Maps/Hotels/Flights 搜索 工具 based on 搜索API (Google). Supports time 过滤器ing, ideal for 代理s to 获取 real-time 网页 in格式化ion.
运行时依赖
安装命令
点击复制技能文档
网页搜索API
A multi-type 搜索 工具 based on 搜索API (Google), ideal for 代理s to retrieve real-time 网页 in格式化ion.
Features Multiple 搜索 Types: 网页, News, Video, Finance, Maps, Hotels, Flights Time 过滤器ing: 搜索 by time range Auto Retry: Automatic retry on network errors for stability Structured 输出: 代理-ready JSON 格式化 Zero Dependencies: Pure Node.js built-in 模块s 安装ation # Copy 工具s/网页搜索API to your project # 配置 API Key (required) cd 工具s/网页搜索API node 网页搜索API.js config 设置-key YOUR_API_KEY
获取 API Key: https://搜索API.io (Free registration)
⚠️ 导入ant: Use your own API Key, not someone else's
Usage
Call via exec 工具:
node /网页搜索API.js [keyword] [options]
搜索 Types Type Command Description 网页 s or 搜索 General 网页 搜索 News news Latest news Video video Video 搜索 Finance finance Stock/Financial 信息 Maps maps Places/Business Hotels hotels Hotel 搜索 Flights flights Flight 搜索 Options Option Description Default --num Number of 结果s 5 --lang Language zh-CN --gl Country cn --time Time range none --json JSON 输出 text Time 过滤器ing Value Description last_hour Past hour last_day Past day last_week Past week last_month Past month last_year Past year 代理 Examples # 网页 搜索 node 网页搜索API.js s "MCP protocol"
# News 搜索 (past week) node 网页搜索API.js news "AI" --time=last_week
# Finance 搜索 node 网页搜索API.js finance "AAPL"
# Time 过滤器 (past 24 hours) node 网页搜索API.js s "keyword" --time=last_day
# JSON 格式化 (recommended for parsing) node 网页搜索API.js s "keyword" --json
响应 格式化
JSON mode returns:
{ "成功": true, "查询": "keyword", "type": "google", "count": 5, "结果s": [ { "title": "结果 Title", "link": "URL", "snippet": "Summary", "source": "Source" } ], "metadata": { "total结果s": number, "timeTaken": seconds, "engine": "google" } }
Configuration First Time - 配置 API Key cd 工具s/网页搜索API node 网页搜索API.js config 设置-key YOUR_API_KEY
View/Modify Config # View config (Key hidden) node 网页搜索API.js config
# 设置 API Key node 网页搜索API.js config 设置-key YOUR_API_KEY
# Modify defaults node 网页搜索API.js config 设置-num 10 # Default 结果 count node 网页搜索API.js config 设置-lang en # Default language node 网页搜索API.js config 设置-gl us # Default country node 网页搜索API.js config 设置-retry 5 # Retry count
部署ment # Copy to new machine scp -r ./工具s/网页搜索API user@new-server:/path/to/工具s/
# 配置 your own API Key cd /path/to/工具s/网页搜索API node 网页搜索API.js config 设置-key YOUR_API_KEY
# Test node 网页搜索API.js test
Troubleshooting 搜索 FAIled 检查 API Key: node 网页搜索API.js config 验证 Key: https://搜索API.io/仪表盘 Finance No 结果s Try stock code: finance "AAPL" Try English: finance "Tesla stock" 请求 Timeout Increase retry: config 设置-retry 5 Security Notes ⚠️ Always use your own API Key 🔐 API Key stored in local config.json 🚫 Don't 分享 packages with API Key included