thsdk-stock

Fetch realtime quotes, intraday data, and historical K-lines from thsdk.

2|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/hiyenwong/ai_collection --skill thsdk-stock
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: thsdk-stock
Source: https://github.com/hiyenwong/ai_collection/tree/main/collection/skills/thsdk-stock
Command: npx skills add https://github.com/hiyenwong/ai_collection --skill thsdk-stock

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires thsdk, and includes scripts (resource) components.

What problem does it solve?

Fetch stock market data from thsdk to provide realtime quotes, intraday data, and historical K-lines.

Core Features & Use Cases

  • Real-time quotes and depth data for fast market insight.
  • Intraday data streams and historical K-lines for backtesting and analysis.
  • Cross-market coverage (A-shares, HK/US stocks, futures, forex) with optional mock mode for offline validation.

Quick Start

Install the thsdk package in a virtual environment and run the example_usage.py script to fetch sample realtime and historical data.

Frequently Asked Questions about thsdk-stock

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fetch real-time stock quotes and historical K-lines for backtesting?

You can fetch real-time stock quotes and historical K-lines by installing the thsdk package in a virtual environment and running the example_usage.py script to retrieve JSON-serializable market data records.

Does thsdk support market data for A-shares, HK stocks, US stocks, futures, and forex?

Yes, thsdk supports cross-market coverage for A-shares, HK/US stocks, futures, and forex, providing realtime quotes, intraday data streams, and historical K-lines for financial analysis and trading research.

Can I validate stock data fetching offline without a live THS client connection?

Yes, you can validate stock data fetching offline using the optional mock mode, which returns JSON-serializable structures including code, mode, records, and extra without requiring the live THS client.

What Python version is required to use thsdk for stock market data retrieval?

thsdk requires Python 3.9 or higher to fetch stock market data, utilizing the THS client when available for realtime quotes, intraday data, and historical K-lines across multiple markets.

What is the best way to get intraday data streams for trading research across multiple markets?

The best way to get intraday data streams is using thsdk, which provides cross-market coverage and returns JSON-serializable structures suitable for trading research and portfolio monitoring across global markets.

What limitations should I expect when using thsdk for historical K-line data retrieval?

thsdk relies on the THS client when available for historical K-line data retrieval, but offers an optional mock mode for offline validation, returning JSON-serializable structures with code, mode, records, and extra fields.