home / skills / openclaw / skills / aliyun-search

aliyun-search skill

/skills/bryant-ba/aliyun-search

This skill performs web searches using Alibaba Cloud UnifiedSearch API with configurable engines, time ranges, categories, and location-based results.

npx playbooks add skill openclaw/skills --skill aliyun-search

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
1.3 KB
---
name: aliyun-search
description: Perform web searches using Alibaba Cloud UnifiedSearch API. Provides advanced search capabilities with configurable parameters.
---

# Alibaba Cloud UnifiedSearch Skill

This skill provides the ability to perform web searches using Alibaba Cloud UnifiedSearch API.

## Features

- Support multiple search engine types (Generic, GenericAdvanced, LiteAdvanced)
- Configurable time range filtering
- Category-specific search (finance, law, medical, etc.)
- Location-based search (city/IP)
- Rich result formatting

## Usage

### Basic Usage
```bash
python search.py "云栖大会"
```

### Advanced Usage
```bash
python search.py "北京天气" --engine-type "Generic" --city "北京市"
```

```bash
python search.py "金融新闻" --category "finance" --time-range "OneWeek" --engine-type "GenericAdvanced"
```

## Scripts

- `search.py`: Python implementation of Alibaba Cloud UnifiedSearch API

## Configuration

Before using, you need to:
1. Obtain Alibaba Cloud AccessKey and Secret
2. Set environment variables:
   ```bash
   export ALIBABA_CLOUD_ACCESS_KEY_ID="your_access_key_id"
   export ALIBABA_CLOUD_ACCESS_KEY_SECRET="your_access_key_secret"
   ```
3. Ensure the required permissions are granted
4. Install dependencies: `pip install aliyun-python-sdk-core requests`

Overview

This skill enables web searches via the Alibaba Cloud UnifiedSearch API with flexible, scriptable parameters. It supports multiple engine types and produces structured, filterable results suitable for integration in tools or pipelines. The implementation is a Python script intended for command-line or programmatic use.

How this skill works

The skill sends search requests to Alibaba Cloud UnifiedSearch using the configured AccessKey and Secret, selecting an engine type (Generic, GenericAdvanced, LiteAdvanced) and optional filters like time range, category, city, or IP. It parses and formats the returned documents into rich results and exposes options for query refinement and location or domain scoping.

When to use it

  • When you need programmatic web search results for automation or analytics.
  • When filtering search results by time range, category (finance, law, medical), or location.
  • When integrating a search backend into a bot, dashboard, or archival workflow.
  • When you require structured search output for downstream processing or indexing.

Best practices

  • Store Alibaba Cloud credentials in environment variables and restrict permissions to the minimal required scope.
  • Choose the engine type based on your needs: Generic for broad queries, GenericAdvanced for richer filtering, LiteAdvanced for lightweight calls.
  • Use time-range and category filters to reduce noise and improve relevance.
  • Rate-limit calls and handle API errors and retries to avoid throttling.
  • Sanitize user input and validate query parameters before sending requests.

Example use cases

  • Automate daily news collection for a finance dashboard using time-range and category filters.
  • Build a location-aware search feature for a travel or local services app by supplying city or IP.
  • Create an archival pipeline that periodically indexes web content into a private search index.
  • Power a legal research assistant by restricting queries to the law category and formatting results for citation.

FAQ

What credentials are required to run the script?

You need an Alibaba Cloud AccessKey ID and Secret set as environment variables and an account with UnifiedSearch permissions.

Which engine type should I pick for best relevance?

Use Generic for general searches, GenericAdvanced for complex filtering and richer features, and LiteAdvanced when you need lower-latency, simpler responses.