API Reference
API Documentation
A-share stock market data service for AI agents. Access market indicators, real-time quotes, historical K-line data, and simulated trading.
Quick Start
1Register
POST
/api/v1/agent-data/registercurl -X POST https://taktiko.ai/api/v1/agent-data/register \
-H "Content-Type: application/json" \
-d '{"name": "YourAgentName", "description": "What you do"}'Response:
{
"code": 200,
"data": {
"api_key": "sk_xxx...",
"agent_name": "YourAgentName",
"rate_limit": 5,
"trade_account_id": "agent_xxx",
"initial_balance": 1000000
}
}- Save your api_key. A simulated trading account with 1,000,000 CNY is automatically created.
2Authenticate
All requests (except /register) require the API key:
Authorization: Bearer sk_xxx...3Rate Limits
20
requests/min
429
on exceeded
Retry-After
header
Endpoints
Profile
GET
/api/v1/agent-data/meGet your agent profile and account summary
curl https://taktiko.ai/api/v1/agent-data/me \
-H "Authorization: Bearer sk_xxx"Market Indicators
Pre-computed market analysis data. Each tag represents a different indicator dataset.
List Available Indicators
GET
/api/v1/agent-data/tagscurl https://taktiko.ai/api/v1/agent-data/tags \
-H "Authorization: Bearer sk_xxx"Fetch Indicator Data
GET
/api/v1/agent-data/data/{tag_name}# Realtime data
curl https://taktiko.ai/api/v1/agent-data/data/{tag_name} \
-H "Authorization: Bearer sk_xxx"
# Historical data at specific date/time
curl "https://taktiko.ai/api/v1/agent-data/data/{tag_name}?date=2026-02-20&time=09:35" \
-H "Authorization: Bearer sk_xxx"- date (YYYY-MM-DD) — target date
- time (HH:MM) — target time
- format — raw, formatted, or both (default)
Common Indicators
| tag_name | Description |
|---|---|
| mainstream_sentiment_realtime_data | Market sentiment (stocks, sectors, trends) |
| limit_up_realtime_data | Limit-up stocks |
| limit_up_with_bar_realtime_data | Limit-up with K-line and indicators |
| kpl_sector_realtime_data | Sector ranking Top 20 |
| strength_stock_data | Strong stocks (limit-up, top gainers) |
| stock_limit_up_content | Daily limit-up analysis report |
| market_state_data | Market state (bull/bear/oscillation) |
Stock Data
Single Stock Quote
GET
/api/v1/agent-data/stock/{stock_code}/quotecurl https://taktiko.ai/api/v1/agent-data/stock/000001.SZ/quote \
-H "Authorization: Bearer sk_xxx"- Returns: price, open, high, low, volume, amount, 5-level bid/ask
Batch Quotes
POST
/api/v1/agent-data/stock/quotescurl -X POST https://taktiko.ai/api/v1/agent-data/stock/quotes \
-H "Authorization: Bearer sk_xxx" \
-H "Content-Type: application/json" \
-d '{"stock_codes": ["000001.SZ", "600519.SH", "300750.SZ"]}'- Max 50 stocks per request
K-line Bars
GET
/api/v1/agent-data/stock/{stock_code}/bars# Current 1-min bars (last 60)
curl "https://taktiko.ai/api/v1/agent-data/stock/000001.SZ/bars?frequency=7&offset=60" \
-H "Authorization: Bearer sk_xxx"
# Daily K-line
curl "https://taktiko.ai/api/v1/agent-data/stock/000001.SZ/bars?frequency=4&offset=20" \
-H "Authorization: Bearer sk_xxx"Frequency Values
7 = 1-min0 = 5-min1 = 15-min4 = dailyStock Code Format
000001.SZ = Shenzhen600519.SH = ShanghaiTrading Calendar
Query A-share trading dates. One endpoint, three modes.
GET
/api/v1/agent-data/calendar# Mode 1: Current info (today, previous, next trading date)
curl https://taktiko.ai/api/v1/agent-data/calendar \
-H "Authorization: Bearer sk_xxx"
# Mode 2: Last N trading days
curl "https://taktiko.ai/api/v1/agent-data/calendar?days=20" \
-H "Authorization: Bearer sk_xxx"
# Mode 3: Date range
curl "https://taktiko.ai/api/v1/agent-data/calendar?start_date=2026-01-01&end_date=2026-01-31" \
-H "Authorization: Bearer sk_xxx"Simulated Trading
Trade with your auto-created account (1,000,000 CNY initial balance).
Submit Orders
POST
/api/v1/agent-data/trade/orderscurl -X POST https://taktiko.ai/api/v1/agent-data/trade/orders \
-H "Authorization: Bearer sk_xxx" \
-H "Content-Type: application/json" \
-d '{
"orders": [
{"action": "sell", "stock_code": "600519.SH", "quantity": 100},
{"action": "buy", "stock_code": "000001.SZ", "quantity": 300}
]
}'Trading Rules
- No price field — market price is auto-resolved
- T+1: cannot sell stocks bought on the same day
- Each order succeeds or fails independently
- Max 20 orders per request
Account Info
curl https://taktiko.ai/api/v1/agent-data/trade/account \
-H "Authorization: Bearer sk_xxx"Positions
curl https://taktiko.ai/api/v1/agent-data/trade/positions \
-H "Authorization: Bearer sk_xxx"Trade History
curl https://taktiko.ai/api/v1/agent-data/trade/history \
-H "Authorization: Bearer sk_xxx"Error Handling
All errors follow this format:
{"detail": "Error description"}400Bad request (invalid parameters, insufficient funds)401Unauthorized (missing or invalid API key)404Not found (unknown tag_name, no account)429Rate limit exceeded500Internal server errorTips for AI Agents
Start with /tags to discover available market indicators
Use batch endpoints (POST /stock/quotes, POST /trade/orders) to minimize API calls under rate limiting
Sell before buy is handled automatically — include both in one /trade/orders request
Check positions before selling to avoid failed orders
Use format=formatted if you only need human-readable text analysis
Use format=raw if you want structured JSON data for programmatic analysis