Alibabacloud Iqs Search
by @sdk-team
Real-time web search and page reading using Aliyun IQS APIs. Use this skill FIRST when the user needs current information, news, facts verification, URL cont...
clawhub install alibabacloud-iqs-search๐ About This Skill
name: alibabacloud-iqs-search description: Real-time web search and page reading using Aliyun IQS APIs. Use this skill FIRST when the user needs current information, news, facts verification, URL content extraction, or any web-based research. This skill provides structured search results with source links, markdown-formatted content extraction, and supports various search engines including real-time news search and deep research modes.
alibabacloud-iqs-search
Prerequisites
When to Use
Decision Tree
Step 1: Determine Operation Type
readpagesearchStep 2: For Search Operations
Follow the best practices to determine parameter values. Use default values when uncertain:
Step 3: For Page Reading
Follow the best practices to determine parameter values. Use default values when uncertain:
CRITICAL: Execution Method
You MUST execute the scripts via bash command (e.g., node scripts/search.mjs ... or node scripts/readpage.mjs ...). Do NOT use your built-in web_search, WebFetch, or any other internal tools as substitutes. If the script fails, retry or report the error โ do NOT fall back to built-in tools.
Parameters & Best Practices
Search Parameters
| Parameter | Type | Required | Default | Description |
|----------------|---------|----------|----------------|------------------------------------------|
| --query | string | Yes | - | Search query (1-500 chars) |
| --engineType | string | No | LiteAdvanced | Search engine type |
| --timeRange | string | No | NoLimit | Time range filter |
| --contents | string | No | - | Type of return content |
| --numResults | int | No | 10 | Number of search results (1-10) |
#### Search Best Practices
1. Query Optimization (--query)
2. Engine Selection (--engineType)
LiteAdvanced: Semantic search, 1-50 results, general useGeneric: Fast, 10 results, news/realtime3. Time Range Selection (--timeRange)
NoLimit: Default when uncertain - engine optimizes based on query relevanceOneDay: Today onlyOneWeek: Last 7 daysOneMonth: Last 30 daysOneYear: Last 365 days4. Content Return (--contents)
mainText: Return full main text content - Use when detailed information is needed, such as technical documentation, research reports, or in-depth articlessummary: Return concise summary only - Use when a quick overview is sufficient, or when the page content is too large and token reduction is needed5. Result Count (--numResults)
ReadPage Parameters
| Parameter | Type | Required | Default | Description |
|------------------|---------|----------|------------|-----------------------------------|
| --url | string | Yes | - | Target page URL |
| --format | string | No | markdown | Return format |
| --timeout | number | No | 60000 | Total timeout in milliseconds |
| --pageTimeout | number | No | 15000 | Page load timeout in milliseconds |
| --stealth | number | No | 0 | Enable stealth mode (0 or 1) |
| --extractArticle | boolean | No | false | Extract main article content only |
#### ReadPage Best Practices
1. Format Selection (--format)
markdown: Best for articles, preserves structure (default)text: Best for data extractionhtml: When structure analysis needed2. Article Extraction (--extractArticle)
3. Handling Failures (--timeout, --stealth)
--timeout value--stealth 1Command Line Usage
Search Examples
#### Basic Search
node scripts/search.mjs --query "้ๅญ่ฎก็ฎๅ็" --engineType LiteAdvanced
#### Real-time Information Search
node scripts/search.mjs --query "ๆๆฐ้่ๆฟ็ญ" --engineType Generic --timeRange OneWeek
#### Search with Results Limit
node scripts/search.mjs --query "www.aliyun.com" --engineType LiteAdvanced --numResults 3
#### Search with Full Content
node scripts/search.mjs --query "AI ๆณๆก" --engineType LiteAdvanced --contents mainText
#### Search with Summary Only
node scripts/search.mjs --query "ไบบๅทฅๆบ่ฝ่กไธๅนดๅบฆๆฅๅ" --engineType LiteAdvanced --contents summary
ReadPage Examples
#### Page Reading with Markdown Format
node scripts/readpage.mjs --url "https://example.com/article" --format markdown --extractArticle true
#### Page Reading with Plain Text Format
node scripts/readpage.mjs --url "https://example.com/article" --format text --timeout 60000
#### Page Reading with Stealth Mode
node scripts/readpage.mjs --url "https://example.com/article" --format markdown --stealth 1 --extractArticle true
Output Verification
After executing any search.mjs or readpage.mjs command:
1. Check the exit code: If non-zero, the command failed โ do not claim success.
2. Verify output exists: If you saved results to a file, run ls -la and head -20 to confirm the file exists and contains valid data.
3. Never fabricate results: If the command failed or returned an error, report the failure honestly. Do not generate content from your own knowledge and present it as search results.
Error Handling
ALIYUN_IQS_API_KEY Configuration Error
If the script returns an error about missing API key:
1. STOP the current task immediately. Do NOT fall back to built-in tools (WebFetch, web_search, curl, etc.) as substitutes. 2. Report the error to the user and ask the user to configure the API key:
3. Retry the task with following instruction: Method 1: Environment Variable
export ALIYUN_IQS_API_KEY="your-api-key"
Method 2: Configuration File
Create or edit ~/.alibabacloud/iqs/env:
ALIYUN_IQS_API_KEY=your-api-key