May 27, 2026

Twelve data API: financial data workflows in 2026

Reading time :  
7
 min
Rebecca Pearson
Rebecca Pearson

Twelve Data API: building financial data workflows

The Twelve Data API is a financial market data provider that gives you access to real-time and historical prices for stocks, forex, crypto, ETFs, and indices — plus 100+ technical indicators — through a single REST API. If you need market data in your application without negotiating enterprise contracts, Twelve Data is one of the most accessible options available.

The global algorithmic trading market reached $2.19 billion in 2024 according to Grand View Research, with projected growth of 12.9% annually through 2030. Meanwhile, Twelve Data's documentation lists coverage of 100,000+ instruments across 50+ exchanges. Whether you're building a portfolio tracker, a trading signal bot, or a research dashboard, the data layer matters more than the strategy layer.

Unlike generic AI automation posts, this guide shows real CodeWords workflows — not just theory.

Think of the Twelve Data API as a firehose with a precise nozzle. The data volume is massive, but the API's structure lets you extract exactly what you need.

TL;DR

  • Twelve Data provides real-time and historical market data for stocks, forex, crypto, and ETFs through a clean REST API with 100+ technical indicators built in.
  • The free tier includes 800 API calls per day and 8 per minute — enough for prototyping and personal projects.
  • CodeWords can automate financial data collection, analysis, and alerting workflows using Twelve Data, LLMs, and 500+ integrations.

How does the Twelve Data API work?

The API follows a straightforward REST pattern. You send GET requests with query parameters and receive JSON responses. No SDK is required, though official libraries exist for Python, JavaScript, and other languages.

Core endpoints:

  • /time_series — historical OHLCV data at any interval (1min to 1month)
  • /quote — latest price snapshot
  • /price — current price only (lightweight)
  • /technical_indicators/{indicator} — SMA, EMA, RSI, MACD, Bollinger Bands, and 100+ more
  • /stocks, /forex_pairs, /cryptocurrencies — instrument discovery

Basic example: fetch daily Apple stock data

import requests

params = {
    "symbol": "AAPL",
    "interval": "1day",
    "outputsize": 30,
    "apikey": "YOUR_API_KEY"
}

response = requests.get("https://api.twelvedata.com/time_series", params=params)
data = response.json()

for point in data["values"]:
    print(f"{point['datetime']}: close={point['close']}, volume={point['volume']}")

The response includes datetime, open, high, low, close, and volume for each data point. Clean. Predictable. No parsing gymnastics.

What data does Twelve Data cover?

Twelve Data's coverage is broad enough for most non-institutional use cases:

Asset classes: - US and international equities (NYSE, NASDAQ, LSE, TSE, and 50+ more exchanges) - Forex pairs (major, minor, exotic) - Cryptocurrencies (1,000+ pairs across major exchanges) - ETFs and mutual funds - Indices (S&P 500, DJIA, FTSE, Nikkei)

Data types: - Real-time quotes (slight delay on free tier) - Historical time series from 1min to 1month intervals - Technical indicators computed server-side — no local calculation needed - Fundamental data (earnings, financials, dividends) for equities - Exchange rate conversions

Rate limits on the free tier: - 800 API calls per day - 8 API calls per minute - 5,000 data points per request

The paid tiers scale up to 100,000+ calls/day with real-time WebSocket streaming. For CodeWords workflows that run on a schedule — daily portfolio snapshots, weekly market reports — the free tier is often sufficient.

How do you build a market monitoring workflow?

The real power of financial data APIs isn't fetching a single price. It's building automated pipelines that collect, analyze, and act on data continuously.

Pattern: daily portfolio monitor with AI summary

import requests

WATCHLIST = ["AAPL", "GOOGL", "MSFT", "TSLA", "NVDA"]
API_KEY = "YOUR_API_KEY"

def get_daily_changes():
    results = []
    for symbol in WATCHLIST:
        resp = requests.get("https://api.twelvedata.com/quote", params={
            "symbol": symbol, "apikey": API_KEY
        }).json()
        change_pct = float(resp.get("percent_change", 0))
        results.append({
            "symbol": symbol,
            "price": resp["close"],
            "change": f"{change_pct:+.2f}%"
        })
    return results

changes = get_daily_changes()
summary = await llm_analyze(
    f"Portfolio daily changes: {changes}. "
    "Summarize notable movers and any sector patterns."
)
send_slack_message("#investments", summary)

On CodeWords, this workflow runs as a scheduled task. Cody generates the code from a natural language description, handles LLM access (OpenAI, Anthropic, or Gemini — no API key setup), and sends the summary to Slack or WhatsApp on your chosen schedule.

How do you use technical indicators from the API?

Twelve Data computes technical indicators server-side. Instead of pulling raw price data and calculating an RSI locally, you request the indicator directly:

params = {
    "symbol": "AAPL",
    "interval": "1day",
    "apikey": API_KEY
}

rsi = requests.get("https://api.twelvedata.com/rsi", params=params).json()
sma_50 = requests.get("https://api.twelvedata.com/sma", params={**params, "time_period": 50}).json()
macd = requests.get("https://api.twelvedata.com/macd", params=params).json()

Useful indicators for automation:

  • RSI (Relative Strength Index) — overbought/oversold signals
  • SMA/EMA — trend direction and crossover detection
  • MACD — momentum and trend changes
  • Bollinger Bands — volatility-based boundaries
  • ADX — trend strength measurement

You can chain these into decision logic: "If RSI drops below 30 and MACD shows a bullish crossover, send an alert." That's a few API calls and an if-statement — or a single sentence to Cody on CodeWords.

How does Twelve Data compare to other financial APIs?

Other options exist. Here's how they stack up:

Alpha Vantage - Free tier: 25 calls/day (vs. Twelve Data's 800) - Covers stocks, forex, crypto - Technical indicators available but response format varies - Documentation is less consistent

Yahoo Finance (unofficial) - No official API; relies on scraping or third-party wrappers - Data can break without warning - Free but legally gray for commercial use

Polygon.io - Strong real-time data, especially for US equities - Free tier limited to delayed data - WebSocket streaming on paid plans - Better for high-frequency use cases

IEX Cloud - Good fundamentals and reference data - Pricing based on message credits, which complicates budgeting - Strong for US markets, weaker internationally

Twelve Data's sweet spot is breadth (stocks + forex + crypto + indicators) at a price point that doesn't require a hedge fund budget. For automated workflows on CodeWords, the REST-based approach integrates cleanly with the platform's HTTP request capabilities and batch processing patterns.

What are the API's limitations?

Data delays on free tier. Real-time data requires a paid plan. Free tier data has a slight delay (typically 1-15 minutes depending on the exchange). Fine for daily workflows; insufficient for intraday trading.

Rate limits require planning. 8 calls per minute on the free tier means a 50-stock watchlist takes over 6 minutes to update. Batch your requests or use the /batch endpoint to fetch multiple symbols in one call.

Coverage gaps. Some smaller exchanges and OTC stocks aren't covered. Crypto coverage is strong but not exhaustive for DeFi tokens.

Historical depth varies. Major US stocks have decades of history. Newer instruments or smaller exchanges may have limited historical data.

For most automation use cases — daily reports, weekly analysis, alert systems — these limitations are manageable. The CodeWords scheduling system lets you space out API calls across your rate limit window automatically.

FAQs

Is the Twelve Data API free?

There's a free tier with 800 calls/day and 8 calls/minute. Paid plans start at $29/month for 10,000+ calls/day and lower latency. The free tier is enough for personal projects and daily monitoring workflows.

Can Twelve Data stream real-time data?

Yes, via WebSocket on paid plans. The WebSocket endpoint pushes price updates as they happen, which is useful for dashboards and real-time alerting — though most scheduled workflows work fine with REST.

Does Twelve Data support backtesting?

The API provides historical data that you can use for backtesting, but it doesn't include a backtesting engine. You'd pull the data and run your strategy logic locally or on a platform like CodeWords.

How accurate is the data?

Twelve Data sources from exchanges and licensed data providers. For most practical automation, the data is reliable. For regulatory or compliance-grade applications, verify against the exchange's official feed.

From data access to financial intelligence

The Twelve Data API solves the data access problem. What remains is the intelligence layer — turning price movements, indicator signals, and market events into decisions. That's where AI-driven workflows close the gap between having data and acting on it.

The implication for individual builders is significant. Financial data workflows that once required Bloomberg terminals and quant teams are now accessible to anyone who can write a REST call — or describe a workflow in plain English.

Start building automated financial workflows on CodeWords — connect Twelve Data, add AI analysis, and ship your first market monitor today.

Contents
Ready to try CodeWords?
Get started free
Sign in
Sign in