twelvedata
Stocks, forex, and commodities prices: real-time quotes and historical bars. Use when looking up traditional-market prices (e.g. AAPL quote, EUR/USD chart, gold price, SPY history). Not for crypto.
By starchild-ai-agent · 7,710 installs
npx skills add starchild-ai-agent/official-skills --skill twelvedata
Source repository · Upstream listing
Twelve Data
Stocks, forex, and commodities price data. Traditional markets only — not for crypto.
Script Usage
This skill ships a single exports.py with all functions. Call it from a
bash block:
Available functions in exports.py : twelvedata price , twelvedata quote ,
twelvedata time series , twelvedata eod , twelvedata quote batch ,
twelvedata price batch , twelvedata search , twelvedata stocks ,
twelvedata forex pairs , twelvedata exchanges . Read exports.py
directly when you need exact signatures.
Function Reference (signatures)
All functions are in exports.py . Symbols use TwelveData format (e.g. AAPL ,
EUR/USD , XAU/USD ). Use prepost=True for pre/post market data on
US stocks.
Function Description
twelvedata price(symbol, prepost=False) Current price for one symbol.
twelvedata price batch(symbols, prepost=False) Prices for multiple symbols ( symbols = comma separated string).
twelvedata quote(symbol, prepost=False) Detailed quote: price, volume, 52w high/low, change %.
twelvedata quote batch(symbols, prepost=False) Detailed quotes for multiple symbols.
twelvedata time series(symbol, interval='1day', outputsize=30, start date=None, end date=None, prepost=False) OHLCV bars. interval = 1min / 5min / 15min / 30min / 1h / 2h / 4h / 1day / 1week / 1month .
twelvedata eod(symbol, date=None, prepost=False) End of day price for a date (default: latest).
twelvedata search(query) Search symbols by name or ticker.
twelvedata stocks(exchange=None, country=None) List supported stocks (filterable).
twelvedata forex pairs() List all supported forex pairs.
twelvedata exchanges() List supported exchanges.
Keyword → Tool Lookup
User asks about Tool NOT this
"AAPL 股价", "current price" (single) twelvedata quote Not twelvedata price (less detail)
"just the price number" twelvedata price —
"多只股票对比" (2+ symbols) twelvedata quote batch Not multiple twelvedata quote calls
"K线", "历史数据", "time series" twelvedata time series —
"收盘价" twelvedata eod —
"找股票代码" twelvedata search —
"NASDAQ 有哪些股票" twelvedata stocks —
"汇率", "EUR/USD" twelvedata quote(symbol="EUR/USD") —
"外汇对列表" twelvedata forex pairs —
"金价", "oil price" twelvedata quote(symbol="XAU/USD") Not CoinGecko
"BTC price", any crypto CoinGecko coin price ❌ Never twelvedata for crypto
TwelveData vs CoinGecko — Boundary
Asset class Use Why
Stocks (AAPL, TSLA) TwelveData CoinGecko has no stocks
Forex (EUR/USD) TwelveData CoinGecko has no forex
Commodities (gold, oil) TwelveData CoinGecko has no commodities
Crypto (BTC, ETH, SOL) CoinGecko TwelveData crypto data is limited/unreliable
MISTAKES — Read Before Calling
❌ MISTAKE 1: Using TwelveData for crypto
❌ MISTAKE 2: Calling quote individually for multiple stocks
❌ MISTAKE 3: Forex without slash
Also: USD/CNH not USDCNH , GBP/JPY not GBPJPY .
❌ MISTAKE 4: Expecting bid/ask from quote
❌ MISTAKE 5: Wrong interval format
Valid: 1min , 5min , 15min , 30min , 1h , 2h , 4h , 8h , 1day , 1week , 1month
❌ MISTAKE 6: Using full output when compact suffices
Use full only when user explicitly needs deep history.
Symbol Reference
Commodities (verified)
Asset Symbol
Gold XAU/USD
Silver XAG/USD
Platinum XPT/USD
Palladium XPD/USD
Crude Oil (WTI) WTI/USD
Natural Gas NG/USD
Popular Forex Pairs
Pair Symbol
Euro / USD EUR/USD
GBP / USD GBP/USD
USD / JPY USD/JPY
USD / CNH USD/CNH
Use twelvedata search to discover others.
Pre/Post Market Data
Returns premarket change , premarket change percent , postmarket change , postmarket change percent when available.
Output Sizes
compact — Last 30 data points (default, faster). Use for "最近走势".
full — Up to 5000 data points. Use for deep analysis / charting.
Proxy Safe Usage
1. Agent tool calls : Always prefer twelvedata tools (this skill).
2. Platform code ( skills/ , tools/ ): use core.http client .
3. Workspace scripts ( bash ): Do NOT call TwelveData directly. Use skill tools.
Compound Queries
Stock Comparison
Macro Dashboard (stocks + forex + commodities)