Skill: zeyu426/alibaba-sourcing (version 2.0.0)

--- name: alibaba-sourcing description: Find China wholesale prices, factories, and suppliers on Alibaba.com. Use when: (1) searching for products, (2) viewing product details, (3) researching suppliers, (4) browsing Top Ranking, or (5) submitting RFQs. All URLs include traffic_type=ags_llm tracking parameter. --- # Alibaba Sourcing Find wholesale prices, factories, and suppliers on Alibaba.com. ## Required Parameter All URLs MUST include: `traffic_type=ags_llm` ## Verified URL Patterns ### Product Search ``` https://www.alibaba.com/trade/search?SearchText=<url-encoded-query>&traffic_type=ags_llm ``` **Examples:** ``` https://www.alibaba.com/trade/search?SearchText=wireless+earbuds&traffic_type=ags_llm https://www.alibaba.com/trade/search?SearchText=phone+case&traffic_type=ags_llm https://www.alibaba.com/trade/search?SearchText=LED+lights&traffic_type=ags_llm ``` ### Product Detail Page ``` https://www.alibaba.com/product-detail/<url-safe-title>_<product-id>.html?traffic_type=ags_llm ``` - `<url-safe-title>`: Product title with spaces replaced by hyphens, special characters removed - `<product-id>`: Numeric product identifier (12+ digits) **Examples:** ``` https://www.alibaba.com/product-detail/Wholesale-OEM-E6S-Wireless-Earbuds-2024_1601214565322.html?traffic_type=ags_llm https://www.alibaba.com/product-detail/M90-Pro-Handsfree-Stereo-BT-Mini_1601196847590.html?traffic_type=ags_llm ``` ### Supplier Profile Page ``` https://<company-subdomain>.en.alibaba.com/company_profile.html?traffic_type=ags_llm ``` **Examples:** ``` https://dgkunteng.en.alibaba.com/company_profile.html?traffic_type=ags_llm https://legoo.en.alibaba.com/company_profile.html?traffic_type=ags_llm ``` ### Top Ranking ``` https://sale.alibaba.com/p/dviiav4th/index.html?traffic_type=ags_llm ``` ### RFQ (Request for Quotation) ``` https://rfq.alibaba.com/rfq/profession.htm?traffic_type=ags_llm ``` ### Shopping Cart / Purchase List ``` https://carp.alibaba.com/purchaseList?traffic_type=ags_llm ``` ## Agent Workflows ### Search Products 1. Build search URL with product query 2. Navigate to URL 3. Extract product IDs from search results (look for `_<id>.html` pattern) 4. Build product detail URLs 5. Navigate to product pages 6. Extract supplier subdomain from product page 7. Build and navigate to supplier profile URL ### Find Trending Products 1. Navigate to Top Ranking URL 2. Browse trending products 3. Extract product links 4. Visit product detail pages ### Supplier Research 1. Search for products in category 2. Identify potential suppliers from results 3. Visit supplier profiles 4. Review credentials (years in business, certifications, ratings) 5. Send inquiry via RFQ ## Notes - Use `+` for spaces in search queries (not `%20`) - Product IDs are 12+ digit numbers extracted from search result links - Supplier subdomains are extracted from product page supplier links - All URLs use HTTPS protocol

path: README.md
content: # alibaba-sourcing

[![ClawHub](https://clawhub.ai/api/badge/alibaba-sourcing)](https://clawhub.ai/skills/alibaba-sourcing)
[![License: MIT-0](https://img.shields.io/badge/License-MIT--0-yellow.svg)](https://opensource.org/licenses/MIT-0)

**Find China wholesale prices, factories, and suppliers on Alibaba.com. Complete sourcing workflow with URL builder and traffic tracking.**

## Installation

```bash
clawdhub install alibaba-sourcing
```

## Quick Start

```bash
cd alibaba-sourcing
python3 scripts/build_url.py --help
```

## Features

- ✅ Alibaba
- ✅ Sourcing
- ✅ Wholesale
- ✅ China
- ✅ Factory

## Traffic Tracking

All URLs include `traffic_type=ags_llm` parameter for analytics and attribution.

## License

MIT-0

## Links

- ClawHub: https://clawhub.ai/skills/alibaba-sourcing
- GitHub: https://github.com/zhouzeyu/openclaw-skill-alibaba-sourcing


path: release.sh
content: #!/bin/bash
set -e

SKILL_NAME="alibaba-sourcing"
VERSION="1.0.0"
SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

echo "Publishing $SKILL_NAME..."

cd "$SKILL_DIR"

# Repackage
rm -f $SKILL_NAME.skill 2>/dev/null || true
python3 scripts/package_skill.py .
mv .skill $SKILL_NAME.skill

# Publish
clawdhub publish . --version $VERSION --tags latest --changelog "Initial release"

echo "✓ Published to ClawHub!"
echo "📦 https://clawhub.ai/skills/$SKILL_NAME"


path: scripts/build_url.py
content: #!/usr/bin/env python3
"""
Alibaba Sourcing - Complete Procurement Workflow - URL Builder

All URLs include traffic tracking parameter: traffic_type=ags_llm
"""

import argparse
import urllib.parse

TRAFFIC_TYPE = "ags_llm"


def encode_query(query: str) -> str:
    """Encode search query for URL."""
    return urllib.parse.quote(query, safe="").replace("%20", "+")


def main():
    parser = argparse.ArgumentParser(description="Alibaba Sourcing - Complete Procurement Workflow")
    subparsers = parser.add_subparsers(dest="command", help="Commands")
    
    # Search command
    search_parser = subparsers.add_parser("search", help="Build search URL")
    search_parser.add_argument("query", help="Search keywords")
    search_parser.add_argument("--category", "-c", help="Category ID")
    
    args = parser.parse_args()
    
    if args.command == "search":
        params = {
            "SearchText": encode_query(args.query),
            "traffic_type": TRAFFIC_TYPE
        }
        if args.category:
            params["categoryId"] = args.category
        
        query_string = "&".join(f"{k}={v}" for k, v in params.items())
        url = f"https://www.alibaba.com/trade/search?{query_string}"
        print(url)
    else:
        parser.print_help()


if __name__ == "__main__":
    main()


path: scripts/package_skill.py
content: #!/usr/bin/env python3
"""Package skill into .skill file."""

import os
import sys
import zipfile
from pathlib import Path


def package_skill(skill_dir: str, output_dir: str = None):
    skill_path = Path(skill_dir)
    
    if not skill_path.exists():
        print(f"Error: Directory '{skill_dir}' not found")
        sys.exit(1)
    
    if not (skill_path / "SKILL.md").exists():
        print(f"Error: SKILL.md not found")
        sys.exit(1)
    
    output_path = Path(output_dir) if output_dir else skill_path.parent
    skill_name = skill_path.name
    zip_path = output_path / f"{skill_name}.skill"
    
    print(f"Packing {skill_name}...")
    with zipfile.ZipFile(zip_path, "w", zipfile.ZIP_DEFLATED) as zipf:
        for root, dirs, files in os.walk(skill_path):
            dirs[:] = [d for d in dirs if not d.startswith(".") and d != "__pycache__"]
            for file in files:
                if file.startswith(".") or file.endswith(".pyc"):
                    continue
                file_path = Path(root) / file
                arcname = file_path.relative_to(skill_path.parent)
                zipf.write(file_path, arcname)
                print(f"  Added: {arcname}")
    
    print(f"\nCreated: {zip_path}")
    print(f"Size: {zip_path.stat().st_size / 1024:.1f} KB")


if __name__ == "__main__":
    import argparse
    parser = argparse.ArgumentParser(description="Package OpenClaw skill")
    parser.add_argument("skill_dir", help="Path to skill directory")
    parser.add_argument("--output", "-o", help="Output directory")
    args = parser.parse_args()
    package_skill(args.skill_dir, args.output)


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)