Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aliyun avatar

Alibabacloud Iqs Weather Query

  • 61 installs
  • 208 repo stars
  • Updated August 4, 2026
  • aliyun/alibabacloud-aiops-skills

alibabacloud-iqs-weather-query is a Claude skill that returns 7-day city weather forecasts by combining Alibaba Cloud IQS web search (UnifiedSearch) with page reading (ReadPageBasic).

About

This skill returns a 7-day weather forecast for any city using Alibaba Cloud IQS web search (UnifiedSearch) and page reading (ReadPageBasic). It searches for the best weather page, then parses known sites with dedicated parsers into structured JSON or returns raw text for the agent to interpret on unknown sites. It runs via node scripts/weather.mjs and requires an ALIYUN_IQS_API_KEY.

  • Returns 7-day weather forecasts for any city using Alibaba Cloud IQS web search and page reading
  • Uses UnifiedSearch to find weather pages and ReadPageBasic to parse them
  • Hybrid parsing: dedicated parsers for known sites (weather.cma.cn, weather.com.cn) or raw text for unknown sites

Alibabacloud Iqs Weather Query by the numbers

  • 61 all-time installs (skills.sh)
  • +7 installs in the week ending Jun 23, 2026 (Skillselion tracking)
  • Ranked #991 of 2,715 Automation & Workflows skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

alibabacloud-iqs-weather-query capabilities & compatibility

Works with
weather
Use cases
web search · web scraping
Pricing
Bring your own API key
From the docs

What alibabacloud-iqs-weather-query says it does

7-day weather forecast query powered by Alibaba Cloud IQS web search and page reading.
SKILL.md
Query 7-day weather forecasts for any city using Alibaba Cloud IQS web search (UnifiedSearch) and page reading (ReadPageBasic) capabilities.
SKILL.md
npx skills add https://github.com/aliyun/alibabacloud-aiops-skills --skill alibabacloud-iqs-weather-query

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs61
repo stars208
Last updatedAugust 4, 2026
Repositoryaliyun/alibabacloud-aiops-skills

What it does

Query a 7-day weather forecast for any city via Alibaba Cloud IQS web search and page reading.

Who is it for?

Agents that need a structured 7-day weather forecast for a named city via Alibaba Cloud IQS.

Skip if: Historical weather, non-weather search, or forecasts beyond 7 days.

When should I use this skill?

The user asks for a weather forecast, 7-day weather, or whether it will rain in a specific city.

By the numbers

  • 7-day weather forecast
  • 3 priority sites with dedicated parsers plus raw fallback

Files

SKILL.mdMarkdownGitHub ↗

IQS Weather Query - 7-Day Weather Forecast

Query 7-day weather forecasts for any city using Alibaba Cloud IQS web search (UnifiedSearch) and page reading (ReadPageBasic) capabilities.

Underlying Service: alibabacloud-iqs-search

Hybrid Parsing Strategy:

  • Known sites (weather.cma.cn, weather.com.cn): Dedicated parsers extract structured JSON → parseMode: "structured"
  • Unknown sites: ReadPage extracts main content (readabilityMode: article), returns raw text with extraction hint → parseMode: "raw", agent (LLM) interprets directly
Output FieldDescription
parseMode"structured" (parsed JSON) or "raw" (text for agent)
weatherWeather condition (sunny, cloudy, rain, etc.)
temperatureTemperature range
windSpeedWind speed/level
windDirectionWind direction

---

Environment Configuration

Pre-check: ALIYUN_IQS_API_KEY Required

>

```bash
if [ -z "$ALIYUN_IQS_API_KEY" ]; then echo "API Key 未配置"; else echo "API Key 已配置(已脱敏)"; fi
```
If output is 'API Key 未配置', the API Key is not configured.

>

How to obtain ALIYUN_IQS_API_KEY: Please refer to Aliyun IQS Documentation

>

Configure environment variable (choose one):

>

Option 1: Temporary (current terminal session only)
```bash
export ALIYUN_IQS_API_KEY="your-api-key-here"
```

>

Option 2: Permanent (recommended)

>

Add to ~/.zshrc or ~/.bashrc:
```bash
export ALIYUN_IQS_API_KEY="your-api-key-here"
```
Run source ~/.zshrc or source ~/.bashrc to apply.

>

Alternative: Place API Key in ~/.alibabacloud/iqs/env file:
```
ALIYUN_IQS_API_KEY=your-api-key-here
```

---

Workflow

User Input (city name)
        │
        ▼
┌─────────────────────────┐
│ Step 1: UnifiedSearch    │  Search: "{city} 天气预报 未来7天"
│ (Web Search)            │  Priority: weather.cma.cn > weather.com.cn
└──────────┬──────────────┘
           │ Best weather URL
           ▼
┌─────────────────────────┐
│ Step 2: ReadPageBasic    │  Known site → readabilityMode: normal
│ (Page Reading)          │  Unknown site → readabilityMode: article
└──────────┬──────────────┘
           │ Page content
           ▼
     Known site?
      ╱        ╲
    YES          NO
     │            │
     ▼            ▼
  Parser       Return rawText
  Router       + hint for agent
     │         (parseMode: raw)
     ▼
  Structured JSON
  (parseMode: structured)

---

Usage

Prerequisites

  • Node.js >= 18 (native fetch support required)
  • No additional npm dependencies needed

Execute Query

node scripts/weather.mjs <city>

Examples:

node scripts/weather.mjs 北京
node scripts/weather.mjs 上海
node scripts/weather.mjs 杭州
node scripts/weather.mjs Tokyo

Output Format

Structured mode (known sites — parsed successfully):

{
  "success": true,
  "data": {
    "city": "北京",
    "parseMode": "structured",
    "queryTime": "2026-03-26T10:00:00.000Z",
    "forecastDays": 7,
    "forecast": [
      {
        "date": "3月26日",
        "weather": "晴",
        "temperature": "5°C ~ 18°C",
        "windDirection": "北风",
        "windSpeed": "3-4级"
      }
    ],
    "source": "https://weather.cma.cn/..."
  }
}

Raw mode (unknown sites — agent interprets the text):

{
  "success": true,
  "data": {
    "city": "北京",
    "parseMode": "raw",
    "hint": "以下是北京天气网页的正文内容,请从中提取未来7天的天气预报信息...",
    "rawText": "北京天气预报\n今天 晴 18°C/5°C ...",
    "evolveHint": "[持续进化] 当前站点 \"example.com\" 没有匹配的解析器...",
    "source": "https://example.com/weather/beijing"
  }
}

---

IQS APIs Used

APIEndpointPurposeDocumentation
UnifiedSearchcloud-iqs.aliyuncs.com/search/unifiedWeb search for weather pagesDoc
ReadPageBasiccloud-iqs.aliyuncs.com/readpage/scrapeRead and parse weather webpageDoc

Search Priority Sites (with dedicated parsers): 1. weather.cma.cn (China Meteorological Administration) — parseCmaWeather → readabilityMode: normal 2. baidu.weather.com.cn / sq.weather.com.cn (China Weather Network mobile) — parseBaiduWeatherComCn → readabilityMode: normal 3. weather.com.cn (China Weather Network, all other subdomains) — parseWeatherComCn → readabilityMode: normal 4. Other sites — no parser, return raw text → readabilityMode: article (cleaner body extraction)

---

Error Handling

Error CodeDescriptionSolution
CREDENTIALS_MISSINGAPI Key not configuredSet ALIYUN_IQS_API_KEY environment variable
NO_RESULTSNo weather results foundCheck city name is correct
QUERY_FAILEDAPI call failedCheck network, verify credentials
PARSE_FAILEDFailed to parse weather data from webpageThe target site's page structure may have changed; update the corresponding parser or add a new one (see Extending section)

---

Best Practices

1. Use Chinese city names for domestic weather queries for better accuracy 2. Node.js >= 18 required - native fetch API is used, no npm install needed 3. Cache awareness - ReadPage uses maxAge not set, always fetches latest data 4. Extensible parsers - Each weather site has its own parser; add new sites by registering in PARSER_REGISTRY

---

Continuous Evolution

This skill is designed to self-improve over time. When the script encounters an unknown site format (no matching parser), it returns parseMode: "raw" with an evolveHint field.

Agent behavior when `parseMode` is `"raw"`:

1. First: Answer the user — Extract weather info from rawText using LLM understanding and respond to the user immediately. 2. Then: Evolve — Read the evolveHint and analyze the rawText format pattern, then write a new parser function and register it in PARSER_REGISTRY (see Extending section below). This ensures that next time the same site format is hit, it goes through structured mode directly.

First query for unknown site:
  search → readpage → no parser match → raw mode → agent answers user
                                                  → agent writes new parser ← evolveHint

Subsequent queries for same site:
  search → readpage → parser match → structured mode → direct JSON output
Key: The skill gets smarter with every new city searched. Each raw-mode encounter is an opportunity to add a new parser, progressively covering more site formats.

---

Extending: Add a New Weather Site Parser

The script uses a Parser Registry pattern. Each weather site has its own dedicated parser function, and the router automatically dispatches based on URL. To add support for a new site, follow these 3 steps:

Step 1: Write a Parser Function

Add a new parser function in scripts/weather.mjs. It must accept (content, city) and return the standard format:

function parseMyNewSite(content, city) {
  const forecast = [];

  // Parse the text content from ReadPage for this specific site
  // Extract: date, weather, temperature, windDirection, windSpeed
  // ...your parsing logic here...

  return {
    city,
    queryTime: new Date().toISOString(),
    forecastDays: Math.min(forecast.length, 7),
    forecast: forecast.slice(0, 7),
    raw: forecast.length === 0 ? content.substring(0, 2000) : undefined,
  };
}

Return format for each forecast item:

FieldTypeExample
datestring"04/07 星期二"
weatherstring"晴转多云"
temperaturestring"5°C ~ 18°C"
windDirectionstring"北风"
windSpeedstring"3-4级"

Step 2: Register in PARSER_REGISTRY

Add your parser to the registry array at the top of weather.mjs. Order matters — higher position = higher priority:

const PARSER_REGISTRY = [
  { pattern: 'weather.cma.cn',          parser: parseCmaWeather },
  { pattern: 'baidu.weather.com.cn',    parser: parseBaiduWeatherComCn },
  { pattern: 'sq.weather.com.cn',       parser: parseBaiduWeatherComCn },
  { pattern: 'weather.com.cn',          parser: parseWeatherComCn },
  { pattern: 'mynewsite.com',           parser: parseMyNewSite },    // ← Add here
];

Step 3: Add to Search Priority (optional)

If you want the new site to be prioritized in search results, add it to PREFERRED_WEATHER_SITES:

const PREFERRED_WEATHER_SITES = [
  'weather.cma.cn',
  'weather.com.cn',
  'mynewsite.com',           // ← Add here
];

How the Router Works

parseWeatherData(content, city, url)
  │
  ├─ URL contains "weather.cma.cn"?          → parseCmaWeather(content, city)
  ├─ URL contains "baidu.weather.com.cn"?    → parseBaiduWeatherComCn(content, city)
  ├─ URL contains "sq.weather.com.cn"?       → parseBaiduWeatherComCn(content, city)
  ├─ URL contains "weather.com.cn"?          → parseWeatherComCn(content, city)
  ├─ URL contains "mynewsite.com"?           → parseMyNewSite(content, city)
  │
  └─ No match or result < 3 days?           → return rawText + hint (agent interprets)
Tip: Use node -e "..." with the ReadPage API to fetch and inspect the raw text format of a new site before writing the parser. See existing parsers (parseCmaWeather, parseWeatherComCn) as reference implementations.

Related skills

FAQ

How does it get the forecast?

It runs UnifiedSearch to find a weather page then ReadPageBasic to read and parse it, preferring weather.cma.cn and weather.com.cn.

What output does it return?

Structured JSON for known sites (parseMode structured) or raw text for the agent to interpret on unknown sites (parseMode raw).

Automation & Workflowsautomationresearch

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.