tushare
Fetch Chinese stock and futures market data via Tushare API. Supports stock quotes, futures data, company fundamentals, and macroeconomic indicators. Use when the user needs financial data from Chinese markets. Requires TUSHARE_TOKEN environment variable.
Why use this skill?
Fetch real-time and historical Chinese stock and futures data, plus company fundamentals and economic indicators. Essential for China market financial analysis.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/wdblink/tushare-baseWhat This Skill Does
The Tushare skill provides access to comprehensive financial data for the Chinese stock and futures markets. It leverages the Tushare API to fetch a wide range of information, including stock quotes (daily, weekly, monthly, real-time), futures data (contract basics, daily quotes, holding rankings), company fundamentals, and macroeconomic indicators like GDP and CPI. This skill is ideal for users seeking detailed financial insights into China's markets.
Installation
To install this skill, run the following command:
clawhub install openclaw/skills/skills/wdblink/tushare-base
Before using the Tushare skill, you must have a Tushare API token. You can obtain one by registering on the Tushare website. Once you have your token, configure it by setting the TUSHARE_TOKEN environment variable in your shell configuration file (e.g., ~/.zshrc) and then reloading your shell:
export TUSHARE_TOKEN="your-api-token-here"
source ~/.zshrc
Additionally, ensure you have the necessary Python libraries installed:
pip3 install tushare pandas --user
Use Cases
This skill is designed for a variety of financial data retrieval tasks related to the Chinese market:
- Stock Market Analysis: Fetch historical daily, weekly, and monthly stock prices, as well as real-time quotes for specific A-share stocks.
- Futures Market Monitoring: Retrieve information on futures contracts, including their basic details, daily price movements, and holding rankings.
- Company Research: Access fundamental company information to aid in investment decisions.
- Macroeconomic Trend Tracking: Obtain key economic indicators such as GDP and CPI data to understand broader economic conditions.
- Data-Driven Investment Strategies: Integrate Chinese market data into quantitative analysis or trading algorithms.
Example Prompts
- "Show me the daily stock prices for 000001.SZ from January 1st, 2024, to January 31st, 2024."
- "What are the basic details for futures contracts traded on the SHFE exchange?"
- "Fetch the CPI data for China."
Tips & Limitations
- Stock Code Format: Be precise with stock codes. For Shenzhen Stock Exchange (SZSE), use formats like
000001.SZor300001.SZ. For Shanghai Stock Exchange (SSE), use600000.SHor688001.SH. - Futures Code Format: Futures codes require specific formatting, such as
CU.SHFfor copper futures orIF.CFXfor CSI 300 index futures. - API Token: The
TUSHARE_TOKENenvironment variable is mandatory for all operations. Ensure it's correctly set and sourced. - Data Lag: Real-time data might have a slight delay depending on the Tushare API's update frequency and your subscription level.
- Rate Limiting: Be mindful of Tushare API's rate limits, especially when making frequent or large data requests. Consider batching requests where possible.
- Data Availability: Not all data points might be available for all dates or all instruments. Refer to Tushare's official documentation for detailed information on data coverage.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-wdblink-tushare-base": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: external-api, code-execution, network-access