Migrate from Twelve Data

Port Twelve Data calls to the Massive API

This guide is for developers who call the Twelve Data REST or WebSocket API and want to run the same app on Massive. It maps each common endpoint to the Massive endpoint that replaces it, and lists the differences that change your results. To compare the two products before you switch, see Massive vs Twelve Data.

Before you start

Using AI?

Paste this into Claude Code, Cursor, Codex, or any coding agent that can read files and fetch a URL:

Find every place my project calls Twelve Data.
Switch those calls to the Massive REST API.
Read https://massive.com/docs/migration/guides/twelve-data.md for the endpoint map and the differences to handle.
Read https://massive.com/docs/llms.txt for the rest of the API.
Read the API key from the MASSIVE_API_KEY environment variable.
Keep my function signatures and data shapes the same, and list anything Massive does not cover.

To let the agent check real responses while it works, connect the Massive MCP server. Massive also publishes skills and plugins for coding agents.

The request

Both APIs take the key in a header. Twelve Data puts the symbol and dates in query parameters. Massive puts them in the path.

Twelve Data's end_date is exclusive, so a range that ends on October 3 sets end_date=2025-10-04:

curl "https://api.twelvedata.com/time_series?symbol=AAPL&interval=1day&start_date=2025-10-01&end_date=2025-10-04" \
  -H "Authorization: apikey YOUR_API_KEY"

Massive's to date is inclusive, so the range ends on October 3:

Massive
curl "https://api.massive.com/v2/aggs/ticker/AAPL/range/1/day/2025-10-01/2025-10-03" \
  -H "Authorization: Bearer YOUR_API_KEY"
  • Long ranges. Twelve Data caps a response at 5,000 rows, so code loops over date windows. Massive returns a next_url when there is more data. The Python client follows it for you.
  • Credits. Paid Massive plans have no per-request cost, so you can remove credit tracking.
  • Extended hours. Twelve Data leaves out pre-market and after-hours bars unless you pass prepost=true. Massive intraday bars include them. To match the default, keep bars from 9:30 a.m. to 4:00 p.m. ET.

The response

Twelve Data returns values as strings, newest first:

{
  "values": [
    {
      "datetime": "2025-10-01",
      "open": "255.04000",
      "high": "258.79000",
      "low": "254.93000",
      "close": "255.45000",
      "volume": "48713940"
    }
  ],
  "status": "ok"
}

Massive returns numbers, oldest first:

{
  "results": [
    {
      "t": 1759291200000,
      "o": 255.04,
      "h": 258.79,
      "l": 254.93,
      "c": 255.45,
      "v": 48713940,
      "vw": 256.004,
      "n": 535581
    }
  ]
}
Twelve DataMassiveNote
datetimetUnix milliseconds at the bar start. Daily bars start at midnight ET
openo
highh
lowl
closec
volumev
NonevwVolume-weighted average price
NonenNumber of trades

Remove any float() or parseFloat calls on the values. If your code reads the first bar as the latest, set sort=desc or read from the end.

Symbols

Stock tickers stay the same. Forex and crypto take a prefix instead of a slash.

Twelve DataMassive
AAPLAAPL
EUR/USDC:EURUSD
BTC/USDX:BTCUSD
A ticker with exchange or mic_code for a non-US venueNot covered. Massive stocks are US listings only

Twelve Data has no options. Massive options use the OCC symbol with an O: prefix, such as O:SPY251219C00650000.

Prices

  • Both APIs adjust for splits by default, so daily prices match without extra parameters.
  • adjust=none becomes adjusted=false on Massive.
  • adjust=dividends and adjust=all have no Massive equivalent. Massive adjusts for splits only. To rebuild dividend-adjusted prices, use the historical adjustment factor from Dividends.

Errors

Twelve Data returns "status": "ok" in lowercase. Massive returns "status": "OK". Check the HTTP status code rather than the string.

Sources: Twelve Data documentation, Twelve Data pricing.

Endpoint map

This map covers the most common calls. It is not a full list. To find the Massive endpoint for another call, search these docs.

Twelve Data endpointMassive endpoint
/time_seriesCustom Bars. Forex, crypto, and indices have their own Custom Bars pages
/quoteSingle Ticker Snapshot
/priceLast Trade
/eodPrevious Day Bar, or Daily Ticker Summary for a past date
/symbol_search, /stocksAll Tickers
/forex_pairs, /cryptocurrenciesAll Tickers with market=fx or market=crypto
/profileTicker Overview
/splits, /dividendsSplits, Dividends
/income_statement, /balance_sheet, /cash_flowIncome Statements, Balance Sheets, Cash Flow Statements
/statisticsRatios, for the valuation fields
/earnings, /earnings_calendarBenzinga Earnings, a paid add-on
/ipo_calendarIPOs
/insider_transactionsForm 4
/market_moversTop Market Movers
/sma, /ema, /rsi, /macdSMA, EMA, RSI, MACD. Compute other indicators from bars
/exchange_rate, /currency_conversionCurrency Conversion. Set precision, which defaults to 2 decimal places
/market_stateMarket Status
/etfsAll Tickers with type=ETF

Massive currently doesn't have an equivalent for non-US listings, mutual funds, bonds, dividend-adjusted bars, or indicators other than SMA, EMA, RSI, and MACD. New data and features ship often, so check the product roadmap for what's planned.

Streaming

Twelve Data streams one price event per tick from wss://ws.twelvedata.com/v1/quotes/price, with symbol, price, timestamp, and day_volume. Massive streams each trade, each quote, and bars, one connection per asset class. Twelve Data timestamp is in Unix seconds, and Massive uses Unix milliseconds:

  • Stocks: connect to wss://socket.massive.com/stocks and subscribe to trades. Each trade message has the price, size, and a millisecond timestamp.
  • Forex: subscribe to quotes on wss://socket.massive.com/forex.
  • Crypto: subscribe to trades on wss://socket.massive.com/crypto.

Massive authenticates with a message after you connect, not with a URL parameter. See the WebSocket quickstart. Twelve Data's heartbeat action has no equivalent, so you can remove it.

Bulk history

Twelve Data's /batch endpoint bundles many requests into one call and charges credits for each. To build a local history across many symbols, use flat files instead. Each file holds one day of daily bars, minute bars, or trades for every US stock.

SDKs

LanguageTwelve DataMassive
Pythontwelvedataclient-python
JavaScripttwelvedata for Node.jsclient-js
GoOfficial Go clientclient-go
JavaOfficial Java clientclient-jvm, for Kotlin and Java
ROfficial R clientNone. Call the REST API directly

Sources

Twelve Data details were checked against the Twelve Data documentation and pricing page on October 29, 2026. The exclusive end_date was confirmed with a live request. Twelve Data is a trademark of its owner. Massive is not affiliated with Twelve Data.

Did you find this page helpful?
Do you still need help with something?