# Tushare Query

> Use when setting up tushare-cli token, choosing output formats, or getting an overview of available A-share market data query skills

- Skill: `oopslink/tushare-query` (Agent Skill)
- Install (CLI): `npx skillmds@latest add oopslink/tushare-query`
- Raw SKILL.md: https://api.skillmd.com/api/skills/oopslink/tushare-query/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: oopslink (https://skillmd.com/u/oopslink)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/oopslink/tushare-query

---


# tushare-query: Setup & Overview

## Token Setup

```bash
tushare-cli config set-token <YOUR_TOKEN>
# or: export TUSHARE_TOKEN=<token>
```

## Common Flags

| Flag | Effect |
|------|--------|
| `--format json` | JSON output (pipe to `jq`) |
| `--format csv` | CSV output (redirect to file) |
| `--cache` | Cache result within session |

## Format Tips

- Date: always `YYYYMMDD` (e.g., `20240201`)
- ts_code: `XXXXXX.SZ` Shenzhen · `XXXXXX.SH` Shanghai · `XXXXXX.SI` Shenwan index
- Best combo: `--format json | jq 'sort_by(-.pct_chg) | .[:10]'`

## Skills by Domain

| Domain | Skill |
|--------|-------|
| Individual stocks, ETF, capital flow | `tushare-stock` |
| Shenwan index, sector constituents | `tushare-index` |
| Concept boards, volume anomaly | `tushare-concepts` |
| Sector rotation & ranking | `tushare-alpha` |
| Financial statements | `tushare-financial` |
| Futures contracts & holdings | `tushare-futures` |
| Forex rates | `tushare-forex` |

