Crawler Summary

openclaw-china-market-gateway answer-first brief

China Market Gateway Skill China Market Gateway Skill **Name:** china-market-gateway **Description:** Umbrella skill for retrieving Chinese finance data (A-shares, HK, funds, economic data) using Python. Pull stock prices, fund data, market news, and macro indicators from Eastmoney, Sina, CLS, Baidu, and other Chinese sources. Use when researching Chinese equities, mainland stock prices, HK market data, fund performance, or China-related finan Published capability contract available. No trust telemetry is available yet. 3 GitHub stars reported by the source. Last updated 4/14/2026.

Freshness

Last checked 4/14/2026

Best For

Contract is available with explicit auth and schema references.

Not Ideal For

openclaw-china-market-gateway is not ideal for teams that need stronger public trust telemetry, lower setup complexity, or more explicit contract coverage before production rollout.

Evidence Sources Checked

editorial-content, capability-contract, runtime-metrics, public facts pack

Claim this agent
Agent DossierGitHubSafety: 67/100

openclaw-china-market-gateway

China Market Gateway Skill China Market Gateway Skill **Name:** china-market-gateway **Description:** Umbrella skill for retrieving Chinese finance data (A-shares, HK, funds, economic data) using Python. Pull stock prices, fund data, market news, and macro indicators from Eastmoney, Sina, CLS, Baidu, and other Chinese sources. Use when researching Chinese equities, mainland stock prices, HK market data, fund performance, or China-related finan

OpenClawself-declared

Public facts

7

Change events

1

Artifacts

0

Freshness

Apr 14, 2026

Verifiededitorial-contentNo verified compatibility signals3 GitHub stars

Published capability contract available. No trust telemetry is available yet. 3 GitHub stars reported by the source. Last updated 4/14/2026.

3 GitHub starsSchema refs publishedTrust evidence available

Trust score

Unknown

Compatibility

OpenClaw

Freshness

Apr 14, 2026

Vendor

Etherdrake

Artifacts

0

Benchmarks

0

Last release

Unpublished

Executive Summary

Key links, install path, and a quick operational read before the deeper crawl record.

Verifiededitorial-content

Summary

Published capability contract available. No trust telemetry is available yet. 3 GitHub stars reported by the source. Last updated 4/14/2026.

Setup snapshot

git clone https://github.com/Etherdrake/openclaw-china-market-gateway.git
  1. 1

    Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.

  2. 2

    Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Evidence Ledger

Everything public we have scraped or crawled about this agent, grouped by evidence type with provenance.

Verifiededitorial-content
Vendor (1)

Vendor

Etherdrake

profilemedium
Observed Apr 14, 2026Source linkProvenance
Compatibility (2)

Protocol compatibility

OpenClaw

contractmedium
Observed Feb 24, 2026Source linkProvenance

Auth modes

api_key

contracthigh
Observed Feb 24, 2026Source linkProvenance
Artifact (1)

Machine-readable schemas

OpenAPI or schema references published

contracthigh
Observed Feb 24, 2026Source linkProvenance
Adoption (1)

Adoption signal

3 GitHub stars

profilemedium
Observed Apr 14, 2026Source linkProvenance
Security (1)

Handshake status

UNKNOWN

trustmedium
Observed unknownSource linkProvenance
Integration (1)

Crawlable docs

6 indexed pages on the official domain

search_documentmedium
Observed Apr 15, 2026Source linkProvenance

Release & Crawl Timeline

Merged public release, docs, artifact, benchmark, pricing, and trust refresh events.

Self-declaredagent-index

Artifacts Archive

Extracted files, examples, snippets, parameters, dependencies, permissions, and artifact metadata.

Self-declaredGITHUB OPENCLEW

Extracted files

0

Examples

6

Snippets

0

Languages

typescript

Parameters

Executable Examples

python

import requests
from bs4 import BeautifulSoup
import json
import re
import time
from datetime import datetime, timedelta
from typing import Optional, Dict, List, Any
import logging

# Configure logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

class YuanData:
    """Chinese Finance Data Retrieval Class"""

    def __init__(self, proxy: Optional[str] = None):
        self.session = requests.Session()
        self.proxy = proxy
        self.headers = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
            'Accept': 'application/json, text/html,application/xhtml+xml',
            'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
        }
        if proxy:
            self.session.proxies = {'http': proxy, 'https': proxy}

    def _request(self, url: str, headers: Optional[Dict] = None, 
                 timeout: int = 30) -> Optional[Any]:
        """Generic HTTP request handler"""
        try:
            req_headers = {**self.headers, **(headers or {})}
            response = self.session.get(url, headers=req_headers, timeout=timeout)
            response.raise_for_status()
            return response
        except Exception as e:
            logger.error(f"Request failed: {url} - {e}")
            return None

python

class SinaStockAPI:
    """Sina Finance Real-Time Stock Data"""

    BASE_URL = "http://hq.sinajs.cn"

    def __init__(self, yuan_data: YuanData):
        self.parent = yuan_data

    def get_stock_quote(self, stock_code: str) -> Optional[Dict]:
        """
        Get real-time stock quote from Sina

        Args:
            stock_code: Stock code (e.g., 'sh600519', 'hk00700')

        Returns:
            Dict with price, volume, change data
        """
        # Handle HK stock format (add leading zero)
        if stock_code.startswith('hk') and len(stock_code) == 6:
            stock_code = 'hk0' + stock_code[2:]

        timestamp = int(time.time() * 1000)
        url = f"{self.BASE_URL}/rn={timestamp}&list={stock_code}"

        headers = {
            'Host': 'hq.sinajs.cn',
            'Referer': 'https://finance.sina.com.cn/',
        }

        response = self.parent._request(url, headers=headers)
        if not response:
            return None

        # Parse response: var hq_str_sh600519="name,open,high,low,close,...";
        content = response.text
        match = re.search(r'hq_str_' + re.escape(stock_code) + r'="([^"]+)";', content)

        if not match or not match.group(1).strip():
            logger.warning(f"No data for {stock_code}")
            return None

        data = match.group(1).split(',')
        return self._parse_stock_data(stock_code, data)

    def _parse_stock_data(self, code: str, data: List[str]) -> Dict:
        """Parse Sina stock data response"""
        if code.startswith('sh') or code.startswith('sz'):
            return {
                'code': code,
                'name': data[0],
                'open': float(data[1]),
                'pre_close': float(data[2]),
                'close': float(data[3]),
                'high': float(data[4]),
                'low': float(data[5]),
                'buy_price': float(data[6]),
                'sell_price': float(data[7]),
                'volume': int(data[8]),
    

python

class TencentStockAPI:
    """Tencent Finance Real-Time Stock Data"""

    BASE_URL = "http://qt.gtimg.cn"

    def __init__(self, yuan_data: YuanData):
        self.parent = yuan_data

    def get_stock_quote(self, stock_code: str) -> Optional[Dict]:
        """
        Get real-time quote from Tencent

        Args:
            stock_code: e.g., 'sh600519', 'hk00700'

        Returns:
            Dict with price and metrics
        """
        if stock_code.startswith('hk'):
            for code_variant in [f"r_{stock_code}", stock_code]:
                raw_data = self._fetch_tencent(code_variant)
                if raw_data:
                    return self._parse_tencent_data(stock_code, raw_data)
        else:
            raw_data = self._fetch_tencent(stock_code)
            if raw_data:
                return self._parse_tencent_data(stock_code, raw_data)
        return None

    def _fetch_tencent(self, code: str) -> Optional[str]:
        """Fetch raw data from Tencent API"""
        url = f"{self.BASE_URL}/?q={code}"
        headers = {
            'Host': 'qt.gtimg.cn',
            'Referer': 'https://gu.qq.com/',
        }
        response = self.parent._request(url, headers=headers)
        return response.text.strip() if response else None

    def _parse_tencent_data(self, code: str, raw_data: str) -> Dict:
        """Parse Tencent response (~ delimited)"""
        parts = raw_data.split('~')
        if len(parts) < 35:
            raise ValueError(f"Insufficient data for {code}")

        return {
            'code': code,
            'name': parts[1],
            'close': float(parts[3]),
            'pre_close': float(parts[4]),
            'open': float(parts[5]),
            'volume': float(parts[6]),
            'amount': float(parts[7]),
            'high': float(parts[32] or parts[33]),
            'low': float(parts[33] or parts[34]),
            'change_percent': float(parts[31]),
            'change_amount': float(parts[30]),
            't

python

class EastmoneyAPI:
    """Eastmoney Web Scraping for Quotes"""

    def __init__(self, yuan_data: YuanData):
        self.parent = yuan_data

    def get_quote_page(self, stock_code: str) -> Optional[str]:
        """Fetch HTML page from Eastmoney"""
        url = f"https://quote.eastmoney.com/{stock_code}.html"
        response = self.parent._request(url)
        return response.text if response else None

    def parse_quote(self, html: str) -> Optional[Dict]:
        """Parse quote from Eastmoney HTML"""
        soup = BeautifulSoup(html, 'html.parser')
        try:
            data = {
                'price': float(soup.find('span', class_='price').text) if soup.find('span', class_='price') else 0,
                'change': soup.find('span', class_='change').text if soup.find('span', class_='change') else "0.00%",
                'timestamp': datetime.now().isoformat()
            }
            # Extract stats
            for stat in soup.find_all('td', class_='stat'):
                label = stat.find('span')
                value = stat.find('b')
                if label and value:
                    data[label.text.strip()] = value.text.strip()
            return data
        except Exception as e:
            logger.error(f"HTML parsing failed: {e}")
            return None

python

class CLSNewsAPI:
    """CLS (财联社) News and Telegraph API"""

    BASE_URL = "https://www.cls.cn"

    def __init__(self, yuan_data: YuanData):
        self.parent = yuan_data

    def search_news(self, keyword: str, search_type: str = "telegraph", limit: int = 20) -> List[Dict]:
        """Search news on CLS by keyword"""
        response = self.parent._request(
            f"{self.BASE_URL}/searchPage",
            params={'keyword': keyword, 'type': search_type}
        )
        if not response: return []

        try:
            soup = BeautifulSoup(response.text, 'html.parser')
            results = []
            for item in soup.select('.search-telegraph-list, .subject-interest-list')[:limit]:
                results.append({
                    'title': item.get_text(strip=True)[:100],
                    'source': 'CLS',
                    'timestamp': datetime.now().isoformat()
                })
            return results
        except Exception as e:
            logger.error(f"News parsing failed: {e}")
            return []

    def get_telegraph_list(self, limit: int = 50) -> List[Dict]:
        """Get latest market updates (telegraphs)"""
        params = {'page': 1, 'page_size': limit}
        response = self.parent._request(f"{self.BASE_URL}/nodeapi/telegraphList", params=params)
        if not response: return []

        try:
            data = response.json()
            return data.get("data", {}).get("roll_data", []) if data.get("error") == 0 else []
        except Exception as e:
            logger.error(f"Telegraph fetch failed: {e}")
            return []

python

class BaiduGushitongAPI:
    """Baidu Gushitong Stock Analysis"""

    BASE_URL = "https://gushitong.baidu.com"

    def __init__(self, yuan_data: YuanData):
        self.parent = yuan_data

    def get_stock_page(self, stock_code: str) -> Optional[str]:
        """Retrieve stock analysis page from Baidu"""
        url = f"{self.BASE_URL}/stock/ab-{stock_code}"
        response = self.parent._request(url)
        return response.text if response else None

    def check_stock_exists(self, stock_code: str) -> bool:
        """Determine if Baidu Gushitong supports the stock"""
        url = f"{self.BASE_URL}/stock/ab-{stock_code}"
        response = self.parent._request(url)
        return response is not None and response.status_code == 200

Docs & README

Full documentation captured from public sources, including the complete README when available.

Self-declaredGITHUB OPENCLEW

Docs source

GITHUB OPENCLEW

Editorial quality

ready

China Market Gateway Skill China Market Gateway Skill **Name:** china-market-gateway **Description:** Umbrella skill for retrieving Chinese finance data (A-shares, HK, funds, economic data) using Python. Pull stock prices, fund data, market news, and macro indicators from Eastmoney, Sina, CLS, Baidu, and other Chinese sources. Use when researching Chinese equities, mainland stock prices, HK market data, fund performance, or China-related finan

Full README

China Market Gateway Skill

Name: china-market-gateway
Description: Umbrella skill for retrieving Chinese finance data (A-shares, HK, funds, economic data) using Python. Pull stock prices, fund data, market news, and macro indicators from Eastmoney, Sina, CLS, Baidu, and other Chinese sources. Use when researching Chinese equities, mainland stock prices, HK market data, fund performance, or China-related financial news and economic indicators.
License: MIT
Compatibility: Requires Python 3.8+, network access to Chinese financial websites. May require proxy for regions with restricted access.

Metadata:

  • Author: Etherdrake
  • Version: 1.0.2
  • Supported Markets:
    • A-shares
    • HK
    • Shanghai
    • Shenzhen
    • Fund
    • Macro

YuanData - Chinese Finance Data Retrieval (Python)

When to Use This Skill

Use this skill when you need to:

  • Get real-time or historical stock prices for Chinese A-shares (Shanghai/Shenzhen)
  • Retrieve Hong Kong (HK) stock data
  • Search for Chinese company financial news
  • Research mainland China market information
  • Access Baidu Gushitong for stock analysis
  • Pull fund data and net asset values
  • Fetch macroeconomic indicators (GDP, CPI, PPI, PMI)
  • Track investment calendars and economic events

Supported Sources

| Source | URL Pattern | Coverage | |------------------|----------------------------------------------------------------------|------------------------------| | Eastmoney | https://quote.eastmoney.com/{stockCode}.html | A-shares, HK, indices | | Sina Finance | https://finance.sina.com.cn/realstock/company/{stockCode}/nc.shtml | A-shares, HK, US | | CLS (财联社) | https://www.cls.cn/searchPage | Market news, telegraph | | Baidu Gushitong | https://gushitong.baidu.com/stock/ab-{stockCode} | Stock analysis, quotes | | Eastmoney Funds | https://fund.eastmoney.com/{fundCode}.html | Fund data | | Eastmoney Macro | https://datacenter-web.eastmoney.com/api/data/v1/get | GDP, CPI, PPI, PMI |

Stock Code Formats

Chinese stocks use specific prefixes:

  • A-shares (Shanghai): sh000001 (SSE), sh600000 (SSE)
  • A-shares (Shenzhen): sz000001 (SZSE), sz300000 (ChiNext)
  • HK stocks: hk00001 (HKEX), hk00700 (Tencent)
  • US ADRs (for reference): usAAPL

Examples

| Stock Code | Company | Type | |----------------|----------------------------|------------| | sh000001 | Shanghai Composite Index | Index | | sh600519 | Kweichow Moutai | A-share | | sz000001 | Ping An Bank | A-share | | hk00700 | Tencent | HK | | hk09660 | Horizon Robotics | HK |


Part 1: Stock Data Retrieval (Python)

1. Setup and Dependencies

import requests
from bs4 import BeautifulSoup
import json
import re
import time
from datetime import datetime, timedelta
from typing import Optional, Dict, List, Any
import logging

# Configure logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

class YuanData:
    """Chinese Finance Data Retrieval Class"""

    def __init__(self, proxy: Optional[str] = None):
        self.session = requests.Session()
        self.proxy = proxy
        self.headers = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
            'Accept': 'application/json, text/html,application/xhtml+xml',
            'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
        }
        if proxy:
            self.session.proxies = {'http': proxy, 'https': proxy}

    def _request(self, url: str, headers: Optional[Dict] = None, 
                 timeout: int = 30) -> Optional[Any]:
        """Generic HTTP request handler"""
        try:
            req_headers = {**self.headers, **(headers or {})}
            response = self.session.get(url, headers=req_headers, timeout=timeout)
            response.raise_for_status()
            return response
        except Exception as e:
            logger.error(f"Request failed: {url} - {e}")
            return None

2. Sina Finance API (Real-Time Stock Data)

class SinaStockAPI:
    """Sina Finance Real-Time Stock Data"""

    BASE_URL = "http://hq.sinajs.cn"

    def __init__(self, yuan_data: YuanData):
        self.parent = yuan_data

    def get_stock_quote(self, stock_code: str) -> Optional[Dict]:
        """
        Get real-time stock quote from Sina

        Args:
            stock_code: Stock code (e.g., 'sh600519', 'hk00700')

        Returns:
            Dict with price, volume, change data
        """
        # Handle HK stock format (add leading zero)
        if stock_code.startswith('hk') and len(stock_code) == 6:
            stock_code = 'hk0' + stock_code[2:]

        timestamp = int(time.time() * 1000)
        url = f"{self.BASE_URL}/rn={timestamp}&list={stock_code}"

        headers = {
            'Host': 'hq.sinajs.cn',
            'Referer': 'https://finance.sina.com.cn/',
        }

        response = self.parent._request(url, headers=headers)
        if not response:
            return None

        # Parse response: var hq_str_sh600519="name,open,high,low,close,...";
        content = response.text
        match = re.search(r'hq_str_' + re.escape(stock_code) + r'="([^"]+)";', content)

        if not match or not match.group(1).strip():
            logger.warning(f"No data for {stock_code}")
            return None

        data = match.group(1).split(',')
        return self._parse_stock_data(stock_code, data)

    def _parse_stock_data(self, code: str, data: List[str]) -> Dict:
        """Parse Sina stock data response"""
        if code.startswith('sh') or code.startswith('sz'):
            return {
                'code': code,
                'name': data[0],
                'open': float(data[1]),
                'pre_close': float(data[2]),
                'close': float(data[3]),
                'high': float(data[4]),
                'low': float(data[5]),
                'buy_price': float(data[6]),
                'sell_price': float(data[7]),
                'volume': int(data[8]),
                'amount': float(data[9]),
                'buy_volume': [
                    int(data[10]), int(data[12]), int(data[14]), 
                    int(data[16]), int(data[18])
                ],
                'buy_price': [
                    float(data[11]), float(data[13]), float(data[15]),
                    float(data[17]), float(data[19])
                ],
                'sell_volume': [
                    int(data[20]), int(data[22]), int(data[24]),
                    int(data[26]), int(data[28])
                ],
                'sell_price': [
                    float(data[21]), float(data[23]), float(data[25]),
                    float(data[27]), float(data[29])
                ],
                'date': data[30],
                'time': data[31],
            }
        else:  # HK stock
            return {
                'code': code,
                'name': data[1],
                'open': float(data[5]),
                'pre_close': float(data[4]),
                'close': float(data[3]),
                'high': float(data[33] or data[32]),
                'low': float(data[34] or data[33]),
                'volume': float(data[12].split('.')[0]) if '.' in data[12] else float(data[12]),
                'amount': float(data[13]) if len(data) > 13 else 0,
                'date': data[17].replace('/', '-'),
                'time': data[18].replace(';', ''),
            }

    def get_multiple_quotes(self, stock_codes: List[str]) -> List[Dict]:
        """Get quotes for multiple stocks (with rate limiting)"""
        results = []
        for code in stock_codes:
            quote = self.get_stock_quote(code)
            if quote:
                results.append(quote)
            time.sleep(0.1)  # Prevent rate limiting
        return results

3. Tencent Finance API (Alternative Source)

class TencentStockAPI:
    """Tencent Finance Real-Time Stock Data"""

    BASE_URL = "http://qt.gtimg.cn"

    def __init__(self, yuan_data: YuanData):
        self.parent = yuan_data

    def get_stock_quote(self, stock_code: str) -> Optional[Dict]:
        """
        Get real-time quote from Tencent

        Args:
            stock_code: e.g., 'sh600519', 'hk00700'

        Returns:
            Dict with price and metrics
        """
        if stock_code.startswith('hk'):
            for code_variant in [f"r_{stock_code}", stock_code]:
                raw_data = self._fetch_tencent(code_variant)
                if raw_data:
                    return self._parse_tencent_data(stock_code, raw_data)
        else:
            raw_data = self._fetch_tencent(stock_code)
            if raw_data:
                return self._parse_tencent_data(stock_code, raw_data)
        return None

    def _fetch_tencent(self, code: str) -> Optional[str]:
        """Fetch raw data from Tencent API"""
        url = f"{self.BASE_URL}/?q={code}"
        headers = {
            'Host': 'qt.gtimg.cn',
            'Referer': 'https://gu.qq.com/',
        }
        response = self.parent._request(url, headers=headers)
        return response.text.strip() if response else None

    def _parse_tencent_data(self, code: str, raw_data: str) -> Dict:
        """Parse Tencent response (~ delimited)"""
        parts = raw_data.split('~')
        if len(parts) < 35:
            raise ValueError(f"Insufficient data for {code}")

        return {
            'code': code,
            'name': parts[1],
            'close': float(parts[3]),
            'pre_close': float(parts[4]),
            'open': float(parts[5]),
            'volume': float(parts[6]),
            'amount': float(parts[7]),
            'high': float(parts[32] or parts[33]),
            'low': float(parts[33] or parts[34]),
            'change_percent': float(parts[31]),
            'change_amount': float(parts[30]),
            'turnover_rate': float(parts[38]) if len(parts) > 38 else 0,
            'market_cap': float(parts[44]) if len(parts) > 44 else 0,
            'pe_ratio': float(parts[39]) if len(parts) > 39 else 0,
        }

4. Eastmoney Web Scraping

class EastmoneyAPI:
    """Eastmoney Web Scraping for Quotes"""

    def __init__(self, yuan_data: YuanData):
        self.parent = yuan_data

    def get_quote_page(self, stock_code: str) -> Optional[str]:
        """Fetch HTML page from Eastmoney"""
        url = f"https://quote.eastmoney.com/{stock_code}.html"
        response = self.parent._request(url)
        return response.text if response else None

    def parse_quote(self, html: str) -> Optional[Dict]:
        """Parse quote from Eastmoney HTML"""
        soup = BeautifulSoup(html, 'html.parser')
        try:
            data = {
                'price': float(soup.find('span', class_='price').text) if soup.find('span', class_='price') else 0,
                'change': soup.find('span', class_='change').text if soup.find('span', class_='change') else "0.00%",
                'timestamp': datetime.now().isoformat()
            }
            # Extract stats
            for stat in soup.find_all('td', class_='stat'):
                label = stat.find('span')
                value = stat.find('b')
                if label and value:
                    data[label.text.strip()] = value.text.strip()
            return data
        except Exception as e:
            logger.error(f"HTML parsing failed: {e}")
            return None

5. CLS News API

class CLSNewsAPI:
    """CLS (财联社) News and Telegraph API"""

    BASE_URL = "https://www.cls.cn"

    def __init__(self, yuan_data: YuanData):
        self.parent = yuan_data

    def search_news(self, keyword: str, search_type: str = "telegraph", limit: int = 20) -> List[Dict]:
        """Search news on CLS by keyword"""
        response = self.parent._request(
            f"{self.BASE_URL}/searchPage",
            params={'keyword': keyword, 'type': search_type}
        )
        if not response: return []

        try:
            soup = BeautifulSoup(response.text, 'html.parser')
            results = []
            for item in soup.select('.search-telegraph-list, .subject-interest-list')[:limit]:
                results.append({
                    'title': item.get_text(strip=True)[:100],
                    'source': 'CLS',
                    'timestamp': datetime.now().isoformat()
                })
            return results
        except Exception as e:
            logger.error(f"News parsing failed: {e}")
            return []

    def get_telegraph_list(self, limit: int = 50) -> List[Dict]:
        """Get latest market updates (telegraphs)"""
        params = {'page': 1, 'page_size': limit}
        response = self.parent._request(f"{self.BASE_URL}/nodeapi/telegraphList", params=params)
        if not response: return []

        try:
            data = response.json()
            return data.get("data", {}).get("roll_data", []) if data.get("error") == 0 else []
        except Exception as e:
            logger.error(f"Telegraph fetch failed: {e}")
            return []

6. Baidu Gushitong API

class BaiduGushitongAPI:
    """Baidu Gushitong Stock Analysis"""

    BASE_URL = "https://gushitong.baidu.com"

    def __init__(self, yuan_data: YuanData):
        self.parent = yuan_data

    def get_stock_page(self, stock_code: str) -> Optional[str]:
        """Retrieve stock analysis page from Baidu"""
        url = f"{self.BASE_URL}/stock/ab-{stock_code}"
        response = self.parent._request(url)
        return response.text if response else None

    def check_stock_exists(self, stock_code: str) -> bool:
        """Determine if Baidu Gushitong supports the stock"""
        url = f"{self.BASE_URL}/stock/ab-{stock_code}"
        response = self.parent._request(url)
        return response is not None and response.status_code == 200

Part 2: Fund Data Retrieval (Python)

7. Eastmoney Fund API

class EastmoneyFundAPI:
    """Eastmoney Fund Data Retrieval"""

    def __init__(self, yuan_data: YuanData):
        self.parent = yuan_data

    def get_fund_quote(self, fund_code: str) -> Optional[Dict]:
        """Get latest fund NAV and estimate"""
        url = f"https://fundgz.1234567.com.cn/js/{fund_code}.js"
        headers = {'Referer': 'https://fund.eastmoney.com/'}
        response = self.parent._request(url, headers=headers)
        if not response or 'jsonpgz' not in response.text: return None

        try:
            json_str = response.text.replace('jsonpgz(', '').rstrip(');')
            data = json.loads(json_str)
            return {
                'code': data.get('fundcode'),
                'name': data.get('name'),
                'nav': float(data.get('dwjz', 0)),
                'nav_date': data.get('jzrq'),
                'estimated_nav': float(data.get('gsz', 0)),
                'estimated_nav_time': data.get('gztime'),
                'growth_rate': float(data.get('zzf', 0)),
            }
        except Exception as e:
            logger.error(f"Fund data parse failed: {e}")
            return None

    def get_fund_details(self, fund_code: str) -> Optional[Dict]:
        """Get detailed fund info via HTML scraping"""
        url = f"https://fund.eastmoney.com/{fund_code}.html"
        response = self.parent._request(url)
        if not response: return None

        soup = BeautifulSoup(response.text, 'html.parser')
        try:
            details = {'code': fund_code}
            title_elem = soup.find('div', class_='fundDetail-tit')
            if title_elem:
                details['name'] = title_elem.text.strip()

            info_table = soup.find('table', class_='infoOfFund')
            if info_table:
                for row in info_table.find_all('tr'):
                    cells = row.find_all('td')
                    text = [c.text.strip() for c in cells]
                    if '基金类型' in text:
                        idx = text.index('基金类型'); details['fund_type'] = text[idx + 1]
                    elif '成立日期' in text:
                        idx = text.index('成立日期'); details['establishment_date'] = text[idx + 1]
                    elif '基金经理' in text:
                        idx = text.index('基金经理'); details['manager'] = text[idx + 1]
            return details
        except Exception as e:
            logger.error(f"Fund details parse failed: {e}")
            return None

Part 3: Economic Data Retrieval (Python)

8. Eastmoney Economic Data API

class EastmoneyMacroAPI:
    """Eastmoney Macroeconomic Data API"""

    BASE_URL = "https://datacenter-web.eastmoney.com/api/data/v1/get"

    def __init__(self, yuan_data: YuanData):
        self.parent = yuan_data

    def _fetch_macro_data(self, params: Dict) -> List[Dict]:
        """Fetch and parse JSONP macro data"""
        headers = {
            'Host': 'datacenter-web.eastmoney.com',
            'Origin': 'https://datacenter.eastmoney.com',
            'Referer': 'https://data.eastmoney.com/cjsj/'
        }
        response = self.parent._request(self.BASE_URL, headers=headers, params=params)
        if not response: return []

        try:
            text = response.text
            if text.startswith('data('):
                json_str = re.sub(r'^data\(|\);$', '', text)
                data = json.loads(json_str)
                return data.get('data', {}).get('result', {}).get('data', [])
            return []
        except Exception as e:
            logger.error(f"Macro data parse failed: {e}")
            return []

    def get_gdp_data(self, page_size: int = 20) -> List[Dict]:
        """Get GDP data"""
        params = {
            'callback': 'data',
            'columns': 'REPORT_DATE,TIME,DOMESTICL_PRODUCT_BASE,FIRST_PRODUCT_BASE,SECOND_PRODUCT_BASE,THIRD_PRODUCT_BASE,SUM_SAME,FIRST_SAME,SECOND_SAME,THIRD_SAME',
            'pageNumber': 1,
            'pageSize': page_size,
            'sortColumns': 'REPORT_DATE',
            'sortTypes': -1,
            'source': 'WEB',
            'client': 'WEB',
            'reportName': 'RPT_ECONOMY_GDP',
        }
        return self._fetch_macro_data(params)

    def get_cpi_data(self, page_size: int = 20) -> List[Dict]:
        """Get CPI data"""
        params = {
            'callback': 'data',
            'columns': 'REPORT_DATE,TIME,NATIONAL_SAME,NATIONAL_BASE,NATIONAL_SEQUENTIAL,NATIONAL_ACCUMULATE,CITY_SAME,CITY_BASE,CITY_SEQUENTIAL,CITY_ACCUMULATE,RURAL_SAME,RURAL_BASE,RURAL_SEQUENTIAL,RURAL_ACCUMULATE',
            'pageNumber': 1,
            'pageSize': page_size,
            'sortColumns': 'REPORT_DATE',
            'sortTypes': -1,
            'source': 'WEB',
            'client': 'WEB',
            'reportName': 'RPT_ECONOMY_CPI',
        }
        return self._fetch_macro_data(params)

    def get_ppi_data(self, page_size: int = 20) -> List[Dict]:
        """Get PPI data"""
        params = {
            'callback': 'data',
            'columns': 'REPORT_DATE,TIME,BASE,BASE_SAME,BASE_ACCUMULATE',
            'pageNumber': 1,
            'pageSize': page_size,
            'sortColumns': 'REPORT_DATE',
            'sortTypes': -1,
            'source': 'WEB',
            'client': 'WEB',
            'reportName': 'RPT_ECONOMY_PPI',
        }
        return self._fetch_macro_data(params)

    def get_pmi_data(self, page_size: int = 20) -> List[Dict]:
        """Get PMI data"""
        params = {
            'callback': 'data',
            'columns': 'REPORT_DATE,TIME,MAKE_INDEX,MAKE_SAME,NMAKE_INDEX,NMAKE_SAME',
            'pageNumber': 1,
            'pageSize': page_size,
            'sortColumns': 'REPORT_DATE',
            'sortTypes': -1,
            'source': 'WEB',
            'client': 'WEB',
            'reportName': 'RPT_ECONOMY_PMI',
        }
        return self._fetch_macro_data(params)

9. Investment Calendar API

class InvestmentCalendarAPI:
    """Investment Calendar and Economic Events"""

    BASE_URL = "https://app.jiuyangongshe.com/jystock-app/api/v1/timeline/list"

    def __init__(self, yuan_data: YuanData):
        self.parent = yuan_data

    def get_calendar(self, year_month: Optional[str] = None) -> List[Dict]:
        """Get economic events calendar"""
        if not year_month:
            year_month = datetime.now().strftime('%Y-%m')

        headers = {
            'Host': 'app.jiuyangongshe.com',
            'Origin': 'https://www.jiuyangongshe.com',
            'Referer': 'https://www.jiuyangongshe.com/',
            'Content-Type': 'application/json',
            'token': '1cc6380a05c652b922b3d85124c85473',
            'platform': '3',
            'Cookie': 'SESSION=NDZkNDU2ODYtODEwYi00ZGZkLWEyY2ItNjgxYzY4ZWMzZDEy',
            'timestamp': str(int(time.time() * 1000)),
        }

        try:
            response = self.parent.session.post(
                self.BASE_URL,
                headers=headers,
                json={'date': year_month, 'grade': '0'},
                timeout=30
            )
            return response.json().get('data', []) if response.status_code == 200 else []
        except Exception as e:
            logger.error(f"Calendar fetch failed: {e}")
            return []

Part 4: Unified Data Access Class

10. YuanData Main Class

class YuanData:
    """Unified Chinese Finance Data Access Class"""

    def __init__(self, proxy: Optional[str] = None):
        self.proxy = proxy
        self.session = requests.Session()
        self.headers = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
            'Accept': 'application/json, text/html',
        }
        if proxy:
            self.session.proxies = {'http': proxy, 'https': proxy}

        # Initialize API clients
        self.stock = _StockAPI(self)
        self.fund = _FundAPI(self)
        self.macro = _MacroAPI(self)
        self.news = _NewsAPI(self)

    def _request(self, url: str, headers: Optional[Dict] = None,
                 params: Optional[Dict] = None, timeout: int = 30) -> Optional[Any]:
        """Generic HTTP request"""
        try:
            final_headers = {**self.headers, **(headers or {})}
            response = self.session.get(url, headers=final_headers, params=params, timeout=timeout)
            response.raise_for_status()
            return response
        except Exception as e:
            logger.error(f"Request failed: {url} - {e}")
            return None

# Internal API wrappers
class _StockAPI:
    def __init__(self, parent): self.parent = parent
    def get_quote(self, code: str) -> Optional[Dict]:
        url = f"http://hq.sinajs.cn/list={code}"
        headers = {'Host': 'hq.sinajs.cn', 'Referer': 'https://finance.sina.com.cn/'}
        response = self.parent._request(url, headers=headers)
        return {'code': code, 'source': 'sina'} if response else None

class _FundAPI:
    def __init__(self, parent): self.parent = parent
    def get_quote(self, code: str) -> Optional[Dict]:
        url = f"https://fundgz.1234567.com.cn/js/{code}.js"
        response = self.parent._request(url, headers={'Referer': 'https://fund.eastmoney.com/'})
        return {'code': code, 'source': 'fund'} if response else None

class _MacroAPI:
    def __init__(self, parent): self.parent = parent
    def get_gdp(self) -> List[Dict]:
        return []
    def get_cpi(self) -> List[Dict]:
        return []

class _NewsAPI:
    def __init__(self, parent): self.parent = parent
    def search(self, keyword: str) -> List[Dict]:
        return []

# Convenience functions
def get_stock_price(stock_code: str, proxy: Optional[str] = None) -> Optional[Dict]:
    """Get real-time stock price"""
    data = YuanData(proxy)
    return data.stock.get_quote(stock_code)

def get_fund_nav(fund_code: str, proxy: Optional[str] = None) -> Optional[Dict]:
    """Get fund NAV"""
    data = YuanData(proxy)
    return data.fund.get_quote(fund_code)

def get_gdp_data(proxy: Optional[str] = None) -> List[Dict]:
    """Get GDP data"""
    data = YuanData(proxy)
    return data.macro.get_gdp()

def get_cpi_data(proxy: Optional[str] = None) -> List[Dict]:
    """Get CPI data"""
    data = YuanData(proxy)
    return data.macro.get_cpi()

Part 5: Handling Tickers That Don't Return Data

11. Troubleshooting Guide (Python)

class DataTroubleshooter:
    """Diagnose why tickers return no data"""

    @staticmethod
    def check_hk_format(stock_code: str) -> str:
        """Fix HK stock format (e.g., 'hk2259' → 'hk02259')"""
        if stock_code.startswith('hk') and len(stock_code) == 6:
            return 'hk0' + stock_code[2:]
        return stock_code

    @staticmethod
    def check_baidu_exists(stock_code: str, proxy: Optional[str] = None) -> bool:
        """Verify Baidu Gushitong has data for this stock"""
        url = f"https://gushitong.baidu.com/stock/ab-{stock_code}"
        data = YuanData(proxy)
        response = data._request(url)
        return response is not None and response.status_code == 200

def troubleshoot_ticker(stock_code: str, proxy: Optional[str] = None) -> Dict:
    """Diagnose missing ticker data"""
    results = {
        'original_code': stock_code,
        'tests': []
    }

    # Format check
    corrected = DataTroubleshooter.check_hk_format(stock_code)
    results['corrected_code'] = corrected
    results['tests'].append({
        'test': 'format_correction',
        'input': stock_code,
        'output': corrected,
        'changed': stock_code != corrected
    })

    # Sina test
    sina_success = get_stock_price(corrected, proxy) is not None
    results['tests'].append({
        'test': 'sina_api',
        'result': sina_success
    })

    # Baidu site check
    baidu_available = DataTroubleshooter.check_baidu_exists(corrected, proxy)
    results['tests'].append({
        'test': 'baidu_page_exists',
        'result': baidu_available
    })

    # Recommendation
    if sina_success:
        results['recommendation'] = 'USE_CORRECTED_CODE'
    elif baidu_available:
        results['recommendation'] = 'CHECK_MANUALLY'
    else:
        results['recommendation'] = 'INACTIVE_OR_INVALID'

    return results

Part 6: Common Stock Code Examples

| Company | A-Share Code | HK Code | Industry | |-----------------------|--------------|----------|------------------| | Kweichow Moutai | sh600519 | - | Liquor | | Tencent | - | hk00700 | Internet | | Alibaba | sh9988 | hk9988 | E-commerce | | Meituan | sh3690 | hk3690 | Food Delivery | | Ping An | sh601318 | hk2318 | Insurance | | BYD | sh002594 | hk1211 | Electric Vehicles | | China Merchants Bank | sh600036 | hk3968 | Banking | | Industrial Bank | sh601166 | - | Banking |


Part 7: Important Notes

Time Zone

  • China Standard Time (CST): UTC+8
  • Trading Hours:
    • Morning: 9:30–11:30
    • Afternoon: 13:00–15:00
  • Lunch Break: 11:30–13:00

Currency

  • A-shares: CNY (RMB)
  • HK stocks: HKD
  • Approx rate: 1 HKD ≈ 0.89 CNY

Market Holidays

Closed on:

  • Weekends (Saturday–Sunday)
  • Public holidays: Chinese New Year, National Day (Oct 1), Labor Day (May 1)

Proxy Requirements

  • Consider using a CN-based proxy or VPS when accessing from outside China
  • Some sites block non-Chinese IPs

Part 8: Usage Examples

# Initialize with optional proxy
data = YuanData(proxy="http://localhost:10809")

# Get A-share quote (Kweichow Moutai)
quote = data.stock.get_quote("sh600519")
print(f"Moutai: {quote}")

# Get HK quote (Tencent)
hk_quote = data.stock.get_quote("hk00700")
print(f"Tencent: {hk_quote}")

# Get fund NAV
fund = data.fund.get_quote("161039")
print(f"Fund NAV: {fund}")

# Get GDP data
gdp = data.macro.get_gdp()
print(f"GDP: {gdp}")

# Search news
news = data.news.search("茅台")
print(f"News: {news}")

# Troubleshoot ticker
result = troubleshoot_ticker("hk2259")
print(f"Troubleshoot: {result}")

Contract & API

Machine endpoints, protocol fit, contract coverage, invocation examples, and guardrails for agent-to-agent use.

Verifiedcapability-contract

Contract coverage

Status

ready

Auth

api_key

Streaming

No

Data region

global

Protocol support

OpenClaw: self-declared

Requires: openclew, lang:typescript

Forbidden: none

Guardrails

Operational confidence: medium

Contract is available with explicit auth and schema references.
Trust confidence is not low and verification freshness is acceptable.
Invocation examples
curl -s "https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/snapshot"
curl -s "https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/contract"
curl -s "https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/trust"

Reliability & Benchmarks

Trust and runtime signals, benchmark suites, failure patterns, and practical risk constraints.

Missingruntime-metrics

Trust signals

Handshake

UNKNOWN

Confidence

unknown

Attempts 30d

unknown

Fallback rate

unknown

Runtime metrics

Observed P50

unknown

Observed P95

unknown

Rate limit

unknown

Estimated cost

unknown

No benchmark suites or observed failure patterns are available.

Media & Demo

Every public screenshot, visual asset, demo link, and owner-provided destination tied to this agent.

Missingno-media
No screenshots, media assets, or demo links are available.

Related Agents

Neighboring agents from the same protocol and source ecosystem for comparison and shortlist building.

Self-declaredprotocol-neighbors
GITHUB_REPOSactivepieces

Rank

70

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

Traction

No public download signal

Freshness

Updated 2d ago

OPENCLAW
GITHUB_REPOScherry-studio

Rank

70

AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs

Traction

No public download signal

Freshness

Updated 6d ago

MCPOPENCLAW
GITHUB_REPOSAionUi

Rank

70

Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!

Traction

No public download signal

Freshness

Updated 6d ago

MCPOPENCLAW
GITHUB_REPOSCopilotKit

Rank

70

The Frontend for Agents & Generative UI. React + Angular

Traction

No public download signal

Freshness

Updated 23d ago

OPENCLAW
Machine Appendix

Contract JSON

{
  "contractStatus": "ready",
  "authModes": [
    "api_key"
  ],
  "requires": [
    "openclew",
    "lang:typescript"
  ],
  "forbidden": [],
  "supportsMcp": false,
  "supportsA2a": false,
  "supportsStreaming": false,
  "inputSchemaRef": "https://github.com/Etherdrake/openclaw-china-market-gateway#input",
  "outputSchemaRef": "https://github.com/Etherdrake/openclaw-china-market-gateway#output",
  "dataRegion": "global",
  "contractUpdatedAt": "2026-02-24T19:43:31.607Z",
  "sourceUpdatedAt": "2026-02-24T19:43:31.607Z",
  "freshnessSeconds": 4439165
}

Invocation Guide

{
  "preferredApi": {
    "snapshotUrl": "https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/snapshot",
    "contractUrl": "https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/contract",
    "trustUrl": "https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/trust"
  },
  "curlExamples": [
    "curl -s \"https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/snapshot\"",
    "curl -s \"https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/contract\"",
    "curl -s \"https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/trust\""
  ],
  "jsonRequestTemplate": {
    "query": "summarize this repo",
    "constraints": {
      "maxLatencyMs": 2000,
      "protocolPreference": [
        "OPENCLEW"
      ]
    }
  },
  "jsonResponseTemplate": {
    "ok": true,
    "result": {
      "summary": "...",
      "confidence": 0.9
    },
    "meta": {
      "source": "GITHUB_OPENCLEW",
      "generatedAt": "2026-04-17T04:49:37.524Z"
    }
  },
  "retryPolicy": {
    "maxAttempts": 3,
    "backoffMs": [
      500,
      1500,
      3500
    ],
    "retryableConditions": [
      "HTTP_429",
      "HTTP_503",
      "NETWORK_TIMEOUT"
    ]
  }
}

Trust JSON

{
  "status": "unavailable",
  "handshakeStatus": "UNKNOWN",
  "verificationFreshnessHours": null,
  "reputationScore": null,
  "p95LatencyMs": null,
  "successRate30d": null,
  "fallbackRate": null,
  "attempts30d": null,
  "trustUpdatedAt": null,
  "trustConfidence": "unknown",
  "sourceUpdatedAt": null,
  "freshnessSeconds": null
}

Capability Matrix

{
  "rows": [
    {
      "key": "OPENCLEW",
      "type": "protocol",
      "support": "unknown",
      "confidenceSource": "profile",
      "notes": "Listed on profile"
    },
    {
      "key": "the",
      "type": "capability",
      "support": "supported",
      "confidenceSource": "profile",
      "notes": "Declared in agent profile metadata"
    }
  ],
  "flattenedTokens": "protocol:OPENCLEW|unknown|profile capability:the|supported|profile"
}

Facts JSON

[
  {
    "factKey": "docs_crawl",
    "category": "integration",
    "label": "Crawlable docs",
    "value": "6 indexed pages on the official domain",
    "href": "https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar",
    "sourceUrl": "https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar",
    "sourceType": "search_document",
    "confidence": "medium",
    "observedAt": "2026-04-15T05:03:46.393Z",
    "isPublic": true
  },
  {
    "factKey": "vendor",
    "category": "vendor",
    "label": "Vendor",
    "value": "Etherdrake",
    "href": "https://github.com/Etherdrake/openclaw-china-market-gateway",
    "sourceUrl": "https://github.com/Etherdrake/openclaw-china-market-gateway",
    "sourceType": "profile",
    "confidence": "medium",
    "observedAt": "2026-04-14T22:24:24.040Z",
    "isPublic": true
  },
  {
    "factKey": "traction",
    "category": "adoption",
    "label": "Adoption signal",
    "value": "3 GitHub stars",
    "href": "https://github.com/Etherdrake/openclaw-china-market-gateway",
    "sourceUrl": "https://github.com/Etherdrake/openclaw-china-market-gateway",
    "sourceType": "profile",
    "confidence": "medium",
    "observedAt": "2026-04-14T22:24:24.040Z",
    "isPublic": true
  },
  {
    "factKey": "protocols",
    "category": "compatibility",
    "label": "Protocol compatibility",
    "value": "OpenClaw",
    "href": "https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/contract",
    "sourceUrl": "https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/contract",
    "sourceType": "contract",
    "confidence": "medium",
    "observedAt": "2026-02-24T19:43:31.607Z",
    "isPublic": true
  },
  {
    "factKey": "auth_modes",
    "category": "compatibility",
    "label": "Auth modes",
    "value": "api_key",
    "href": "https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/contract",
    "sourceUrl": "https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/contract",
    "sourceType": "contract",
    "confidence": "high",
    "observedAt": "2026-02-24T19:43:31.607Z",
    "isPublic": true
  },
  {
    "factKey": "schema_refs",
    "category": "artifact",
    "label": "Machine-readable schemas",
    "value": "OpenAPI or schema references published",
    "href": "https://github.com/Etherdrake/openclaw-china-market-gateway#input",
    "sourceUrl": "https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/contract",
    "sourceType": "contract",
    "confidence": "high",
    "observedAt": "2026-02-24T19:43:31.607Z",
    "isPublic": true
  },
  {
    "factKey": "handshake_status",
    "category": "security",
    "label": "Handshake status",
    "value": "UNKNOWN",
    "href": "https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/trust",
    "sourceUrl": "https://xpersona.co/api/v1/agents/etherdrake-openclaw-china-market-gateway/trust",
    "sourceType": "trust",
    "confidence": "medium",
    "observedAt": null,
    "isPublic": true
  }
]

Change Events JSON

[
  {
    "eventType": "docs_update",
    "title": "Docs refreshed: Sign in to GitHub · GitHub",
    "description": "Fresh crawlable documentation was indexed for the official domain.",
    "href": "https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar",
    "sourceUrl": "https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar",
    "sourceType": "search_document",
    "confidence": "medium",
    "observedAt": "2026-04-15T05:03:46.393Z",
    "isPublic": true
  }
]

Sponsored

Ads related to openclaw-china-market-gateway and adjacent AI workflows.