{"skill":{"slug":"searchapi","displayName":"Web Search API","summary":"Web/News/Finance/Video/Maps/Hotels/Flights search tool based on SearchAPI (Google). Supports time filtering, ideal for agents to get real-time web information.","description":"---\nname: websearchapi\ndescription: \"Web/News/Finance/Video/Maps/Hotels/Flights search tool based on SearchAPI (Google). Supports time filtering, ideal for agents to get real-time web information.\"\nmetadata: { \"openclaw\": { \"emoji\": \"🔍\", \"requires\": { \"bins\": [\"node\"] } } }\n---\n\n# WebSearchAPI\n\nA multi-type search tool based on SearchAPI (Google), ideal for agents to retrieve real-time web information.\n\n## Features\n\n- **Multiple Search Types**: Web, News, Video, Finance, Maps, Hotels, Flights\n- **Time Filtering**: Search by time range\n- **Auto Retry**: Automatic retry on network errors for stability\n- **Structured Output**: Agent-ready JSON format\n- **Zero Dependencies**: Pure Node.js built-in modules\n\n## Installation\n\n```bash\n# Copy tools/websearchapi to your project\n# Configure API Key (required)\ncd tools/websearchapi\nnode websearchapi.js config set-key YOUR_API_KEY\n```\n\nGet API Key: https://searchapi.io (Free registration)\n\n⚠️ **Important**: Use your own API Key, not someone else's\n\n## Usage\n\nCall via `exec` tool:\n\n```bash\nnode <path>/websearchapi.js <command> [keyword] [options]\n```\n\n### Search Types\n\n| Type | Command | Description |\n|------|---------|-------------|\n| Web | `s` or `search` | General web search |\n| News | `news` | Latest news |\n| Video | `video` | Video search |\n| Finance | `finance` | Stock/Financial info |\n| Maps | `maps` | Places/Business |\n| Hotels | `hotels` | Hotel search |\n| Flights | `flights` | Flight search |\n\n### Options\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--num` | Number of results | 5 |\n| `--lang` | Language | zh-CN |\n| `--gl` | Country | cn |\n| `--time` | Time range | none |\n| `--json` | JSON output | text |\n\n### Time Filtering\n\n| Value | Description |\n|-------|-------------|\n| `last_hour` | Past hour |\n| `last_day` | Past day |\n| `last_week` | Past week |\n| `last_month` | Past month |\n| `last_year` | Past year |\n\n## Agent Examples\n\n```bash\n# Web search\nnode websearchapi.js s \"MCP protocol\"\n\n# News search (past week)\nnode websearchapi.js news \"AI\" --time=last_week\n\n# Finance search\nnode websearchapi.js finance \"AAPL\"\n\n# Time filter (past 24 hours)\nnode websearchapi.js s \"keyword\" --time=last_day\n\n# JSON format (recommended for parsing)\nnode websearchapi.js s \"keyword\" --json\n```\n\n## Response Format\n\nJSON mode returns:\n\n```json\n{\n  \"success\": true,\n  \"query\": \"keyword\",\n  \"type\": \"google\",\n  \"count\": 5,\n  \"results\": [\n    {\n      \"title\": \"Result Title\",\n      \"link\": \"URL\",\n      \"snippet\": \"Summary\",\n      \"source\": \"Source\"\n    }\n  ],\n  \"metadata\": {\n    \"totalResults\": number,\n    \"timeTaken\": seconds,\n    \"engine\": \"google\"\n  }\n}\n```\n\n## Configuration\n\n### First Time - Configure API Key\n\n```bash\ncd tools/websearchapi\nnode websearchapi.js config set-key YOUR_API_KEY\n```\n\n### View/Modify Config\n\n```bash\n# View config (Key hidden)\nnode websearchapi.js config\n\n# Set API Key\nnode websearchapi.js config set-key YOUR_API_KEY\n\n# Modify defaults\nnode websearchapi.js config set-num 10      # Default result count\nnode websearchapi.js config set-lang en     # Default language\nnode websearchapi.js config set-gl us       # Default country\nnode websearchapi.js config set-retry 5     # Retry count\n```\n\n## Deployment\n\n```bash\n# Copy to new machine\nscp -r ./tools/websearchapi user@new-server:/path/to/tools/\n\n# Configure your own API Key\ncd /path/to/tools/websearchapi\nnode websearchapi.js config set-key YOUR_API_KEY\n\n# Test\nnode websearchapi.js test\n```\n\n## Troubleshooting\n\n### Search Failed\n- Check API Key: `node websearchapi.js config`\n- Verify Key: https://searchapi.io/dashboard\n\n### Finance No Results\n- Try stock code: `finance \"AAPL\"`\n- Try English: `finance \"Tesla stock\"`\n\n### Request Timeout\n- Increase retry: `config set-retry 5`\n\n## Security Notes\n\n- ⚠️ Always use your own API Key\n- 🔐 API Key stored in local config.json\n- 🚫 Don't share packages with API Key included\n","tags":{"latest":"1.0.1"},"stats":{"comments":0,"downloads":222,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":2},"createdAt":1771929552678,"updatedAt":1778491624313},"latestVersion":{"version":"1.0.1","createdAt":1771990717499,"changelog":"- Added support for time filtering in search queries.\n- Updated documentation to include `--time` option and examples.\n- English documentation replaces previous Chinese content.\n- No file changes detected in this version; only documentation improvements.","license":null},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"1990huwei","userId":"s17cg073sxfavw5xesq2dxtsvd83p260","displayName":"1990huwei","image":"https://avatars.githubusercontent.com/u/35051005?v=4"},"moderation":null}