Financial Literature

Twelve Data

Twelve Data — Stocks, FX and crypto bars from one tidy API — the cleanest schema among the free tiers

When you want one API and one schema for prices across asset classes — daily or intraday bars for a US or global stock, an FX pair, a crypto pair — and a free tier with clear limits you can plan around.

equitiesfxcryptoindicesglobal
Asset classesequities · fx · crypto · indices
Frequencyintraday → monthly
History2000s → today
Limit · costFree: 800 credits/day, 8/min · paid tiers from about $30/month
KeyFree key needed — Sign up at twelvedata.com; the key is instant. The 'demo' key answers a few symbols (AAPL, EUR/USD) for testing.
Formats · pull withjson · csv — python, excel, sheets
LicenceTwelve Data terms: personal and internal use on the free tier; redistribution and commercial display need a paid plan.
RedistributeNo — link and pull, do not republish
Best for“Intraday bars across stocks, FX and crypto from one API” · “A clean OHLC series with a documented schema”
When to use it

Reach for it when…

When you want one API and one schema for prices across asset classes — daily or intraday bars for a US or global stock, an FX pair, a crypto pair — and a free tier with clear limits you can plan around.

Not for: Deep history (many symbols start in the 2000s), fundamentals in depth (a light set on paid tiers), anything you will redistribute without a plan.

How to read it

Units, revisions, traps

Units. Prices in the instrument's currency; datetime in the exchange's timezone unless you set timezone=UTC. Values are strings in the JSON — cast them.

Revisions. Adjusted and unadjusted prices are both offered (adjust=all); corporate actions change history.

  • Credits, not requests: one time_series call is one credit, but some endpoints cost more.
  • The demo key works only for a handful of symbols; a 'symbol not found' with demo is not a real error.
  • Outputsize defaults to 30 bars; set it explicitly.

Classic mistake: Comparing an unadjusted close before a split with an adjusted one after.

How to use it in your own work

Three recipes

Each recipe: Python · Excel · Sheets, with how to read the result. Python recipes run under pandas; recipe 1 is re-run by the weekly check where the source allows it.

How to use it in your own work

Copy the snippet, change the series id, read the result the way the footer says. Replace YOUR_…_KEY with your own key where one is needed.

Recipe 1Daily bars for one stock

import requests, pandas as pd
KEY = "demo"   # works for AAPL; use your own key for anything else
u = f"https://api.twelvedata.com/time_series?symbol=AAPL&interval=1day&outputsize=100&apikey={KEY}"
j = requests.get(u, timeout=30).json()
df = pd.DataFrame(j["values"]).set_index("datetime").astype(float).sort_index()
print(df.tail())
How to read the resultCloses are unadjusted by default; add &adjust=all before computing long-run returns.

Recipe 2An FX pair at 1-hour bars

import requests, pandas as pd
KEY = "YOUR_TWELVEDATA_KEY"
u = f"https://api.twelvedata.com/time_series?symbol=USD/KRW&interval=1h&outputsize=200&timezone=UTC&apikey={KEY}"
j = requests.get(u, timeout=30).json()
df = pd.DataFrame(j["values"]).set_index("datetime").astype(float).sort_index()
print(df.tail())
How to read the resultIntraday FX bars from an aggregator are indicative; the daily fix from the central bank is the reference.

Recipe 3Several symbols in one call

import requests, pandas as pd
KEY = "YOUR_TWELVEDATA_KEY"
u = f"https://api.twelvedata.com/time_series?symbol=AAPL,MSFT,BTC/USD&interval=1day&outputsize=30&apikey={KEY}"
j = requests.get(u, timeout=30).json()
closes = {s: pd.Series({v["datetime"]: float(v["close"]) for v in j[s]["values"]}) for s in j}
print(pd.DataFrame(closes).sort_index().tail())
How to read the resultEach symbol in the batch costs a credit; the free tier's 8-per-minute limit applies to symbols, not calls.

Series → question map

The ids we use from Twelve Data, each with the question it answers. The catalog's compare view reads the concept tags behind these rows.

SeriesAnswersRegionConcept
time_series · AAPL 1dayDaily OHLC for a stockUnited Statesohlc_daily
time_series · 1min–1hIntraday barsglobalintraday
time_series · USD/KRWAn FX pair, intradayKoreafx_usd
time_series · BTC/USDBitcoin barsglobalcrypto_spot

Compare with

Same question, different source: EODHD, Polygon.io, Stooq. The compare view lines up coverage, frequency, history and access side by side and lists what the combination makes possible.

Open compare: Twelve Data · EODHD · Polygon.io →

Questions readers ask

What does the free tier allow?

800 credits a day and 8 a minute at the time of writing — enough for a dashboard refreshed a few times a day.

Can I use it in a newsletter?

Displaying data publicly needs a paid plan under their terms; a personal notebook does not.

Does it have fundamentals?

A light set (statements, dividends) on paid tiers; for filed numbers use EDGAR.

Educational only — we explain, we never advise · snippet licence: public domain · corrections to [email protected], fixed within a day and logged in the changelog.