Quick Start
TickerLab Documentation
Professional stock market data API service, providing K-line chart generation, technical indicators, and real-time market data.
Basic Information
| Item | Description |
|---|---|
| Base URL | https://tickerlab.org |
| Authentication | API Key (Header or Query parameter) |
| Data Format | JSON |
| Protocol | HTTPS |
Authentication
All API requests require an API Key:
# Method 1: Header Authentication (Recommended)
curl -H "X-API-Key: your_api_key" https://tickerlab.org/v1/indicators/time_series?symbol=000001.SZ
# Method 2: Query Parameter
curl "https://tickerlab.org/v1/indicators/query?apikey=your_api_key&symbol=000001.SZ&function=SMA"
Quick Start
Python
import requests
API_KEY = "your_api_key"
BASE_URL = "https://tickerlab.org"
# Get time series data
response = requests.get(
f"{BASE_URL}/v1/indicators/time_series",
params={"symbol": "000001.SZ", "interval": "1d"},
headers={"X-API-Key": API_KEY}
)
data = response.json()
print(data["values"][:5]) # Latest 5 records
JavaScript
const API_KEY = 'your_api_key';
const BASE_URL = 'https://tickerlab.org';
// Get time series data
const response = await fetch(
`${BASE_URL}/v1/indicators/time_series?symbol=000001.SZ&interval=1d`,
{ headers: { 'X-API-Key': API_KEY } }
);
const data = await response.json();
console.log(data.values.slice(0, 5));
cURL
curl -G "https://tickerlab.org/v1/indicators/time_series" \
-H "X-API-Key: your_api_key" \
-d "symbol=000001.SZ" \
-d "interval=1d"
API Endpoints Overview
K-Line Data
Historical candlestick data with multiple intervals. This is the main entrypoint for time-series analysis.
| Method | Endpoint |
|---|---|
| GET | /v1/indicators/time_series |
- Best for: OHLCV time series, backtesting, and charting feeds
- Common params:
symbol,interval,start_date,end_date,outputsize
Example:
curl -G "https://tickerlab.org/v1/indicators/time_series" \
-H "X-API-Key: your_key" \
-d "symbol=000001.SZ" \
-d "interval=1d"
Real-time Quote
Latest bid/ask/last for a single symbol.
| Method | Endpoint |
|---|---|
| GET | /v1/market/quote |
- Best for: quotes in dashboards and trading screens
Example:
curl -H "X-API-Key: your_key" "https://tickerlab.org/v1/market/quote?symbol=000001.SZ"
Historical Market Data (Export)
Export-friendly historical data for batch or CSV/JSON download.
| Method | Endpoint |
|---|---|
| GET | /v1/market/history |
- Best for: bulk history, CSV/JSON export
Example:
curl -H "X-API-Key: your_key" \
"https://tickerlab.org/v1/market/history?symbol=BTCUSDT&interval=1d&start_date=2023-01-01"
Batch Charting
Generate static charts for multiple symbols in a single request.
| Method | Endpoint |
|---|---|
| POST | /v1/market/chart/batch |
- Best for: batch PNG generation, reporting
Example:
curl -X POST "https://tickerlab.org/v1/market/chart/batch" \
-H "X-API-Key: your_key" \
-H "Content-Type: application/json" \
-d '[
{"symbol": "000001.SZ", "interval": "1d", "studies": [{"name": "MACD"}]},
{"symbol": "BTCUSDT", "interval": "4h", "studies": [{"name": "RSI"}]}
]'
Technical Indicators
All indicators support symbol, interval, start_date, end_date parameters.
| Endpoint | Description | Specific Parameters |
|---|---|---|
/v1/market/vwap | VWAP | - |
/v1/indicators/bbands | Bollinger Bands | timeperiod (default 20), nbdevup (2) |
/v1/indicators/macd | MACD | fastperiod (12), slowperiod (26), signalperiod (9) |
/v1/indicators/rsi | RSI | timeperiod (14) |
/v1/market/stoch | Stochastic | fastk_period (14), slowk_period (3) |
/v1/market/atr | ATR | timeperiod (14) |
/v1/market/obv | OBV | - |
/v1/market/adx | ADX | timeperiod (14) |
Error Handling
All API errors return a standardized JSON format:
{
"error": {
"code": "ERROR_CODE",
"message": "Human readable error description",
"request_id": "abc123-uuid"
}
}
Error Codes
| Code | HTTP Status | Description |
|---|---|---|
BAD_REQUEST | 400 | Invalid request parameters |
UNAUTHORIZED | 401 | Invalid or missing API Key |
FORBIDDEN | 403 | Access denied |
NOT_FOUND | 404 | Resource not found |
VALIDATION_ERROR | 422 | Request body validation failed |
RATE_LIMIT_EXCEEDED | 429 | Rate limit exceeded |
GEO_RESTRICTED | 451 | Region restricted (e.g. some crypto) |
INTERNAL_ERROR | 500 | Internal server error |
Rate Limits
| Plan | Requests/minute | Requests/hour |
|---|---|---|
| Free | 10 | 100 |
| Pro | 60 | 1000 |
| Enterprise | 300 | 10000 |