Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
starchild-ai-agent avatar

Twelvedata

  • 7.6k installs
  • 18 repo stars
  • Updated July 27, 2026
  • starchild-ai-agent/official-skills

twelvedata is a script-mode agent skill for stocks, forex, and commodities quotes and historical bars via Twelve Data.

About

The twelvedata skill provides traditional market price data for stocks, forex, and commodities through script-mode Python exports backed by Twelve Data. It is explicitly not for crypto prices. TWELVEDATA_API_KEY is required in the environment for API access. Functions in exports.py include twelvedata_price, twelvedata_quote, and twelvedata_time_series invoked from bash Python blocks with sys.path pointed at the skill directory. Use cases cover AAPL quotes, EUR/USD charts, gold prices, and SPY historical bars. The skill ships as a single exports module with standardized proxied HTTP patterns consistent with other Starchild script-mode skills. Agents import functions directly rather than constructing raw REST calls. Use when users ask for stock quotes, forex rates, commodity prices, or historical traditional market bars excluding cryptocurrency pairs.

  • Stocks, forex, and commodities data via Twelve Data API.
  • Script-mode exports.py with price, quote, and time_series functions.
  • Traditional markets only, explicitly not for crypto.
  • TWELVEDATA_API_KEY environment requirement.
  • Bash Python invocation pattern with sys.path skill directory.

Twelvedata by the numbers

  • 7,553 all-time installs (skills.sh)
  • +63 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #11 of 1,136 Finance & Trading skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

twelvedata capabilities & compatibility

Capabilities
real time quote retrieval · historical time series bars · stock forex commodity symbol lookup · script mode python export functions
Use cases
trading · research · data analysis
Pricing
Bring your own API key
From the docs

What twelvedata says it does

Stocks, forex, and commodities prices: real-time quotes and historical bars.
SKILL.md
Traditional markets only — not for crypto.
SKILL.md
npx skills add https://github.com/starchild-ai-agent/official-skills --skill twelvedata

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs7.6k
repo stars18
Security audit3 / 3 scanners passed
Last updatedJuly 27, 2026
Repositorystarchild-ai-agent/official-skills

How do I look up AAPL, EUR/USD, or gold prices with historical bars from an agent script?

Fetch stocks, forex, and commodities real-time quotes and historical bars via Twelve Data script-mode exports.

Who is it for?

Developers fetching traditional market prices and historical bars, not cryptocurrency data.

Skip if: Skip for crypto token prices; this skill covers traditional markets only.

When should I use this skill?

User asks for stock quote, forex rate, commodity price, or SPY historical chart data.

What you get

Structured quote or time series data from Twelve Data for traditional market symbols.

  • registered market-data tools
  • quote and time-series responses

Files

SKILL.mdMarkdownGitHub ↗

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:

python3 - <<'EOF'
import sys, json
sys.path.insert(0, "/data/workspace/skills/twelvedata")
from exports import twelvedata_price, twelvedata_quote, twelvedata_time_series

# Single quote
print(twelvedata_quote(symbol="AAPL"))

# Time series (last 30 daily candles)
series = twelvedata_time_series(symbol="AAPL", interval="1day", outputsize=30)
print(json.dumps(series.get("values", [])[:3], indent=2))
EOF

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.

FunctionDescription
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 aboutToolNOT this
"AAPL 股价", "current price" (single)twelvedata_quoteNot twelvedata_price (less detail)
"just the price number"twelvedata_price
"多只股票对比" (2+ symbols)twelvedata_quote_batchNot 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 cryptoCoinGecko coin_price❌ Never twelvedata for crypto

TwelveData vs CoinGecko — Boundary

Asset classUseWhy
Stocks (AAPL, TSLA)TwelveDataCoinGecko has no stocks
Forex (EUR/USD)TwelveDataCoinGecko has no forex
Commodities (gold, oil)TwelveDataCoinGecko has no commodities
Crypto (BTC, ETH, SOL)CoinGeckoTwelveData crypto data is limited/unreliable

MISTAKES — Read Before Calling

❌ MISTAKE 1: Using TwelveData for crypto

User: "BTC 价格"
❌ WRONG: twelvedata_quote(symbol="BTC/USD")
✅ RIGHT: coin_price(ids="bitcoin")  ← CoinGecko

❌ MISTAKE 2: Calling quote individually for multiple stocks

User: "AAPL MSFT GOOGL 现在什么价"
❌ WRONG: twelvedata_quote("AAPL"), twelvedata_quote("MSFT"), twelvedata_quote("GOOGL")  ← 3 calls
✅ RIGHT: twelvedata_quote_batch(symbols=["AAPL", "MSFT", "GOOGL"])  ← 1 call, up to 120 symbols

❌ MISTAKE 3: Forex without slash

❌ WRONG: twelvedata_quote(symbol="EURUSD")
✅ RIGHT: twelvedata_quote(symbol="EUR/USD")  ← always slash format

Also: USD/CNH not USDCNH, GBP/JPY not GBPJPY.

❌ MISTAKE 4: Expecting bid/ask from quote

❌ WRONG: "EUR/USD bid: 1.0850, ask: 1.0852"  ← quote only returns close
✅ RIGHT: "EUR/USD current price: 1.0851 (close/last price — bid/ask spread not available)"

❌ MISTAKE 5: Wrong interval format

❌ WRONG: twelvedata_time_series(interval="1D")  ← uppercase
✅ RIGHT: twelvedata_time_series(interval="1day")

Valid: 1min, 5min, 15min, 30min, 1h, 2h, 4h, 8h, 1day, 1week, 1month

❌ MISTAKE 6: Using full output when compact suffices

User: "AAPL 最近走势"
❌ WRONG: twelvedata_time_series(symbol="AAPL", interval="1day", outputsize="full")  ← 5000 candles
✅ RIGHT: twelvedata_time_series(symbol="AAPL", interval="1day", outputsize="compact")  ← 30 candles

Use full only when user explicitly needs deep history.

Symbol Reference

Commodities (verified)

AssetSymbol
GoldXAU/USD
SilverXAG/USD
PlatinumXPT/USD
PalladiumXPD/USD
Crude Oil (WTI)WTI/USD
Natural GasNG/USD

Popular Forex Pairs

PairSymbol
Euro / USDEUR/USD
GBP / USDGBP/USD
USD / JPYUSD/JPY
USD / CNHUSD/CNH

Use twelvedata_search to discover others.

Pre/Post-Market Data

twelvedata_quote(symbol="AAPL", prepost=true)
twelvedata_time_series(symbol="AAPL", interval="1min", prepost=true)

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

1. twelvedata_quote_batch(symbols=["AAPL", "MSFT", "GOOGL", "TSLA"])
2. twelvedata_time_series(symbol="AAPL", interval="1day", outputsize="compact")  ← only for the one user cares most about

Macro Dashboard (stocks + forex + commodities)

1. twelvedata_quote_batch(symbols=["SPY", "QQQ"])          → US indices
2. twelvedata_quote_batch(symbols=["EUR/USD", "USD/JPY"])   → Forex
3. twelvedata_quote(symbol="XAU/USD")                       → Gold

Related skills

FAQ

What data does the Twelve Data skill provide?

The Twelve Data skill exposes real-time stock and forex quotes, historical OHLCV time series, reference data for stocks, forex pairs, and exchanges, plus symbol search. Pre- and post-market quote support is included for equities.

What API key does Twelve Data require?

The Twelve Data extension requires a `TWELVEDATA_API_KEY` environment variable tied to a Twelve Data Pro API key. The Python `register(api)` entry point loads tools from a local `tools` directory after the key is set.

Is Twelvedata safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.