NAV Navbar

Getting Started

Welcome to the Twelve Data API! You can use this API to access world financial markets including stocks, forex, and cryptocurrencies. All data is available in real-time and historical formats. With Twelve Data API you can get information on time series and technical indicators in our databases.

code & output ${examples} can be found in this section

AuthenticationImportant

You can use our demo requests from the documentation to familiarize yourself with our API. For full access, you’ll have to obtain a personal free API Key.

Endpoints

All endpoints are prefixed with https://api.twelvedata.com

Batch RequestsUseful

Batch requests might be used on /time_series and all technical indicator endpoints. It allows request multiple symbols simultaneously.

HTTP request example

https://api.twelvedata.com/time_series?symbol=AAPL,EUR/USD,ETH/BTC:Huobi,RY:TSX&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "AAPL": {
      "meta": {
         "symbol": "AAPL",
         "interval": "1min",
         "currency": "USD",
         "exchange_timezone": "America/New_York",
         "exchange": "NASDAQ",
         "type": "Common Stock"
      },
      "values": [
         {
            "datetime": "2020-02-26 15:59:00",
            "open": "292.89001",
            "high": "293.10001",
            "low": "292.50000",
            "close": "292.64999",
            "volume": "385977"
         },
         {...}
      ],
      "status": "ok"
   },
   "EUR/USD": {
      {...}
   },
   "ETH/BTC:Huobi": {
      {...}
   }, 
   "RY:TSX": {
      {...}
   }
}

Request

Basic call

All symbols should be comma delimited and provided in symbol parameter. E.g:
/time_series?symbol=AAPL,MSFT,EUR/USD,SBUX,NKE

Exchange specific call

In order to call symbol from the specific exchange, use symbol_ticker:exchange format. E.g:
/bbands?symbol=ETH/BTC:Huobi,RY:TSX,ETH/BTC:Binance

General

All instruments might be called in an arbitrary order and mixes, such as stocks, forex, crypto, ETFs and indices.
Request count will be incremented according to the number of passed symbols.
Batch requests only support JSON format.
Limited to 120 symbols per request.

Response

The response consists of the main object where the key is the symbol passed and value is the normal object consisting of meta, values, status.
The response header will also include is_batch set to true if the request is batch with multiple returns symbols.

Error handling

In the case that there was an error during processing one of the symbols, the error will only be returned for that specific symbol without affecting other instrument responses.

JSON request example

https://api.twelvedata.com/time_series?symbol=AAPL,MSFT,EUR/USD,SBUX,NKE&interval=1min&apikey=demo

https://api.twelvedata.com/time_series?symbol=DOL,ENGH,ATD.B,IIP.UN,CJT,ACB,AC,CSU,BYD,KL&country=Canada&interval=1day&outputsize=12&apikey=demo

https://api.twelvedata.com/time_series?symbol=AAPL,EUR/USD,ETH/BTC:Huobi,RY:TSX&interval=30min&outputsize=12&apikey=demo

ParametersUseful

Roadmap

We continuously work to make Twelve Data API the only place where all users can obtain the necessary financial data. If you have any questions or ideas about improvement, you can email us at api@twelvedata.com

LibrariesUseful

Here, we publish libraries created to get the most of Twelve Data API. Below is the list of official libraries. A full list can be found on GitHub.

Language URL
Python twelvedata-python
Excel Excel Add-in

Support

You can check our support page for the FAQ section. If you can’t find the question, you can email us at support@twelvedata.com

Reference Data

Reference Data returns general data that can be used to enhance your project generalization.

Stocks List

This API call returns an array of symbols available at Twelve Data API. This list is updated daily.

HTTP request example

https://api.twelvedata.com/stocks

This request will return JSON with the following structure

[
  {
    "symbol": "AAPL",
    "name": "Apple Inc",
    "currency": "USD",
    "exchange": "NASDAQ",
    "country": "United States",
    "type": "Common Stock"
  },
  {
    "symbol": "AAT",
    "name": "American Assets Trust Inc",
    "currency": "USD",
    "exchange": "NYSE",
    "country": "United States",
    "type": "Real Estate Investment Trust (REIT)"
  },
  {...}
]

HTTP route

/stocks

API Parameters

Parameter Details
symbol • Parameter is optional
• Filter by symbol
exchange • Parameter is optional
• Filter by exchange name or mic code
country • Parameter is optional
• Filter by country name or alpha code
type • Parameter is optional
• Filter by instrument type
format • Parameter is optional
• Value can be CSV or JSON; Default JSON

Response

Key Description
symbol instrument symbol (ticker)
name full name of instrument
currency currency of the instrument according to the ISO 4217 standard
exchange exchange where instrument is traded
country country where exchange is located
type common issue type

JSON request example

https://api.twelvedata.com/stocks

https://api.twelvedata.com/stocks?symbol=AAPL

Downloadable CSV example

https://api.twelvedata.com/stocks?format=CSV

Forex Pairs List

This API call return array of forex pairs available at Twelve Data API. This list is daily updated.

HTTP request example

https://api.twelvedata.com/forex_pairs

This request will return JSON with the following structure

[
  {
    "symbol": "EUR/USD",
    "currency_group": "Major",
    "currency_base": "Euro",
    "currency_quote": "US Dollar"
  },
  {
    "symbol": "XAU/USD",
    "currency_group": "Exotic",
    "currency_base": "Gold Spot",
    "currency_quote": "US Dollar"
  },
  {...}
]

HTTP route

/forex_pairs

API Parameters

Parameter Details
symbol • Parameter is optional
• Filter by symbol
currency_base • Parameter is optional
• Filter by currency base
currency_quote • Parameter is optional
• Filter by currency quote
format • Parameter is optional
• Value can be CSV or JSON; Default JSON

Response

Key Description
symbol currency pair according to ISO 4217 standard codes with slash(/) delimiter
currency_group group to which currency pair belongs to, could be: Major, Minor, Exotic and Exotic-Cross
currency_base base currency name according to ISO 4217 standard
currency_quote quote currency name according to ISO 4217 standard

JSON request example

https://api.twelvedata.com/forex_pairs

https://api.twelvedata.com/forex_pairs?symbol=EUR/USD

Downloadable CSV example

https://api.twelvedata.com/forex_pairs?format=CSV

Cryptocurrencies List

This API call return array of cryptocurrency pairs available at Twelve Data API. This list is daily updated.

HTTP request example

https://api.twelvedata.com/cryptocurrencies

This request will return JSON with the following structure

[
  {
    "symbol": "BTC/USD",
    "available_exchanges": ["ABCC", "Allcoin", "BTC-Alpha", "BTCTurk", "Bibox", "BigONE", "Binance", "Bit-Z", "BitForex", "BitMEX", "BitMart", "BitMax", "BitStamp", "Bitex.la", "Bitfinex", "Bitibu", "Bitinka", "Bitlish", "Bitrue", "Bittrex", "Btcwinex", "C2CX", "CBX", "CEX.IO", "COINEGG", "Cobinhood", "CoinAll", "CoinField", "CoinHub", "CoinTiger", "Coinbase Pro", "Coinbene", "CoinsBank", "Coinsbit", "CryptalDash", "DragonEX", "EXX", "Exmo", "Exrates", "GDAX", "Gate.io", "Gemini", "HitBTC", "Huobi", "IDAX", "IDCM", "Independent Reserve", "Kraken", "Kryptono", "Kucoin", "LBank", "LakeBTC", "Livecoin", "OKCoin", "OKEx", "OOOBTC", "Panxora", "Poloniex", "QUOINE", "SIMEX", "Tidex", "Upbit", "YoBit", "ZB.COM", "bitFlyer", "itBit", "n.exchange", "p2pb2b", "xBTCe"],
    "currency_base": "Bitcoin",
    "currency_quote": "US Dollar"
  },
  {
    "symbol": "ETH/BTC",
    "available_exchanges": ["ABCC", "Allcoin", "BTC Indonesia", "BTC Markets", "BTC-Alpha", "BXThailand", "Bibox", "BigONE", "Bilaxy", "Binance", "Bit-Z", "BitBay", "BitForex", "BitMart", "BitStamp", "Bitbank", "Bitci.com", "BiteBTC", "Bitfinex", "Bitibu", "Bitlish", "Bittrex", "Btcwinex", "CBX", "CEX.IO", "COINEGG", "Cobinhood", "CoinAll", "CoinExchange", "CoinMex", "CoinTiger", "Coinbase Pro", "Coinbene", "Coinsbit", "EXX", "Exmo", "Exrates", "Fatbtc", "GDAX", "GOPAX", "Gate.io", "Gemini", "HitBTC", "Hotbit", "Huobi", "IDAX", "IDCM", "Kraken", "Kryptono", "Kucoin", "LBank", "LakeBTC", "Livecoin", "OKEx", "Panxora", "Poloniex", "QUOINE", "SIMEX", "STEX", "TOKOK", "Tidex", "Upbit", "Vebitcoin", "YoBit", "ZB.COM", "Zaif", "bitFlyer", "p2pb2b", "xBTCe"],
    "currency_base": "Ethereum",
    "currency_quote": "Bitcoin"
  },
  {...}
]

HTTP route

/cryptocurrencies

API Parameters

Parameter Details
symbol • Parameter is optional
• Filter by symbol
exchange • Parameter is optional
• Filter by exchange name
currency_base • Parameter is optional
• Filter by currency base
currency_quote • Parameter is optional
• Filter by currency quote
format • Parameter is optional
• Value can be CSV or JSON; Default JSON

Response

Key Description
symbol cryptocurrency pair codes with slash(/) delimiter
available_exchanges array of exchanges where cryptocurrency is traded
currency_base base cryptocurrency name
currency_quote quote cryptocurrency name

JSON request example

https://api.twelvedata.com/cryptocurrencies

https://api.twelvedata.com/cryptocurrencies?symbol=BTC/USD

Downloadable CSV example

https://api.twelvedata.com/cryptocurrencies?format=CSV

ETF List

This API call return array of ETFs available at Twelve Data API. This list is daily updated.

HTTP request example

https://api.twelvedata.com/etf

This request will return JSON with the following structure

[
  {
    "symbol": "SPY",
    "name": "SPDR S&P 500 ETF Trust",
    "exchange": "NYSE",
    "currency": "USD"
  },
  {
    "symbol": "VTI",
    "name": "Vanguard Total Stock Market Index Fund ETF Shares",
    "exchange": "NYSE",
    "currency": "USD"
  },
  {...}
]

HTTP route

/etf

API Parameters

Parameter Details
symbol • Parameter is optional
• Filter by symbol
exchange • Parameter is optional
• Filter by exchange name or mic code
format • Parameter is optional
• Value can be CSV or JSON; Default JSON

Response

Key Description
symbol instrument symbol (ticker)
name full name of instrument
exchange exchange where etf is traded
currency currency in which instrument is traded by ISO 4217 standard

JSON request example

https://api.twelvedata.com/etf

https://api.twelvedata.com/etf?symbol=QQQ

Downloadable CSV example

https://api.twelvedata.com/etf?format=CSV

Indices List

This API call return array of indices available at Twelve Data API. This list is daily updated.

HTTP request example

https://api.twelvedata.com/indices

This request will return JSON with the following structure

[
  {
    "symbol": "IXIC",
    "name": "NASDAQ Composite",
    "exchange": "NASDAQ",
    "currency": "USD"
  },
  {
    "symbol": "SPX",
    "name": "S&P 500",
    "exchange": "NYSE",
    "currency": "USD"
  },
  {...}
]

HTTP route

/indices

API Parameters

Parameter Details
symbol • Parameter is optional
• Filter by symbol
exchange • Parameter is optional
• Filter by exchange name or mic code
format • Parameter is optional
• Value can be CSV or JSON; Default JSON

Response

Key Description
symbol instrument symbol (ticker)
name full name of instrument
exchange exchange to which index belongs
currency currency in which instrument is traded by ISO 4217 standard

JSON request example

https://api.twelvedata.com/indices

https://api.twelvedata.com/indices?symbol=IXIC

Downloadable CSV example

https://api.twelvedata.com/indices?format=CSV

ExchangesHigh Demand

This API call return array of stock, ETF or index exchanges available at Twelve Data API. This list is daily updated.

HTTP request example

https://api.twelvedata.com/exchanges

This request will return JSON with the following structure

[
  {
    "name": "NASDAQ",
    "code": "XNGS",
    "country": "United States",
    "timezone": "America/New_York"
  },
  {
    "name": "NYSE",
    "code": "XNYS",
    "country": "United States",
    "timezone": "America/New_York"
  },
  {
    "name": "SGX",
    "code": "XSES",
    "country": "Singapore",
    "timezone": "Asia/Singapore"
    },
  {...}
]

HTTP route

/exchanges

API Parameters

Parameter Details
type • Parameter is optional
• Value can be stock, etf or index; Default stock
name • Parameter is optional
• Filter by exchange name
code • Parameter is optional
• Filter by exchange mic code
country • Parameter is optional
• Filter by country name or alpha code
format • Parameter is optional
• Value can be CSV or JSON; Default JSON

Response

Key Description
name name of exchange
code mic code of exchange
country country to which stock exchange belongs to
timezone time zone where exchange is located

JSON request example

https://api.twelvedata.com/exchanges

https://api.twelvedata.com/exchanges?type=etf

Downloadable CSV example

https://api.twelvedata.com/exchanges?format=CSV

Cryptocurrency Exchanges

This API call return array of cryptocurrency exchanges available at Twelve Data API. This list is daily updated.

HTTP request example

https://api.twelvedata.com/cryptocurrency_exchanges

This request will return JSON with the following structure

[
  {
    "name": "Binance",
  },
  {
    "name": "Upbit",
  },
  {
    "name": "Huobi",
  },
  {
    "name": "Bittrex",
  },
  {
    "name": "Bithumb",
  },
  {...}
]

HTTP route

/cryptocurrency_exchanges

API Parameters

Parameter Details
format • Parameter is optional
• Value can be CSV or JSON; Default JSON

Response

Key Description
name name of cryptocurrency exchange

JSON request example

https://api.twelvedata.com/cryptocurrency_exchanges

Downloadable CSV example

https://api.twelvedata.com/cryptocurrency_exchanges?format=CSV

Technical Indicators Interface

This API call return array of objects with available technical indicators. This endpoint might be used to build an abstract interface to make more convenient API calls from the application.

HTTP request example

https://api.twelvedata.com/technical_indicators

This request will return JSON with the following structure

[
  {
    "macd": {
      "enable": true,
      "full_name": "Moving Average Convergence Divergence",
      "description": "Moving Average Convergence Divergence(MACD) is a trend following momentum indicator, which works by subtracting the longer moving average from the shorter one. MACD has an unstable period ~ 100.",
      "type": "Momentum Indicators",
      "overlay": false,
      "parameters": {
        "series_type": {
          "default": "close",
          "range": ["open", "high", "low", "close"],
          "type": "string"
        },
        "fast_period": {
          "default": 12,
          "min_range": 1,
          "type": "int"
        },
        "slow_period": {
          "default": 26,
          "min_range": 1,
          "type": "int"
        },
        "signal_period": {
          "default": 9,
          "min_range": 1,
          "type": "int"
        }
      },
      "output_values": {
        "macd": {
          "default_color": "#2708A0",
          "display": "line"
        },
        "macd_signal": {
          "default_color": "#B80C09",
          "display": "line"
        },
        "macd_hist": {
          "default_color": "#B80C09",
          "display": "histogram"
        }
      }
    }
  },
  {...}
]

HTTP route

/technical_indicators

API Parameters

no input parameters

Response

Key Description
enable if the indicator is tested, approved and is recommended for use returns true, otherwise returns false
full_name full indicator name
description brief description of the indicator
type group to which indicator belongs to
overlay if indicator should be plotted over price bars returns true, otherwise returns false
parameters an array of input parameters where each object might contain:
default: specifies parameter value set by default
range: an array of available parameter values
min_range: if the parameter has lower bound in order to ensure correct calculation
max_range: if the parameter has upper bound in order to ensure correct calculation
type: type of parameter might be string, int, float or array
output_values an array of output values where each object might contain:
default_color: suggested color for displaying returns hex color code
display: how output value should be rendered, might be line, histogram, candle or points
min_range: if output value has minimum bound
max_range: if output value has maximum bound
tinting an array of tinting values used for proper indicator coloring
display: render pattern
color: returns hex color code
transparency: transparency level returns float value from 0 to 1 level
lower_bound: lower bound of tinting might be either number or one of the return parameters
upper_bound: upper bound of tinting might be either number or one of the return parameters

JSON request example

https://api.twelvedata.com/technical_indicators

This method helps to find the best matching symbol. It can be used as the base for custom lookups. The response is returned in descending order, with the most relevant instrument at the beginning.

HTTP request example

https://api.twelvedata.com/symbol_search?symbol=AA

This request will return JSON with the following structure

{
  "data": [
    {
      "symbol": "AA",
      "instrument_name": "Alcoa Corp",
      "exchange": "NYSE",
      "exchange_timezone": "America/New_York",
      "instrument_type": "Common Stock",
      "country": "United States"
    },
    {
      "symbol": "AAA",
      "instrument_name": "BetaShares Australian High Interest Cash ETF",
      "exchange": "ASX",
      "exchange_timezone": "Australia/Sydney",
      "instrument_type": "ETF",
      "country": "Australia"
    },
    {
      "symbol": "AAAU",
      "instrument_name": "Perth Mint Physical Gold ETF",
      "exchange": "NYSE",
      "exchange_timezone": "America/New_York",
      "instrument_type": "ETF",
      "country": "United States"
    },
    {...}
  ],
  "status": "ok"
}

Search

HTTP route

/symbol_search

API Parameters

Parameter Details
symbol • Required parameter
• Symbol to search
outputsize • Parameter is optional
• Number of matches in response
• Default 30, Max 120;

Response

Key Description
symbol ticker symbol of instrument
instrument_name name of exchange
exchange mic code of exchange
exchange_timezone time zone where exchange is located
instrument_type type of instrument
country country to which stock exchange belongs to

JSON request example

https://api.twelvedata.com/symbol_search?symbol=AA

https://api.twelvedata.com/symbol_search?symbol=XAU/

https://api.twelvedata.com/symbol_search?symbol=RY

Earliest TimestampNew

This method returns the first available DateTime for a given instrument at the specific interval.

HTTP request example

https://api.twelvedata.com/earliest_timestamp?symbol=AAPL&interval=1day&apikey=your_api_key

This request will return JSON with the following structure

{
  "datetime": "1980-12-12",
  "unix_time": 345427200
}

HTTP route

/earliest_timestamp

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
datetime earliest datetime, the format depends on interval
unix_time datetime converted to UNIX timestamp

JSON request example

https://api.twelvedata.com/earliest_timestamp?symbol=AAPL&interval=1day&apikey=demo

https://api.twelvedata.com/earliest_timestamp?symbol=AAPL,MSFT&interval=1day&apikey=demo

https://api.twelvedata.com/earliest_timestamp?symbol=EUR/USD&interval=1min&apikey=demo

WebSockets

Socket Server v1.0Prime

1. Connect & Authorize

# Pass API Key as connection parameter
wss://ws.twelvedata.com/v1/quotes/price?apikey=your_api_key

# Or pass API Key separately in header
wss://ws.twelvedata.com/v1/quotes/price
X-TD-APIKEY: your_api_key

2. Subscribe to Stream

# You may subscribe to multiple symbols by calling subscribe action. 
# Additionally, you can pass the exchange name after the colon(:).
{
  "action": "subscribe", 
  "params": {
    "symbols": "AAPL,RY,RY:TSX,EUR/USD,BTC/USD"
  }
}
# Alternatively, if you need to get data from the ambiguos symbol you may use the extended format
{ "action": "subscribe", 
  "params": {
    "symbols": [{
        "symbol": "AAPL",
        "exchange": "NASDAQ"
      }, {
        "symbol": "RY", 
        "exchange": "TSX"
      }, {
        "symbol": "DJI",
        "type": "Index"
      }
]}}

3. Response

Success subscription response:
{
  "event": "subscribe-status",
  "status": "ok",
  "success": [
    {"symbol":"AAPL","exchange":"NASDAQ","country":"United States","type":"Common Stock"},
    {"symbol":"RY","exchange":"NYSE","country":"United States","type":"Common Stock"},
    {"symbol":"RY","exchange":"TSX","country":"Canada","type":"Common Stock"},
    {"symbol":"EUR/USD","exchange":"FOREX","country":"","type":"Physical Currency"},
    {"symbol":"BTC/USD","exchange":"FOREX","country":"","type":"Physical Currency"}
  ],
  "fails": []
}
Price event data response:
{
  "event": "price",
  "symbol": "AAPL",
  "currency": "USD",
  "exchange": "NASDAQ",
  "type": "Common Stock",
  "timestamp": 1592249566,
  "price": 342.0157,
  "day_volume": 27631112
}

Step 1: Connection & Authorization

Your API Key is used to connect to the Twelve Data Distributed WebSocket System (TDDWS). This system will manage all your requests to all available instruments, across different exchanges. Therefore, you only need to establish one connection across the whole lifespan of application, if you open a new one, the current connection will be broken.

Step 2: Subscription to Stream

You may subscribe to all symbols available at Twelve Data, the format remains the same as the API. At the same time, you may combine symbols across different types and TDDWS manage the routing. There are some limitations though:

Step 3: Response

There are two general return event types: status and price.

Status events return the information about the events itself, which symbols were successfully subscribed/unsubscribed, etc.

Price events return the real-time tick prices for particular instruments. The body will include the meta information, UNIX timestamp, and the price itself. Price events return the real-time tick prices, with the following structure:

field* description
event type of event
symbol symbol ticker of instrument
type general instrument type
timestamp timestamp in UNIX format
price real-time price for the underlying instrument
day_volume volume of the instrument for the current trading day

*Some additional meta response field will be received, depending on the class of the instrument.

Further steps

At this stage you might decide that you no longer want to be subscribed for particular symbols, therefore you have two options:

  1. Manually unsubscribe from symbols. This is done with the same format as the subscription, but with action set to "action": "unsubscribe".
  2. Reset subscription. This will reset your current connection from all subscriptions.
    Send the {"action": "reset"} event.

Time Series

Time Series returns OHLC prices in real-time for the selected interval.

StocksHigh Demand

This API call returns meta and time series for equities. Meta object consists of general information about the requested symbol. Time series is the array of objects ordered by time descending with Open, High, Low, Close prices + Volume.

HTTP request example

https://api.twelvedata.com/time_series?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NASDAQ",
      "type": "Common Stock"
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "open":"200.93999",
         "high":"201.25599",
         "low":"200.85199",
         "close":"201.05000",
         "volume":"472287"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "open":"201.02999",
         "high":"201.13000",
         "low":"200.83999",
         "close":"200.93499",
         "volume":"209854"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "open":"201.02000",
         "high":"201.07000",
         "low":"200.91000",
         "close":"201.02000",
         "volume":"149032"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "open":"201.11999",
         "high":"201.25999",
         "low":"201.03340",
         "close":"201.03340",
         "volume":"178892"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "open":"201.75999",
         "high":"201.75999",
         "low":"201.07000",
         "close":"201.13000",
         "volume":"372886"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/time_series

API Parameters

Parameter Details
symbol • Required parameter
• Name of instrument you want to request
• For preffered stocks use dot(.) delimiter
E.g. BRK.A or BRK.B will be correct
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Exchange where instrument is traded
• Exchanges list is available at /stock_exchanges endpoint
• Type string
country • Parameter is optional
• Country where instrument is traded
• Countries list is available at /stock_exchanges endpoint
• Type string
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime at local exchange time referring to when the bar with specified interval was opened
open price at the opening of current bar
high highest price which occurred during the current bar
low lowest price which occurred during the current bar
close close price at the end of the bar
volume trading volume which occurred during the current bar

JSON request example

https://api.twelvedata.com/time_series?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/time_series?symbol=MSFT&interval=1day&outputsize=12&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/time_series?symbol=CSCO&interval=5min&format=CSV&apikey=demo

ForexHigh Demand

This API call returns meta and time series for Foreign Exchange(Forex). Meta object consists of general information about requested currency pair. Time series is the array of objects order by time desceding with Open, High, Low and Close prices.

HTTP request example

https://api.twelvedata.com/time_series?symbol=EUR/USD&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "EUR/USD",
      "interval": "1min",
      "currency_base": "Euro",
      "currency_quote": "US Dollar",
      "type": "Physical Currency"
   },
   "values":[
      {
         "datetime":"2019-08-09 20:59:00",
         "open":"1.12000",
         "high":"1.12020",
         "low":"1.11989",
         "close":"1.12020"
      },
      {
         "datetime":"2019-08-09 20:58:00",
         "open":"1.12004",
         "high":"1.12010",
         "low":"1.12004",
         "close":"1.12010"
      },
      {
         "datetime":"2019-08-09 20:57:00",
         "open":"1.12010",
         "high":"1.12020",
         "low":"1.12004",
         "close":"1.12004"
      },
      {
         "datetime":"2019-08-09 20:56:00",
         "open":"1.12024",
         "high":"1.12024",
         "low":"1.12010",
         "close":"1.12010"
      },
      {
         "datetime":"2019-08-09 20:55:00",
         "open":"1.12010",
         "high":"1.12024",
         "low":"1.12004",
         "close":"1.12020"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/time_series

API Parameters

Parameter Details
symbol • Required parameter
• Currency pair you want to request
• Slash(/) delimiter is used
E.g. EUR/USD or CAD/JPY will be correct
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in UTC referring to when the bar with specified interval was opened
open price at the opening of current bar
high highest price which occurred during the current bar
low lowest price which occurred during the current bar
close close price at the end of the bar

JSON request example

https://api.twelvedata.com/time_series?symbol=EUR/USD&interval=1min&apikey=demo

https://api.twelvedata.com/time_series?symbol=USD/JPY&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/time_series?symbol=GBP/USD&interval=15min&format=CSV&apikey=demo

CryptocurrencyHigh Demand

This API call returns meta and time series for cryptocurrencies. Meta object consists of general information about requested currency pair. Time series is the array of objects ordered by time desceding with Open, High, Low and Close prices.

HTTP request example

https://api.twelvedata.com/time_series?symbol=BTC/USD&exchange=Binance&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "BTC/USD",
      "interval": "1min",
      "currency_base": "Bitcoin",
      "currency_quote": "US Dollar",
      "exchange": "Binance",
      "type": "Digital Currency"
   },
   "values":[
      {
         "datetime":"2019-08-09 17:01:00",
         "open":"11786.45996",
         "high":"11786.45996",
         "low":"11786.45996",
         "close":"11786.45996"
      },
      {
         "datetime":"2019-08-09 17:00:00",
         "open":"11783.84960",
         "high":"11783.84960",
         "low":"11783.84960",
         "close":"11783.84960"
      },
      {
         "datetime":"2019-08-09 16:59:00",
         "open":"11791.19042",
         "high":"11791.19042",
         "low":"11791.19042",
         "close":"11791.19042"
      },
      {
         "datetime":"2019-08-09 16:58:00",
         "open":"11798.42968",
         "high":"11791.19042",
         "low":"11798.42968",
         "close":"11798.42968"
      },
      {
         "datetime":"2019-08-09 16:57:00",
         "open":"11814.45996",
         "high":"11814.45996",
         "low":"11814.45996",
         "close":"11814.45996"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/time_series

API Parameters

Parameter Details
symbol • Required parameter
• Cryptocurrency pair you want to request
• Slash(/) delimiter is used
E.g. BTC/USD or XRP/ETH will be correct
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Exchange where cryptocurrency is traded
• Exchanges list is available at /cryptocurrency_exchanges endpoint
• Type string
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in UTC referring to when the bar with specified interval was opened
open price at the opening of current bar
high highest price which occurred during the current bar
low lowest price which occurred during the current bar
close close price at the end of the bar

JSON request example

https://api.twelvedata.com/time_series?symbol=BTC/USD&exchange=Binance&interval=1min&apikey=demo

https://api.twelvedata.com/time_series?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/time_series?symbol=ETH/BTC&exchange=Huobi&interval=30min&format=CSV&apikey=demo

ETF

This API call returns meta and time series for Exchange Traded Funds. Meta object consists of general information about the requested instrument. Time series is the array of objects ordered by time descending with Open, High, Low, Close prices + Volume.

HTTP request example

https://api.twelvedata.com/time_series?symbol=VTI&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "VTI",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "ETF"
   },
   "values":[
      {
         "datetime":"2020-02-26 15:59:00",
         "open":"158.49001",
         "high":"158.50000",
         "low":"158.35001",
         "close":"158.39000",
         "volume":"115994"
      },
      {
         "datetime":"2020-02-26 15:58:00",
         "open":"158.55000",
         "high":"158.58000",
         "low":"158.47560",
         "close":"158.48900",
         "volume":"33048"
      },
      {
         "datetime":"2020-02-26 15:57:00",
         "open":"158.50000",
         "high":"158.59000",
         "low":"158.48000",
         "close":"158.55000",
         "volume":"20156"
      },
      {
         "datetime":"2020-02-26 15:56:00",
         "open":"158.52000",
         "high":"158.57359",
         "low":"158.50000",
         "close":"158.50000",
         "volume":"15329"
      },
      {
         "datetime":"2020-02-26 15:55:00",
         "open":"158.61000",
         "high":"158.66499",
         "low":"158.51660",
         "close":"158.53999",
         "volume":"24274"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/time_series

API Parameters

Parameter Details
symbol • Required parameter
• Name of ETF you want to request
E.g. VTI or SPY will be correct
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Exchange where ETF is traded
• Exchanges list is available at /etf endpoint
• Type string
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in UTC referring to when the bar with specified interval was opened
open price at the opening of current bar
high highest price which occurred during the current bar
low lowest price which occurred during the current bar
close close price at the end of the bar

JSON request example

https://api.twelvedata.com/time_series?symbol=VTI&interval=1min&apikey=demo

https://api.twelvedata.com/time_series?symbol=SPY&exchange=ASX&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/time_series?symbol=VT&exchange=NYSE&interval=30min&format=CSV&apikey=demo

Indices

This API call returns meta and time series for Indices. Meta object consists of general information about the requested instrument. Time series is the array of objects ordered by time descending with Open, High, Low, Close prices + Volume.

HTTP request example

https://api.twelvedata.com/time_series?symbol=IXIC&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "IXIC",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NASDAQ",
      "type": "Index"
   },
   "values":[
      {
         "datetime":"2020-02-26 15:59:00",
         "open":"8986.05762",
         "high":"8986.43945",
         "low":"8986.45215",
         "close":"8986.45215",
         "volume":"683697"
      },
      {
         "datetime":"2020-02-26 15:58:00",
         "open":"8986.33984",
         "high":"8986.33984",
         "low":"8986.87305",
         "close":"8986.15918",
         "volume":"951896"
      },
      {
         "datetime":"2020-02-26 15:57:00",
         "open":"8986.77637",
         "high":"8986.45996",
         "low":"8986.23047",
         "close":"8986.74414",
         "volume":"1172207"
      },
      {
         "datetime":"2020-02-26 15:56:00",
         "open":"8986.97559",
         "high":"8986.07715",
         "low":"8986.54590",
         "close":"8986.54590",
         "volume":"808513"
      },
      {
         "datetime":"2020-02-26 15:55:00",
         "open":"8986.43164",
         "high":"8986.45020",
         "low":"8986.96094",
         "close":"8986.23438",
         "volume":"1072135"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/time_series

API Parameters

Parameter Details
symbol • Required parameter
• Name of index you want to request
E.g. IXIC or SPX will be correct
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Exchange to which index belongs
• Exchanges list is available at /indices endpoint
• Type string
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in UTC referring to when the bar with specified interval was opened
open price at the opening of current bar
high highest price which occurred during the current bar
low lowest price which occurred during the current bar
close close price at the end of the bar

JSON request example

https://api.twelvedata.com/time_series?symbol=IXIC&interval=1min&apikey=demo

https://api.twelvedata.com/time_series?symbol=SPX&exchange=NYSE&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/time_series?symbol=DJI&exchange=NYSE&interval=30min&format=CSV&apikey=demo

QuoteHigh Demand

Quote endpoint is an efficient method to retrieve the latest quote of the selected instrument.

HTTP request example

https://api.twelvedata.com/quote?symbol=AAPL&apikey=your_api_key

This request will return JSON with the following structure

{
    "symbol": "AAPL",
    "name": "Apple Inc",
    "exchange": "NASDAQ",
    "currency": "USD",
    "datetime": "2019-08-09",
    "open": "201.30000",
    "high": "202.75999",
    "low": "199.28999",
    "close": "200.99001",
    "volume": "24619700",
    "previous_close": "203.42999",
    "change": "-2.43998",
    "percent_change": "-1.19942",
    "average_volume": "203734",
    "fifty_two_week": {
        "low": "142.19",
        "high": "232.07",
        "low_change": "58.8",
        "high_change": "-31,08",
        "low_change_percent": "41.35312",
        "high_change_percent": "-13.39251",
        "range": "142.19 - 232.07"
    }
}

HTTP route

/quote

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Optional parameter
• Interval of the quote
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month; Default 1day
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
volume_time_period • Optional parameter
• Number of periods for Average Volume
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
symbol symbol passed
name name of the instrument
exchange exchange where instrument is traded
currency currency in which the equity is denominated
datetime datetime in defined timezone referring to when the bar with specified interval was opened
open price at the opening of current bar
high highest price which occurred during the current bar
low lowest price which occurred during the current bar
close close price at the end of the bar
volume trading volume during the bar
previous_close close price at the end of the previous bar
change close - previous_close
percent_change (close - previous_close) / previous_close * 100
average_volume average volume of the specified period
fifty_two_week collection of 52-week metrics

JSON request example

https://api.twelvedata.com/quote?symbol=AAPL&apikey=demo

https://api.twelvedata.com/quote?symbol=GBP/USD&interval=30min&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/quote?symbol=SPX&type=Index&interval=5min&format=CSV&apikey=demo

Real-Time Price

This endpoint is a lightweight method that allows retrieving only the real-time price of the selected instrument.

HTTP request example

https://api.twelvedata.com/price?symbol=AAPL&apikey=your_api_key

This request will return JSON with the following structure

{
    "price": "200.99001"
}

HTTP route

/price

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
price real-time or the latest available price

JSON request example

https://api.twelvedata.com/price?symbol=AAPL&apikey=demo

https://api.twelvedata.com/price?symbol=BMO&country=Canada&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/price?symbol=CHF/EUR&format=CSV&apikey=demo

Stock Fundamentals

Stock Fundamentals includes data which might impact stock price or anticipated value.

EarningsPrime

This API call returns earnings data for a given company, including EPS estimate and EPS actual. Earnings are available for complete company history.

HTTP request example

https://api.twelvedata.com/earnings?symbol=AAPL&apikey=your_api_key

This request will return JSON with the following structure

{
  "meta": {
    "symbol": "AAPL",
    "name": "Apple Inc",
    "currency": "USD",
    "exchange": "NASDAQ",
    "exchange_timezone": "America/New_York"
  },
  "earnings":[
    {
       "date": "2020-04-30",
       "time": "After Hours",
       "eps_estimate": 2.09,
       "eps_actual": 2.55,
       "difference": 0.46,
       "surprise_prc": 22.01
    },
    {
       "date": "2020-01-28",
       "time": "After Hours",
       "eps_estimate": 4.54,
       "eps_actual": 4.99,
       "difference": 0.45,
       "surprise_prc": 9.91
    },
    {
       "date": "2019-10-30",
       "time": "After Hours",
       "eps_estimate": 2.84,
       "eps_actual": 3.03,
       "difference": 0.19,
       "surprise_prc": 6.69
    },
    {
       "date": "2010-07-30",
       "time": "After Hours",
       "eps_estimate": 2.10,
       "eps_actual": 2.18,
       "difference": 0.08,
       "surprise_prc": 3.81
    },
    {
       "date": "2019-04-30",
       "time": "After Hours",
       "eps_estimate": 2.37,
       "eps_actual": 2.46,
       "difference": 0.09,
       "surprise_prc": 3.8
    },
    {...}
  ],
  "status":"ok"
}

HTTP route

/earnings

API Parameters

Parameter Details
symbol • Required parameter
• Name of instrument you want to request
• For preffered stocks use dot(.) delimiter
E.g. BRK.A or BRK.B will be correct
exchange • Parameter is optional
• Exchange where instrument is traded
• Exchanges list is available at /stock_exchanges endpoint
• Type string
country • Parameter is optional
• Country where instrument is traded
• Countries list is available at /stock_exchanges endpoint
• Type string
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
period • Parameter is optional
• Type of earning, returns only 1 record
• When is not empty, dates and outputsize parameters are ignored
• Accepts: latest and next
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 1000
• Default 10 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key upgraded to Prime membership, which can be obtained here
• Type string

Response

Key Description
date date of earning release
time can be either of the following values: Pre Market, After Hours, Time Not Supplied, Transfer Agent
eps_estimate analyst estimate of the future company earning
eps_actual actual value of reported earning
difference delta between eps_actual and eps_estimate
surprise_prc surprise in the percentage of the eps_actual related to eps_estimate

JSON request example

https://api.twelvedata.com/earnings?symbol=AAPL&apikey=your_api_key

Downloadable CSV example

https://api.twelvedata.com/earnings?symbol=AAPL&apikey=your_api_key&format=CSV

Earnings CalendarPrime

This API method returns earning data as a calendar for a given date range. By default today's earning is returned. To call custom period, use start_date and end_date parameters.

HTTP request example

https://api.twelvedata.com/earnings_calendar?apikey=your_api_key

This request will return JSON with the following structure

{
    "earnings":{
        "2020-05-08":[
            {...},
            {
                "symbol": "BR",
                "name": "Broadridge Financial Solutions Inc",
                "currency": "USD",
                "exchange": "NYSE",
                "time": "Time Not Supplied",
                "eps_estimate": 1.72,
                "eps_actual": 1.67,
                "difference": -0.05,
                "surprise_prc": -2.9
            },
            {
                "symbol": "LPL",
                "name": "LG Display Co Ltd",
                "currency": "USD",
                "exchange": "NYSE",
                "time": "Time Not Supplied",
                "eps_estimate": -0.45,
                "eps_actual": -0.23,
                "difference": 0.22,
                "surprise_prc": 48.22
            },
            {...}
        ],
        "2020-05-07":[
            {...},
            {
                "symbol": "AAON",
                "name": "AAON Inc",
                "currency": "USD",
                "exchange": "NASDAQ",
                "time": "Time Not Supplied",
                "eps_estimate": 0.35,
                "eps_actual": 0.41,
                "difference": 0.06,
                "surprise_prc": 17.14
            },
            {
                "symbol": "JOBS",
                "name": "51job Inc",
                "currency": "USD",
                "exchange": "NASDAQ",
                "time": "Time Not Supplied",
                "eps_estimate": 2.44,
                "eps_actual": 3.27,
                "difference": 0.83,
                "surprise_prc": 34.02
            },
            {...}
        ],
        {...}
    },
    "status":"ok"
}

HTTP route

/earnings_calendar

API Parameters

Parameter Details
symbol • Required parameter
• Name of instrument you want to request
• For preffered stocks use dot(.) delimiter
E.g. BRK.A or BRK.B will be correct
exchange • Parameter is optional
• Exchange where instrument is traded
• Exchanges list is available at /stock_exchanges endpoint
• Type string
country • Parameter is optional
• Country where instrument is traded
• Countries list is available at /stock_exchanges endpoint
• Type string
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key upgraded to Prime membership, which can be obtained here
• Type string

Response

Key Description
symbol instrument symbol (ticker)
name full name of instrument
currency currency in which instrument is traded by ISO 4217 standard
exchange exchange where instrument is traded
country country where exchange is located
time can be either of the following values: Pre Market, After Hours, Time Not Supplied, Transfer Agent
eps_estimate analyst estimate of the future company earning
eps_actual actual value of reported earning
difference delta between eps_actual and eps_estimate
surprise_prc surprise in percentage of the eps_actual related to eps_estimate

JSON request example

https://api.twelvedata.com/earnings_calendar?apikey=your_api_key

Downloadable CSV example

https://api.twelvedata.com/earnings_calendar?apikey=your_api_key&format=CSV

Technical Indicators

Technical indicators return real-time and historical values of the demanded indicator at the selected interval.

Chaikin A/D Line(AD) calculates the Advance/Decline of an asset. This indicator belongs to the group of Volume Indicators.

This API call returns "meta" and "time_series" values of AD. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/ad?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "AD - Chaikin A/D Line"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "ad":"2262629.83773"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "ad":"2271951.53983"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "ad":"2344317.27255"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "ad":"2288433.82567"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "ad":"2467325.82567"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/ad

API Parameters

Parameter Details
symbol • Required parameter
• Name of instrument you want to request
• For preffered stocks use dot(.) delimiter
E.g. BRK.A or BRK.B will be correct
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
ad ad value

JSON request example

https://api.twelvedata.com/ad?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/ad?symbol=XOM&exchange=NYSE&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/ad?symbol=GS&interval=30min&format=CSV&apikey=demo

ADD

Composite of values of two specified time series.

This API call returns "meta" and "time_series" values of ADD. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/add?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "ADD - Arithmetic Addition",
         "series_type_1": "open",
         "series_type_2": "close"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "add":"402.10798"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "add":"401.97"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "add":"401.98001"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "add":"402.2934"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "add":"402.83"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/add

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type_1 • Parameter is optional
• Price type used as the first part of technical indicator
• Type string; Default open
Code Name
0 close
1 open
2 high
3 low
4 volume
series_type_2 • Parameter is optional
• Price type used as the second part of technical indicator
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
add add value

JSON request example

https://api.twelvedata.com/add?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/add?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/add?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

ADOSC

Chaikin A/D Oscillator(ADOSC) is an indicator, which finds the relationship between increasing and decreasing volume with price fluctuations. The Chaikin Oscillator measures the momentum of the Accumulation/Distribution Line(ADL) using two Exponential Moving Averages of varying length to the line(MACD).

This API call returns "meta" and "time_series" values of ADOSC. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/adosc?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "ADOSC - Chaikin A/D Oscillator",
         "fast_period": 12,
         "slow_period": 26
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "adosc":"-233315.15185"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "adosc":"-214691.54601"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "adosc":"-188747.38536"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "adosc":"-160255.93296"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "adosc":"-115869.53282"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/adosc

API Parameters

Parameter Details
symbol • Required parameter
• Name of instrument you want to request
• For preffered stocks use dot(.) delimiter
E.g. BRK.A or BRK.B will be correct
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
fast_period • Parameter is optional
• Number of periods for fast moving average. Takes values in the range from 1 to 800
• Type int; Default 12
slow_period • Parameter is optional
• Number of periods for slow moving average. Takes values in the range from 1 to 800
• Type int; Default 26
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
adosc adosc value

JSON request example

https://api.twelvedata.com/adosc?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/adosc?symbol=XOM&exchange=NYSE&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/adosc?symbol=GS&interval=30min&format=CSV&apikey=demo

ADXHigh Demand

Average Directional Index(ADX) is used to decide if the price trend is strong.

This API call returns "meta" and "time_series" values of ADX. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/adx?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "ADX - Average Directional Index",
         "time_period": 14
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "adx":"49.22897"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "adx":"47.73058"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "adx":"44.90916"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "adx":"41.9312"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "adx":"38.83754"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/adx

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 14
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
adx adx value

JSON request example

https://api.twelvedata.com/adx?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/adx?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/adx?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

ADXR

Average Directional Movement Index Rating(ADXR) is a smoothed version of the ADX indicator. ADXR quantifies momentum change in the ADX.

This API call returns "meta" and "time_series" values of ADXR. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/adxr?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "ADXR - Average Directional Movement Index Rating",
         "time_period": 14
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "adxr":"37.43665"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "adxr":"36.83599"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "adxr":"35.58524"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "adxr":"34.41498"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "adxr":"33.21139"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/adxr

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 14
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
adxr adxr value

JSON request example

https://api.twelvedata.com/adxr?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/adxr?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/adxr?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

APO

Absolute Price Oscillator(APO) calculates the difference between two price moving averages.

This API call returns "meta" and "time_series" values of APO. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/apo?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "APO - Absolute Price Oscillator",
         "fast_period": 12,
         "ma_type": "SMA",
         "series_type": "close",
         "slow_period": 26
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "apo":"-0.54508"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "apo":"-0.47169"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "apo":"-0.39004"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "apo":"-0.3087"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "apo":"-0.23315"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/apo

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
fast_period • Parameter is optional
• Number of periods for fast moving average. Takes values in the range from 1 to 800
• Type int; Default 12
ma_type • Parameter is optional
• Type of Moving Average to be used
• Type string; Default SMA
Code Name
0 SMA
1 EMA
2 WMA
3 DEMA
4 TEMA
5 TRIMA
6 KAMA
7 MAMA
8 T3MA
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
slow_period • Parameter is optional
• Number of periods for slow moving average. Takes values in the range from 1 to 800
• Type int; Default 26
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
apo apo value

JSON request example

https://api.twelvedata.com/apo?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/apo?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/apo?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

AROON

Aroon Indicator(AROON) is used to identify if the price is trending. It can also spot the beginning of a new trend and its strength.

This API call returns "meta" and "time_series" values of AROON. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/aroon?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "AROON - Aroon Indicator",
         "time_period": 14
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "aroon_down":"92.85714",
         "aroon_up":"0.0"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "aroon_down":"100.0",
         "aroon_up":"7.14286"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "aroon_down":"100.0",
         "aroon_up":"0.0"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "aroon_down":"100.0",
         "aroon_up":"0.0"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "aroon_down":"100.0",
         "aroon_up":"7.14286"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/aroon

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 14
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
aroon_down aroon_down value
aroon_up aroon_up value

JSON request example

https://api.twelvedata.com/aroon?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/aroon?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/aroon?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

AROONOSC

Aroon Oscillator(AROONOSC) uses classic Aroon(Aroon Up and Aroon down) to measure the strength of persisting trends and whether they will continue.

This API call returns "meta" and "time_series" values of AROONOSC. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/aroonosc?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "AROONOSC - Aroon Oscillator",
         "time_period": 14
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "aroonosc":"-92.85714"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "aroonosc":"-92.85714"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "aroonosc":"-100.0"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "aroonosc":"-100.0"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "aroonosc":"-92.85714"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/aroonosc

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 14
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
aroonosc aroonosc value

JSON request example

https://api.twelvedata.com/aroonosc?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/aroonosc?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/aroonosc?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

ATR

Average True Range(ATR) is used to measure market volatility by decomposing all asset prices over a specified time period.

This API call returns "meta" and "time_series" values of ATR. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/atr?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "ATR - Average True Range",
         "time_period": 14
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "atr":"0.19828"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "atr":"0.18246"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "atr":"0.17419"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "atr":"0.17528"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "atr":"0.17133"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/atr

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 14
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
atr atr value

JSON request example

https://api.twelvedata.com/atr?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/atr?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/atr?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

AVG

Average(AVG) calculates the average value of series in a given time period. Widely used to calculate the 9-day average volume.

This API call returns "meta" and "time_series" values of AVG. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/avg?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "AVG - Average",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "avg":"201.53871"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "avg":"201.69205"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "avg":"201.85111"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "avg":"202.03185"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "avg":"202.20237"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/avg

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
avg avg value

JSON request example

https://api.twelvedata.com/avg?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/avg?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/avg?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

AVGPRICE

Average Price(AVGPRICE) uses the formula: (open + high + low + close) / 4.

This API call returns "meta" and "time_series" values of AVGPRICE. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/avgprice?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "AVGPRICE - Average Price"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "avgprice":"201.02449"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "avgprice":"200.98375"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "avgprice":"201.005"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "avgprice":"201.1117"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "avgprice":"201.43"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/avgprice

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
avgprice avgprice value

JSON request example

https://api.twelvedata.com/avgprice?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/avgprice?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/avgprice?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

BBANDSHigh Demand

Bollinger Bands®(BBANDS) are volatility bands located above and below a moving average. The volatility size parameter depends on standard deviation.

This API call returns "meta" and "time_series" values of BBANDS. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/bbands?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "BBANDS - Bollinger Bands®",
         "ma_type": "SMA",
         "sd": 2,
         "series_type": "close",
         "time_period": 20
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "upper_band":"203.36511",
         "middle_band":"202.04999",
         "lower_band":"200.73486"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "upper_band":"203.39936",
         "middle_band":"202.13499",
         "lower_band":"200.87061"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "upper_band":"203.38227",
         "middle_band":"202.22324",
         "lower_band":"201.0642"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "upper_band":"203.32938",
         "middle_band":"202.30173",
         "lower_band":"201.27409"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "upper_band":"203.23305",
         "middle_band":"202.38007",
         "lower_band":"201.52709"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/bbands

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
ma_type • Parameter is optional
• Type of Moving Average to be used
• Type string; Default SMA
Code Name
0 SMA
1 EMA
2 WMA
3 DEMA
4 TEMA
5 TRIMA
6 KAMA
7 MAMA
8 T3MA
sd • Parameter is optional
• Number of standard deviations. Must be at least 1
• Type double; Default 2
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 20
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
lower_band lower_band value
middle_band middle_band value
upper_band upper_band value

JSON request example

https://api.twelvedata.com/bbands?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/bbands?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/bbands?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

BETA

Statistic Beta function.

This API call returns "meta" and "time_series" values of BETA. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/beta?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "BETA - Beta",
         "series_type_1": "open",
         "series_type_2": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "beta":"-0.05742"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "beta":"-0.31826"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "beta":"-0.60342"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "beta":"-0.4949"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "beta":"-0.24952"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/beta

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type_1 • Parameter is optional
• Price type used as the first part of technical indicator
• Type string; Default open
Code Name
0 close
1 open
2 high
3 low
4 volume
series_type_2 • Parameter is optional
• Price type used as the second part of technical indicator
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
beta beta value

JSON request example

https://api.twelvedata.com/beta?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/beta?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/beta?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

BOP

Balance of Power(BOP) measures the relative strength between buyers and sellers by assessing the ability of move price to an extreme level.

This API call returns "meta" and "time_series" values of BOP. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/bop?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "BOP - Balance of Power"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "bop":"0.27231"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "bop":"-0.32758"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "bop":"0.0"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "bop":"-0.38215"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "bop":"-0.91305"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/bop

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
bop bop value

JSON request example

https://api.twelvedata.com/bop?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/bop?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/bop?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

CCI

Commodity Channel Index(CCI) is a universal indicator that can help to identify new trends and assess current critical conditions.

This API call returns "meta" and "time_series" values of CCI. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/cci?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "CCI - Commodity Channel Index",
         "time_period": 20
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "cci":"-122.30794"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "cci":"-152.88827"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "cci":"-180.08234"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "cci":"-206.65411"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "cci":"-225.40021"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/cci

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 20
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
cci cci value

JSON request example

https://api.twelvedata.com/cci?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/cci?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/cci?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

CEIL

Vector CEIL(CEIL) transforms input data with the mathematical ceil function.

This API call returns "meta" and "time_series" values of CEIL. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/ceil?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "CEIL - Vector CEIL",
         "series_type": "close"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "ceil":"202.0"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "ceil":"201.0"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "ceil":"202.0"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "ceil":"202.0"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "ceil":"202.0"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/ceil

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
ceil ceil value

JSON request example

https://api.twelvedata.com/ceil?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/ceil?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/ceil?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

CMO

Chande Momentum Oscillator(CMO) is used to show overbought and oversold conditions.

This API call returns "meta" and "time_series" values of CMO. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/cmo?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "CMO - Chande Momentum Oscillator",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "cmo":"-71.24979"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "cmo":"-91.96597"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "cmo":"-91.27229"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "cmo":"-91.16542"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "cmo":"-90.41306"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/cmo

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
cmo cmo value

JSON request example

https://api.twelvedata.com/cmo?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/cmo?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/cmo?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

COPPOCK

Coppock Curve(COPPOCK) is usually used to detect long-term trend changes, typically on monthly charts.

This API call returns "meta" and "time_series" values of COPPOCK. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/coppock?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "COPPOCK - Coppock Curve",
         "long_roc_period": 14,
         "series_type": "close",
         "short_roc_period": 11,
         "wma_period": 10
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "coppock":"-1.37253"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "coppock":"-1.28978"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "coppock":"-1.14204"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "coppock":"-0.97805"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "coppock":"-0.78209"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/coppock

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
long_roc_period • Parameter is optional
• Number of periods for long term rate of change. Takes values in the range from 1 to 800
• Type int; Default 14
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
short_roc_period • Parameter is optional
• Number of periods for short term rate of change. Takes values in the range from 1 to 800
• Type int; Default 11
wma_period • Parameter is optional
• Number of periods for weighted moving average. Takes values in the range from 1 to 800
• Type int; Default 10
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
coppock coppock value

JSON request example

https://api.twelvedata.com/coppock?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/coppock?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/coppock?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

CORREL

Measures linear correlation between two time series. Takes values in the range from -1 to 1, where -1 is total negative correlation, 0 is no correlation, and 1 is total positive correlation.

This API call returns "meta" and "time_series" values of CORREL. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/correl?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "CORREL - Pearson's Correlation Coefficient",
         "series_type_1": "open",
         "series_type_2": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "correl":"0.93282"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "correl":"0.94333"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "correl":"0.94225"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "correl":"0.9415"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "correl":"0.93658"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/correl

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type_1 • Parameter is optional
• Price type used as the first part of technical indicator
• Type string; Default open
Code Name
0 close
1 open
2 high
3 low
4 volume
series_type_2 • Parameter is optional
• Price type used as the second part of technical indicator
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
correl correl value

JSON request example

https://api.twelvedata.com/correl?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/correl?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/correl?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

CRSI

ConnorsRSI(CRSI) is used to show the oversold and overbought levels of the RSI values.

This API call returns "meta" and "time_series" values of CRSI. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/crsi?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "CRSI - ConnorsRSI",
         "percent_rank_period": 100,
         "rsi_period": 3,
         "series_type": "close",
         "up_down_length": 2
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "crsi":"74.76102"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "crsi":"16.46438"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "crsi":"25.13687"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "crsi":"14.47102"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "crsi":"11.14242"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/crsi

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
percent_rank_period • Parameter is optional
• Number of periods used to calculate PercentRank. Takes values in the range from 1 to 800
• Type int; Default 100
rsi_period • Parameter is optional
• Number of periods for RSI used to calculate price momentum. Takes values in the range from 1 to 800
• Type int; Default 3
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
up_down_length • Parameter is optional
• Number of periods for RSI used to calculate up/down trend. Takes values in the range from 1 to 800
• Type int; Default 2
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
crsi crsi value

JSON request example

https://api.twelvedata.com/crsi?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/crsi?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/crsi?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

DEMA

Double Exponential Moving Average(DEMA) is used to eliminate lag. It does this by taking two Exponential Moving Averages(EMA).

This API call returns "meta" and "time_series" values of DEMA. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/dema?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "DEMA - Double Exponential Moving Average",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "dema":"200.93371"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "dema":"200.98742"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "dema":"201.13274"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "dema":"201.30494"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "dema":"201.5495"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/dema

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
dema dema value

JSON request example

https://api.twelvedata.com/dema?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/dema?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/dema?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

DIV

Division of values of two specified time series.

This API call returns "meta" and "time_series" values of DIV. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/div?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "DIV - Arithmetic Division",
         "series_type_1": "open",
         "series_type_2": "close"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "div":"1.00201"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "div":"1.00144"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "div":"1.0008"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "div":"1.00113"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "div":"1.00343"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/div

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type_1 • Parameter is optional
• Price type used as the first part of technical indicator
• Type string; Default open
Code Name
0 close
1 open
2 high
3 low
4 volume
series_type_2 • Parameter is optional
• Price type used as the second part of technical indicator
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
div div value

JSON request example

https://api.twelvedata.com/div?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/div?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/div?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

DPO

Detrended Price Oscillator(DPO) is used to separate price from the trend, in order to more clearly identify the length of cycles.

This API call returns "meta" and "time_series" values of DPO. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/dpo?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "DPO - Detrended Price Oscillator",
         "centered": false,
         "series_type": "close",
         "time_period": 21
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "dpo":"0.36828"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "dpo":"0.49811"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "dpo":"0.424"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "dpo":"0.35406"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "dpo":"0.25089"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/dpo

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
centered • Parameter is optional
• Specifies if there should be a shift to match the current price
• Type bool; Default false
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 21
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
dpo dpo value

JSON request example

https://api.twelvedata.com/dpo?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/dpo?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/dpo?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

DX

Directional Movement Index(DX) identifies which direction the price is moving.

This API call returns "meta" and "time_series" values of DX. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/dx?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "DX - Directional Movement Index",
         "time_period": 14
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "dx":"68.70803"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "dx":"84.40905"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "dx":"83.62259"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "dx":"82.14874"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "dx":"81.69497"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/dx

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 14
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
dx dx value

JSON request example

https://api.twelvedata.com/dx?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/dx?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/dx?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

EMAHigh Demand

Exponential Moving Average(EMA) places greater importance on recent data points than the normal Moving Average(MA).

This API call returns "meta" and "time_series" values of EMA. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/ema?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "EMA - Exponential Moving Average",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "ema":"201.38109"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "ema":"201.46387"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "ema":"201.59608"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "ema":"201.7401"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "ema":"201.91678"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/ema

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
ema ema value

JSON request example

https://api.twelvedata.com/ema?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/ema?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/ema?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

EXP

Exponential(EXP) transforms input data with the mathematical exponent function.

This API call returns "meta" and "time_series" values of EXP. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/exp?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "EXP - Exponential",
         "series_type": "close"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "exp":"2.0649375034375067e+87"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "exp":"1.8406052690732023e+87"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "exp":"2.003911823447668e+87"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "exp":"2.030939306863562e+87"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "exp":"2.2369241889576382e+87"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/exp

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
exp exp value

JSON request example

https://api.twelvedata.com/exp?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/exp?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/exp?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

FLOOR

Vector FLOOR(FLOOR) transforms input data with the mathematical floor function.

This API call returns "meta" and "time_series" values of FLOOR. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/floor?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "FLOOR - Vector FLOOR",
         "series_type": "close"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "floor":"201.0"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "floor":"200.0"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "floor":"201.0"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "floor":"201.0"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "floor":"201.0"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/floor

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
floor floor value

JSON request example

https://api.twelvedata.com/floor?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/floor?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/floor?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

HEIKINASHICANDLES

Heikin-Ashi Candles(HEIKINASHICANDLES) translated from Japanese means "average bar". It can be used to detect market trends and predict future price fluctuations.

This API call returns "meta" and "time_series" values of HEIKINASHICANDLES. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/heikinashicandles?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "HEIKINASHICANDLES - Heikin-Ashi Candles"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "heikinhighs":"201.25599",
         "heikinopens":"200.9825",
         "heikincloses":"201.02449",
         "heikinlows":"200.85199"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "heikinhighs":"201.13",
         "heikinopens":"201.02",
         "heikincloses":"200.98375",
         "heikinlows":"200.84"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "heikinhighs":"201.07001",
         "heikinopens":"201.0767",
         "heikincloses":"201.005",
         "heikinlows":"200.91"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "heikinhighs":"201.25999",
         "heikinopens":"201.445",
         "heikincloses":"201.1117",
         "heikinlows":"201.0334"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "heikinhighs":"201.75999",
         "heikinopens":"201.77",
         "heikincloses":"201.43",
         "heikinlows":"201.07001"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/heikinashicandles

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
heikincloses heikincloses value
heikinhighs heikinhighs value
heikinlows heikinlows value
heikinopens heikinopens value

JSON request example

https://api.twelvedata.com/heikinashicandles?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/heikinashicandles?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/heikinashicandles?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

HLC3

High, Low, Close Average Values(HLC3) give alternative candlesticks patter. Every element is defined as follows: (high + low + close) / 3.

This API call returns "meta" and "time_series" values of HLC3. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/hlc3?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "HLC3 - High, Low, Close Average Values"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "hlc3":"201.05266"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "hlc3":"200.96833"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "hlc3":"201.00001"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "hlc3":"201.10893"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "hlc3":"201.32"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/hlc3

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
hlc3 hlc3 value

JSON request example

https://api.twelvedata.com/hlc3?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/hlc3?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/hlc3?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

HT_DCPERIOD

Hilbert Transform Dominant Cycle Period(HT_DCPERIOD) is part of Hilbert Transforms concepts. You can read more about it in the Rocket Science for Traders book by John F. Ehlers.

This API call returns "meta" and "time_series" values of HT_DCPERIOD. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/ht_dcperiod?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "HT_DCPERIOD - Hilbert Transform Dominant Cycle Period",
         "series_type": "close"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "ht_dcperiod":"28.12565"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "ht_dcperiod":"27.7569"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "ht_dcperiod":"27.72609"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "ht_dcperiod":"27.26459"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "ht_dcperiod":"27.00303"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/ht_dcperiod

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
ht_dcperiod ht_dcperiod value

JSON request example

https://api.twelvedata.com/ht_dcperiod?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/ht_dcperiod?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/ht_dcperiod?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

HT_DCPHASE

Hilbert Transform Dominant Cycle Phase(HT_DCPHASE) is part of Hilbert Transforms concepts. You can read more about it in the Rocket Science for Traders book by John F. Ehlers.

This API call returns "meta" and "time_series" values of HT_DCPHASE. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/ht_dcphase?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "HT_DCPHASE - Hilbert Transform Dominant Cycle Phase",
         "series_type": "close"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "ht_dcphase":"-38.50975"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "ht_dcphase":"-44.28698"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "ht_dcphase":"310.07743"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "ht_dcphase":"306.54431"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "ht_dcphase":"299.8704"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/ht_dcphase

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
ht_dcphase ht_dcphase value

JSON request example

https://api.twelvedata.com/ht_dcphase?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/ht_dcphase?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/ht_dcphase?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

HT_PHASOR

Hilbert Transform Phasor Components(HT_PHASOR) is part of Hilbert Transforms concepts. You can read more about it in the Rocket Science for Traders book by John F. Ehlers.

This API call returns "meta" and "time_series" values of HT_PHASOR. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/ht_phasor?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "HT_PHASOR - Hilbert Transform Phasor Components",
         "series_type": "close"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "in_phase":"-0.56826",
         "quadrature":"-0.43318"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "in_phase":"-0.61937",
         "quadrature":"-0.09941"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "in_phase":"-0.60477",
         "quadrature":"-0.16807"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "in_phase":"-0.57758",
         "quadrature":"-0.19125"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "in_phase":"-0.52678",
         "quadrature":"-0.33813"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/ht_phasor

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
in_phase in_phase value
quadrature quadrature value

JSON request example

https://api.twelvedata.com/ht_phasor?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/ht_phasor?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/ht_phasor?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

HT_SINE

Hilbert Transform SineWave(HT_SINE) is part of Hilbert Transforms concepts. You can read more about it in the Rocket Science for Traders book by John F. Ehlers.

This API call returns "meta" and "time_series" values of HT_SINE. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/ht_sine?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "HT_SINE - Hilbert Transform SineWave",
         "series_type": "close"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "ht_sine":"-0.62265",
         "ht_leadsine":"0.11303"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "ht_sine":"-0.69825",
         "ht_leadsine":"0.01244"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "ht_sine":"-0.76518",
         "ht_leadsine":"-0.08581"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "ht_sine":"-0.8034",
         "ht_leadsine":"-0.14704"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "ht_sine":"-0.86715",
         "ht_leadsine":"-0.261"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/ht_sine

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
ht_leadsine ht_leadsine value
ht_sine ht_sine value

JSON request example

https://api.twelvedata.com/ht_sine?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/ht_sine?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/ht_sine?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

HT_TRENDLINE

Hilbert Transform Instantaneous Trendline(HT_TRENDLINE) comes from the concept of Digital Signal Processing (DSP). It creates complex signals from the simple chart data. You can read more about it in the Rocket Science for Traders book by John F. Ehlers.

This API call returns "meta" and "time_series" values of HT_TRENDLINE. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/ht_trendline?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "HT_TRENDLINE - Hilbert Transform Instantaneous Trendline",
         "series_type": "close"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "ht_trendline":"202.26597"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "ht_trendline":"202.31889"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "ht_trendline":"202.37263"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "ht_trendline":"202.42115"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "ht_trendline":"202.4659"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/ht_trendline

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
ht_trendline ht_trendline value

JSON request example

https://api.twelvedata.com/ht_trendline?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/ht_trendline?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/ht_trendline?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

HT_TRENDMODE

Hilbert Transform Trend vs. Cycle Mode(HT_TRENDMODE) is part of Hilbert Transforms concepts. You can read more about it in the Rocket Science for Traders book by John F. Ehlers.

This API call returns "meta" and "time_series" values of HT_TRENDMODE. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/ht_trendmode?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "HT_TRENDMODE - Hilbert Transform Trend vs Cycle Mode",
         "series_type": "close"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "ht_trendmode":"0"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "ht_trendmode":"0"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "ht_trendmode":"0"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "ht_trendmode":"0"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "ht_trendmode":"0"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/ht_trendmode

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
ht_trendmode ht_trendmode value

JSON request example

https://api.twelvedata.com/ht_trendmode?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/ht_trendmode?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/ht_trendmode?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

KAMA

Kaufman's Adaptive Moving Average(KAMA) is a type of Moving Average(MA) that incorporates market noise and volatility.

This API call returns "meta" and "time_series" values of KAMA. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/kama?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "KAMA - Kaufman's Adaptive Moving Average",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "kama":"201.06741"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "kama":"201.07559"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "kama":"201.18807"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "kama":"201.32251"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "kama":"201.5538"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/kama

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
kama kama value

JSON request example

https://api.twelvedata.com/kama?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/kama?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/kama?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

KELTNERNew

Keltner Channels(KELTNER) is a volatility indicator used to spot trend changes and accelerations.

This API call returns "meta" and "time_series" values of KELTNER. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/keltner?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "KELTNER - Keltner Channels",
         "atr_time_period": 10,
         "ma_type": "SMA",
         "multiplier": 2,
         "series_type": "close",
         "time_period": 20
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "upper_line":"202.25298",
         "middle_line":"201.80985",
         "lower_line":"201.36672"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "upper_line":"202.29242",
         "middle_line":"201.88983",
         "lower_line":"201.48724"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "upper_line":"202.37322",
         "middle_line":"201.99034",
         "lower_line":"201.60746"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "upper_line":"202.48234",
         "middle_line":"202.09248",
         "lower_line":"201.70262"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "upper_line":"202.58679",
         "middle_line":"202.20396",
         "lower_line":"201.82114"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/keltner

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
atr_time_period • Parameter is optional
• Takes values in the range from 1 to 800
• Type int; Default 10
ma_type • Parameter is optional
• Type of Moving Average to be used
• Type string; Default SMA
Code Name
0 SMA
1 EMA
2 WMA
3 DEMA
4 TEMA
5 TRIMA
6 KAMA
7 MAMA
8 T3MA
multiplier • Parameter is optional
• Multiplier is the number by which the range is shifted
• Type int; Default 2
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 20
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
lower_line lower_line value
middle_line middle_line value
upper_line upper_line value

JSON request example

https://api.twelvedata.com/keltner?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/keltner?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/keltner?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

KST

Know Sure Thing(KST) calculates price momentum for four distinct price cycles(ROC).

This API call returns "meta" and "time_series" values of KST. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/kst?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "KST - Know Sure Thing",
         "roc_period_1": 10,
         "roc_period_2": 15,
         "roc_period_3": 20,
         "roc_period_4": 30,
         "signal_period": 9,
         "sma_period_1": 10,
         "sma_period_2": 10,
         "sma_period_3": 10,
         "sma_period_4": 15
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "kst":"-4.58644",
         "kst_signal":"-2.05236"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "kst":"-3.99247",
         "kst_signal":"-1.50883"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "kst":"-3.30038",
         "kst_signal":"-1.00471"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "kst":"-2.5665",
         "kst_signal":"-0.55332"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "kst":"-1.83607",
         "kst_signal":"-0.16218"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/kst

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
roc_period_1 • Parameter is optional
• Takes values in the range from 1 to 800
• Type int; Default 10
roc_period_2 • Parameter is optional
• Takes values in the range from 1 to 800
• Type int; Default 15
roc_period_3 • Parameter is optional
• Takes values in the range from 1 to 800
• Type int; Default 20
roc_period_4 • Parameter is optional
• Takes values in the range from 1 to 800
• Type int; Default 30
signal_period • Parameter is optional
• Takes values in the range from 1 to 800
• Type int; Default 9
sma_period_1 • Parameter is optional
• Takes values in the range from 1 to 800
• Type int; Default 10
sma_period_2 • Parameter is optional
• Takes values in the range from 1 to 800
• Type int; Default 10
sma_period_3 • Parameter is optional
• Takes values in the range from 1 to 800
• Type int; Default 10
sma_period_4 • Parameter is optional
• Takes values in the range from 1 to 800
• Type int; Default 15
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
kst kst value
kst_signal kst_signal value

JSON request example

https://api.twelvedata.com/kst?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/kst?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/kst?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

LINEARREG

Linear Regression(LINEARREG) is used to determine trend direction by a straight line.

This API call returns "meta" and "time_series" values of LINEARREG. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/linearreg?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "LINEARREG - Linear Regression",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "linearreg":"200.79327"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "linearreg":"200.83317"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "linearreg":"200.98073"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "linearreg":"201.16126"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "linearreg":"201.39886"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/linearreg

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
linearreg linearreg value

JSON request example

https://api.twelvedata.com/linearreg?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/linearreg?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/linearreg?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

LINEARREGANGLE

Linear Regression Angle(LINEARREGANGLE) calculates the angle of the linear regression trendline.

This API call returns "meta" and "time_series" values of LINEARREGANGLE. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/linearregangle?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "LINEARREGANGLE - Linear Regression Angle",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "linearregangle":"-8.79357"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "linearregangle":"-10.00332"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "linearregangle":"-10.08348"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "linearregangle":"-9.78514"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "linearregangle":"-8.99228"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/linearregangle

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
linearregangle linearregangle value

JSON request example

https://api.twelvedata.com/linearregangle?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/linearregangle?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/linearregangle?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

LINEARREGINTERCEPT

Linear Regression Intercept(LINEARREGINTERCEPT) calculates the intercept for the linear regression trendline for each data point.

This API call returns "meta" and "time_series" values of LINEARREGINTERCEPT. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/linearregintercept?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "LINEARREGINTERCEPT - Linear Regression Intercept",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "linearregintercept":"202.03082"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "linearregintercept":"202.24426"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "linearregintercept":"202.40337"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "linearregintercept":"202.54097"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "linearregintercept":"202.66483"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/linearregintercept

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
linearregintercept linearregintercept value

JSON request example

https://api.twelvedata.com/linearregintercept?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/linearregintercept?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/linearregintercept?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

LINEARREGSLOPE

Linear Regression Slope(LINEARREGSLOPE) calculates the slope for the linear regression trendline for each data point.

This API call returns "meta" and "time_series" values of LINEARREGSLOPE. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/linearregslope?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "LINEARREGSLOPE - Linear Regression Slope",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "linearregslope":"-0.15469"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "linearregslope":"-0.17639"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "linearregslope":"-0.17783"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "linearregslope":"-0.17246"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "linearregslope":"-0.15825"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/linearregslope

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
linearregslope linearregslope value

JSON request example

https://api.twelvedata.com/linearregslope?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/linearregslope?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/linearregslope?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

LN

Natural Logarithm to the base of constant e(LN) transforms all data points with natural logarithm.

This API call returns "meta" and "time_series" values of LN. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/ln?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "LN - Natural Logarithm to the base of constant e",
         "series_type": "close"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "ln":"5.30355"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "ln":"5.30298"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "ln":"5.3034"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "ln":"5.30347"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "ln":"5.30395"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/ln

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
ln ln value

JSON request example

https://api.twelvedata.com/ln?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/ln?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/ln?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

LOG10

Logarithm to base 10(LOG10) transforms all data points with logarithm to base 10.

This API call returns "meta" and "time_series" values of LOG10. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/log10?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "LOG10 - Logarithm to base 10",
         "series_type": "close"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "log10":"2.3033"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "log10":"2.30306"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "log10":"2.30324"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "log10":"2.30327"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "log10":"2.30348"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/log10

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
log10 log10 value

JSON request example

https://api.twelvedata.com/log10?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/log10?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/log10?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MA

Moving Average(MA) is used to smooth out price fluctuations and get rid of market noise.

This API call returns "meta" and "time_series" values of MA. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/ma?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MA - Moving Average",
         "ma_type": "SMA",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "ma":"201.41205"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "ma":"201.53871"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "ma":"201.69205"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "ma":"201.85111"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "ma":"202.03185"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/ma

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
ma_type • Parameter is optional
• Type of Moving Average to be used
• Type string; Default SMA
Code Name
0 SMA
1 EMA
2 WMA
3 DEMA
4 TEMA
5 TRIMA
6 KAMA
7 MAMA
8 T3MA
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
ma ma value

JSON request example

https://api.twelvedata.com/ma?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/ma?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/ma?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MACDHigh Demand

Moving Average Convergence Divergence(MACD) is a trend following momentum indicator, which works by subtracting the longer moving average from the shorter one. MACD has an unstable period ~ 100.

This API call returns "meta" and "time_series" values of MACD. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/macd?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MACD - Moving Average Convergence Divergence",
         "fast_period": 12,
         "series_type": "close",
         "signal_period": 9,
         "slow_period": 26
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "macd":"-0.3998",
         "macd_signal":"-0.25279",
         "macd_hist":"-0.147"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "macd":"-0.38253",
         "macd_signal":"-0.21604",
         "macd_hist":"-0.16649"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "macd":"-0.34322",
         "macd_signal":"-0.17442",
         "macd_hist":"-0.1688"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "macd":"-0.29671",
         "macd_signal":"-0.13222",
         "macd_hist":"-0.16449"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "macd":"-0.23439",
         "macd_signal":"-0.0911",
         "macd_hist":"-0.14329"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/macd

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
fast_period • Parameter is optional
• Number of periods for fast moving average. Takes values in the range from 1 to 800
• Type int; Default 12
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
signal_period • Parameter is optional
• Takes values in the range from 1 to 800
• Type int; Default 9
slow_period • Parameter is optional
• Number of periods for slow moving average. Takes values in the range from 1 to 800
• Type int; Default 26
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
macd macd value
macd_hist macd_hist value
macd_signal macd_signal value

JSON request example

https://api.twelvedata.com/macd?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/macd?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/macd?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MACDEXT

Moving Average Convergence Divergence Extended(MACDEXT) gives greater control over MACD input parameters. MACDEXT has an unstable period ~ 100.

This API call returns "meta" and "time_series" values of MACDEXT. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/macdext?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MACDEXT - Moving Average Convergence Divergence Extended",
         "fast_ma_type": "SMA",
         "fast_period": 12,
         "series_type": "close",
         "signal_ma_type": "SMA",
         "signal_period": 9,
         "slow_ma_type": "SMA",
         "slow_period": 26
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "macd":"-0.54508",
         "macd_signal":"-0.25615",
         "macd_hist":"-0.28894"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "macd":"-0.47169",
         "macd_signal":"-0.19324",
         "macd_hist":"-0.27845"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "macd":"-0.39004",
         "macd_signal":"-0.13498",
         "macd_hist":"-0.25506"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "macd":"-0.3087",
         "macd_signal":"-0.08378",
         "macd_hist":"-0.22492"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "macd":"-0.23315",
         "macd_signal":"-0.03994",
         "macd_hist":"-0.1932"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/macdext

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
fast_ma_type • Parameter is optional
• Type of Moving Average to be used on Fast Period
• Type string; Default SMA
Code Name
0 SMA
1 EMA
2 WMA
3 DEMA
4 TEMA
5 TRIMA
6 KAMA
7 MAMA
8 T3MA
fast_period • Parameter is optional
• Number of periods for fast moving average. Takes values in the range from 1 to 800
• Type int; Default 12
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
signal_ma_type • Parameter is optional
• Type of Moving Average to be used on Signal Period
• Type string; Default SMA
Code Name
0 SMA
1 EMA
2 WMA
3 DEMA
4 TEMA
5 TRIMA
6 KAMA
7 MAMA
8 T3MA
signal_period • Parameter is optional
• Takes values in the range from 1 to 800
• Type int; Default 9
slow_ma_type • Parameter is optional
• Type of Moving Average to be used on Slow Period
• Type string; Default SMA
Code Name
0 SMA
1 EMA
2 WMA
3 DEMA
4 TEMA
5 TRIMA
6 KAMA
7 MAMA
8 T3MA
slow_period • Parameter is optional
• Number of periods for slow moving average. Takes values in the range from 1 to 800
• Type int; Default 26
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
macd macd value
macd_hist macd_hist value
macd_signal macd_signal value

JSON request example

https://api.twelvedata.com/macdext?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/macdext?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/macdext?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MAMA

MESA Adaptive Moving Average(MAMA) adapts to price fluctuations based on the rate of change of the Hilbert Transform Discriminator. More about MAMA can be read here.

This API call returns "meta" and "time_series" values of MAMA. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/mama?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MAMA - MESA Adaptive Moving Average",
         "fast_limit": 0.5,
         "series_type": "close",
         "slow_limit": 0.05
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "mama":"201.38887",
         "fama":"202.05517"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "mama":"201.72774",
         "fama":"202.27727"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "mama":"201.79478",
         "fama":"202.29956"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "mama":"201.96391",
         "fama":"202.34923"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "mama":"202.01288",
         "fama":"202.35911"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/mama

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
fast_limit • Parameter is optional
• Type double; Default 0.5
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
slow_limit • Parameter is optional
• Type double; Default 0.05
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
fama fama value
mama mama value

JSON request example

https://api.twelvedata.com/mama?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/mama?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/mama?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MAX

Highest value over period(MAX).

This API call returns "meta" and "time_series" values of MAX. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/max?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MAX - Highest value over period",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "max":"202.05"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "max":"202.19"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "max":"202.315"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "max":"202.4516"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "max":"202.66"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/max

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
max max value

JSON request example

https://api.twelvedata.com/max?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/max?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/max?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MAXINDEX

Index of highest value over period(MAXINDEX).

This API call returns "meta" and "time_series" values of MAXINDEX. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/maxindex?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MAXINDEX - Index of highest value over period",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "maxidx":"491"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "maxidx":"490"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "maxidx":"489"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "maxidx":"488"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "maxidx":"487"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/maxindex

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
maxidx maxidx value

JSON request example

https://api.twelvedata.com/maxindex?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/maxindex?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/maxindex?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MCGINLEY_DYNAMIC

McGinley Dynamic(MCGINLEY_DYNAMIC) keeps all the benefits from the moving averages but adds an adjustment to market speed.

This API call returns "meta" and "time_series" values of MCGINLEY_DYNAMIC. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/mcginley_dynamic?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MCGINLEY_DYNAMIC - McGinley Dynamic",
         "time_period": 14
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "mcginley_dynamic":"201.93983"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "mcginley_dynamic":"202.00969"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "mcginley_dynamic":"202.09444"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "mcginley_dynamic":"202.17916"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "mcginley_dynamic":"202.26966"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/mcginley_dynamic

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 14
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
mcginley_dynamic mcginley_dynamic value

JSON request example

https://api.twelvedata.com/mcginley_dynamic?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/mcginley_dynamic?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/mcginley_dynamic?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MEDPRICE

Median Price(MEDPRICE).

This API call returns "meta" and "time_series" values of MEDPRICE. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/medprice?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MEDPRICE - Median Price"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "medprice":"201.05399"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "medprice":"200.985"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "medprice":"200.99001"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "medprice":"201.1467"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "medprice":"201.415"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/medprice

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
medprice medprice value

JSON request example

https://api.twelvedata.com/medprice?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/medprice?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/medprice?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MFI

Money Flow Index(MFI) is used to identify overbought and oversold levels in an asset. In some cases, it can be used to detect divergences, which might be a sign of upcoming trend changes.

This API call returns "meta" and "time_series" values of MFI. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/mfi?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MFI - Money Flow Index",
         "time_period": 14
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "mfi":"22.68525"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "mfi":"6.39625"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "mfi":"7.00498"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "mfi":"7.36599"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "mfi":"7.91187"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/mfi

API Parameters

Parameter Details
symbol • Required parameter
• Name of instrument you want to request
• For preffered stocks use dot(.) delimiter
E.g. BRK.A or BRK.B will be correct
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 14
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
mfi mfi value

JSON request example

https://api.twelvedata.com/mfi?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/mfi?symbol=XOM&exchange=NYSE&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/mfi?symbol=GS&interval=30min&format=CSV&apikey=demo

MIDPOINT

MidPoint over period(MIDPOINT) is calculated as (highest value + lowest value) / 2.

This API call returns "meta" and "time_series" values of MIDPOINT. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/midpoint?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MIDPOINT - MidPoint over period",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "midpoint":"201.4925"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "midpoint":"201.5625"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "midpoint":"201.6675"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "midpoint":"201.7425"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "midpoint":"201.895"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/midpoint

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
midpoint midpoint value

JSON request example

https://api.twelvedata.com/midpoint?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/midpoint?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/midpoint?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MIDPRICE

Midpoint Price over period(MIDPRICE) is calculated as (highest high + lowest low) / 2.

This API call returns "meta" and "time_series" values of MIDPRICE. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/midprice?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MIDPRICE - Midpoint Price over period",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "midprice":"201.535"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "midprice":"201.595"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "midprice":"201.68501"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "midprice":"201.8417"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "midprice":"201.88"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/midprice

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
midprice midprice value

JSON request example

https://api.twelvedata.com/midprice?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/midprice?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/midprice?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MIN

Lowest value over period(MIN).

This API call returns "meta" and "time_series" values of MIN. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/min?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MIN - Lowest value over period",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "min":"200.935"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "min":"200.935"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "min":"201.02"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "min":"201.0334"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "min":"201.13"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/min

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
min min value

JSON request example

https://api.twelvedata.com/min?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/min?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/min?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MININDEX

Index of lowest value over period(MININDEX).

This API call returns "meta" and "time_series" values of MININDEX. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/minindex?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MININDEX - Index of lowest value over period",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "minidx":"498"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "minidx":"498"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "minidx":"497"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "minidx":"496"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "minidx":"495"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/minindex

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
minidx minidx value

JSON request example

https://api.twelvedata.com/minindex?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/minindex?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/minindex?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MINMAX

Lowest and highest values over period(MINMAX).

This API call returns "meta" and "time_series" values of MINMAX. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/minmax?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MINMAX - Lowest and highest values over period",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "min":"200.935",
         "max":"202.05"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "min":"200.935",
         "max":"202.19"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "min":"201.02",
         "max":"202.315"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "min":"201.0334",
         "max":"202.4516"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "min":"201.13",
         "max":"202.66"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/minmax

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
max max value
min min value

JSON request example

https://api.twelvedata.com/minmax?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/minmax?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/minmax?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MINMAXINDEX

Indexes of lowest and highest values over period(MINMAXINDEX).

This API call returns "meta" and "time_series" values of MINMAXINDEX. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/minmaxindex?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MINMAXINDEX - Indexes of lowest and highest values over period",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "minidx":"498",
         "maxidx":"491"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "minidx":"498",
         "maxidx":"490"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "minidx":"497",
         "maxidx":"489"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "minidx":"496",
         "maxidx":"488"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "minidx":"495",
         "maxidx":"487"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/minmaxindex

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
maxidx maxidx value
minidx minidx value

JSON request example

https://api.twelvedata.com/minmaxindex?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/minmaxindex?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/minmaxindex?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MINUS_DI

Minus Directional Indicator(MINUS_DI) is a component of the Average Directional Index(ADX), and it measures the existence of downtrend.

This API call returns "meta" and "time_series" values of MINUS_DI. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/minus_di?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MINUS_DI - Minus Directional Indicator",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "minus_di":"46.60579"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "minus_di":"57.93427"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "minus_di":"64.13795"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "minus_di":"62.85341"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "minus_di":"69.49652"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/minus_di

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
minus_di minus_di value

JSON request example

https://api.twelvedata.com/minus_di?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/minus_di?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/minus_di?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MINUS_DM

Minus Directional Movement(MINUS_DM) is calculated as Previous Low - Low.

This API call returns "meta" and "time_series" values of MINUS_DM. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/minus_dm?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MINUS_DM - Minus Directional Movement",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "minus_dm":"0.96291"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "minus_dm":"1.08327"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "minus_dm":"1.13992"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "minus_dm":"1.14359"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "minus_dm":"1.24536"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/minus_dm

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
minus_dm minus_dm value

JSON request example

https://api.twelvedata.com/minus_dm?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/minus_dm?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/minus_dm?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MOM

Momentum(MOM) compares the current price with the previous price N timeperiods ago.

This API call returns "meta" and "time_series" values of MOM. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/mom?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MOM - Momentum",
         "series_type": "close",
         "time_period": 9
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "mom":"-1.14"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "mom":"-1.38"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "mom":"-1.43159"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "mom":"-1.6266"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "mom":"-1.5347"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/mom

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 9
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
mom mom value

JSON request example

https://api.twelvedata.com/mom?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/mom?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/mom?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

MULT

Multiplication of values of two specified time series.

This API call returns "meta" and "time_series" values of MULT. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/mult?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "MULT - Arithmetic Multiply",
         "series_type_1": "open",
         "series_type_2": "close"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "mult":"40422.66609"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "mult":"40394.94944"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "mult":"40396.97591"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "mult":"40459.98128"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "mult":"40567.88357"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/mult

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type_1 • Parameter is optional
• Price type used as the first part of technical indicator
• Type string; Default open
Code Name
0 close
1 open
2 high
3 low
4 volume
series_type_2 • Parameter is optional
• Price type used as the second part of technical indicator
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
mult mult value

JSON request example

https://api.twelvedata.com/mult?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/mult?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/mult?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

NATR

Normalized Average True Range(NATR) is used to compare and analyze across different price levels due to its normalized quality, which might be more effective than the original ATR.

This API call returns "meta" and "time_series" values of NATR. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/natr?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "NATR - Normalized Average True Range",
         "time_period": 14
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "natr":"0.09862"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "natr":"0.0908"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "natr":"0.08665"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "natr":"0.08719"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "natr":"0.08518"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/natr

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 14
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
natr natr value

JSON request example

https://api.twelvedata.com/natr?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/natr?symbol=XRP/ETH&exchange=Upbit&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/natr?symbol=EUR/USD&interval=30min&format=CSV&apikey=demo

OBV

On Balance Volume(OBV) is a momentum indicator, which uses volume flow to forecast upcoming price changes.

This API call returns "meta" and "time_series" values of OBV. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/obv?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "OBV - On Balance Volume",
         "series_type": "close"
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "obv":"540374.0"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "obv":"68087.0"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "obv":"277941.0"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "obv":"426973.0"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "obv":"605865.0"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/obv

API Parameters

Parameter Details
symbol • Required parameter
• Name of instrument you want to request
• For preffered stocks use dot(.) delimiter
E.g. BRK.A or BRK.B will be correct
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string

Response

Key Description
meta json object with request general information
datetime datetime in local market time for equities and in UTC for forex and cryptocurrencies referring to when the bar with specified interval was opened
obv obv value

JSON request example

https://api.twelvedata.com/obv?symbol=AAPL&interval=1min&apikey=demo

https://api.twelvedata.com/obv?symbol=XOM&exchange=NYSE&interval=1day&outputsize=24&apikey=demo

Downloadable CSV example

https://api.twelvedata.com/obv?symbol=GS&interval=30min&format=CSV&apikey=demo

PERCENT_BHigh Demand

%B Indicator(PERCENT_B) measures the position of an asset price relative to upper and lower Bollinger Bands.

This API call returns "meta" and "time_series" values of PERCENT_B. "meta" object consist of general information about the requested technical indicator. "time_series" is the array of objects ordered by time descending updated in real-time.

HTTP request example

https://api.twelvedata.com/percent_b?symbol=AAPL&interval=1min&apikey=your_api_key

This request will return JSON with the following structure

{
   "meta":{
      "symbol": "AAPL",
      "interval": "1min",
      "currency": "USD",
      "exchange_timezone": "America/New_York",
      "exchange": "NYSE",
      "type": "Common Stock",
      "indicator": {
         "name": "PERCENT_B - %B Indicator",
         "ma_type": "SMA",
         "sd": 2,
         "series_type": "close",
         "time_period": 20
      }
   },
   "values":[
      {
         "datetime":"2019-08-09 15:59:00",
         "percent_b":"0.11981"
      },
      {
         "datetime":"2019-08-09 15:58:00",
         "percent_b":"0.02546"
      },
      {
         "datetime":"2019-08-09 15:57:00",
         "percent_b":"-0.01907"
      },
      {
         "datetime":"2019-08-09 15:56:00",
         "percent_b":"-0.11711"
      },
      {
         "datetime":"2019-08-09 15:55:00",
         "percent_b":"-0.23276"
      },
      {...}
   ],
   "status":"ok"
}

HTTP route

/percent_b

API Parameters

Parameter Details
symbol • Required parameter
• Instrument symbol, can be any equity, index, ETF, forex or cryptocurrency
E.g. AAPL, EUR/USD, ETH/BTC, ...
• Type string
interval • Required parameter
• Interval between two consecutive points in time series
• Supports: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month
exchange • Parameter is optional
• Applicable to stocks, indices, ETFs and cryptocurrencies, otherwise is ignored
• Exchange where instrument is traded
• Type string
country • Parameter is optional
• Applicable to stocks, indices and ETFs, otherwise is ignored
• Country where instrument is traded
• Type string
ma_type • Parameter is optional
• Type of Moving Average to be used
• Type string; Default SMA
Code Name
0 SMA
1 EMA
2 WMA
3 DEMA
4 TEMA
5 TRIMA
6 KAMA
7 MAMA
8 T3MA
sd • Parameter is optional
• Number of standard deviations. Must be at least 1
• Type double; Default 2
series_type • Parameter is optional
• Price type on which technical indicator is calculated
• Type string; Default close
Code Name
0 close
1 open
2 high
3 low
4 volume
time_period • Parameter is optional
• Number of periods to average over. Takes values in the range from 1 to 800
• Type int; Default 20
type • Parameter is optional
• Type to which instrument belongs
• Supports: Stock, Index, ETF, REIT
outputsize • Parameter is optional
• Number of data points to retrieve
• Type int; Supports values in the range from 1 to 5000
• Default 30 when no date parameters are set, otherwise set to maximum
format • Parameter is optional
• Value can be CSV or JSON
• Type string; Default JSON
apikey • Required parameter
• Your API Key, which you can obtain for free here
• Type string