Skip to main content

Twelve Data Market API

Type: twelve_data • Category: flow • Tags: markets, stocks, crypto, forex, indicators, ohlc, twelvedata

Description

Twelve Data provides access to over 100,000 financial symbols from various markets, including stocks, forex, cryptocurrencies, ETFs, and commodities. This allows you to obtain data from more than 250 exchanges worldwide.

Parameters

NameTypeDescriptionRequiredDefault
api_keystringKey API can be obtained at twelvedata.com, avaliable free key with limited access.no
cachebooleanEnable caching of API responses in Redis to reduce API calls frequencynofalse
cache_timenumberCache expiration time in seconds (60s - 24h). Default: 300s (5 minutes)no300
operation_groupstringGroup of operations to select fromno"core"
core_operationstringCore operationsno"time_series"
company_operationstringCompany data operationsno"profile"
financials_operationstringFinancial statements and statsno"statistics"
calendars_operationstringMarket calendarsno"dividends_calendar"
etfs_operationstringETFs endpointsno"etfs_list"
mutual_funds_operationstringMutual funds endpointsno"mutual_funds_list"
analyst_operationstringAnalyst and estimates endpointsno"earnings_estimate"
utility_operationstringUtility endpointsno"last_change"
operationhiddenno
symbolautocompleteSymbol or comma-separated symbols (e.g., AAPL,MSFT or BTC/USD)no
intervalstringData intervalno"1day"
outputsizenumberNumber of data points, max 5000no100
start_datedateStart date (YYYY-MM-DD or ISO datetime)no
end_datedateEnd date (YYYY-MM-DD or ISO datetime)no
timezonestringTimezone, e.g., America/New_Yorkno
orderstringSort orderno
countrystringCountry filterno
limitnumberLimit rows where supportedno
periodstringPeriod for fundamentals (e.g., annual|quarterly|ttm)no
regionstringRegion filterno
currencystringCurrency filter (e.g., USD, EUR)no
familystringFamily filter for ETFs and mutual fundsno
etf_typestringETF type filterno
mf_typestringMutual fund type filterno
indicatorstringno
second_symbolautocompleteSecond symbol (for pairwise indicators like beta, correl)no
time_periodnumberno
series_typestringno
fastperiodnumberno
slowperiodnumberno
signalperiodnumberno
exchangestringno
typestringno
targetstringEndpoint name to query last_change for (e.g., price, quote)no

Help

Overview

Twelve Data offers programmatic access to more than.100,000 financial symbols across a wide range of asset classes—stocks, forex, cryptocurrencies, ETFs, and commodities. The service aggregates data from over 250 exchanges worldwide, enabling you to retrieve price histories, corporate fundamentals, earnings information, and option‑related metrics through a single, consistent API. The worker described below acts as a thin wrapper around the official twelvedata Python client. By supplying a small set of parameters you can request any of the supported data types (price series, company profile, dividends, splits, earnings, etc.) and receive the result as JSON ready for downstream analysis.

Connect to Twelve Data API for market data: time series, quotes, and technical indicators.

Available operations:

  • time_series: Historical/intraday OHLCV for one or multiple symbols
  • quote: Realtime quote snapshot
  • price: Realtime price only
  • indicator: Technical indicators (sma, ema, rsi, macd, bbands)
  • indicator: Technical indicators (sma, ema, rsi, macd, bbands, beta, correl, linearreg, linearregangle, linearregintercept, linearregslope, max, maxindex, min, minindex, stddev, tsf, var)
  • symbol_search: Find tradable symbols by query
  • exchanges: List supported exchanges
  • profile: Company profile
  • fundamentals: Fundamental data snapshot
  • dividends: Historical dividends
  • splits: Stock splits
  • earnings: Earnings calendar/history
  • logo: Company logo URL
  • dividends_calendar: Upcoming/past dividend events
  • splits_calendar: Upcoming/past split events
  • earnings_calendar: Upcoming/past earnings events
  • ipo_calendar: Upcoming/past IPOs
  • market_cap: Current market capitalization
  • statistics: Key statistics
  • statistics: Key statistics
  • earnings_estimate: Analyst earnings estimates
  • revenue_estimate: Analyst revenue estimates
  • eps_trend: EPS trend
  • eps_revisions: EPS revisions
  • growth_estimates: Growth estimates
  • recommendations: Analyst recommendations
  • price_target: Price target
  • analyst_ratings_light: Analyst ratings (light)
  • analyst_ratings_us_equities: Analyst ratings (US equities)
  • income_statement: Income statement
  • income_statement_consolidated: Consolidated income statement
  • balance_sheet: Balance sheet
  • balance_sheet_consolidated: Consolidated balance sheet
  • cash_flow: Cash flow statement
  • cash_flow_consolidated: Consolidated cash flow statement
  • etfs_list: List ETFs
  • etfs_world: Global ETFs overview
  • etfs_world_summary: Regional/sector summary
  • etfs_world_performance: Performance metrics
  • etfs_world_risk: Risk metrics
  • etfs_world_composition: Composition breakdown
  • etfs_family: ETFs by family
  • etfs_type: ETFs by type
  • mutual_funds_list: List mutual funds
  • mutual_funds_world: Global mutual funds overview
  • mutual_funds_world_summary: Regional/sector summary
  • mutual_funds_world_performance: Performance metrics
  • mutual_funds_world_risk: Risk metrics
  • mutual_funds_world_ratings: Ratings overview
  • mutual_funds_world_composition: Composition breakdown
  • mutual_funds_world_purchase_info: Purchase info
  • mutual_funds_world_sustainability: Sustainability metrics
  • mutual_funds_family: Mutual funds by family
  • mutual_funds_type: Mutual funds by type

Common parameters:

  • api_key: Twelve Data API key (or set TWELVE_DATA_API_KEY env)
  • operation: One of [time_series, quote, price, indicator, symbol_search, exchanges]

Time Series:

  • symbol: Single or comma-separated symbols, e.g. AAPL,MSFT or BTC/USD,EUR/USD
  • interval: 1min,5min,15min,30min,45min,1h,2h,4h,1day,1week,1month
  • outputsize: Number of data points to return (default 100)
  • start_date/end_date: Optional date range filters (YYYY-MM-DD or ISO datetime)
  • timezone: E.g. America/New_York
  • order: asc or desc

Indicators:

  • indicator: sma|ema|rsi|macd|bbands
  • symbol, interval required
  • time_period (e.g. 14), series_type (open|high|low|close)
  • macd params: fastperiod, slowperiod, signalperiod

Examples:

  1. Get daily OHLC for AAPL last 200 bars { "operation": "time_series", "symbol": "AAPL", "interval": "1day", "outputsize": 200 }

  2. Get 15min OHLC for BTC/USD { "operation": "time_series", "symbol": "BTC/USD", "interval": "15min", "outputsize": 300 }

  3. Realtime price for MSFT { "operation": "price", "symbol": "MSFT" }

  4. RSI(14) for AAPL daily { "operation": "indicator", "indicator": "rsi", "symbol": "AAPL", "interval": "1day", "time_period": 14, "series_type": "close" }

  5. Search symbols "tesla" { "operation": "symbol_search", "symbol": "tesla" }

Notes:

  • Free plans have request limits; consider adding brief delays in workflows
  • Crypto and forex symbols are supported (e.g., BTC/USD, EUR/USD)
  • Some indicators require specific params; see Twelve Data docs for details