Getting your API Key
2. After confirming the email address you will see the API Key in the dashboard.
Confirm email
Go to your email inbox and click the blue confirmation button.
How requests work

- A Prefix is a compulsory, non-changeable part
- The Endpoint is compulsory and might be
/time_series
- for stocks, crypto and forex quotes/bbands
,/macd
,/rsi
, … - or any other indicator; a full list might be found in Technical Indicators section
- Parameters allow you to perfectly adjust the request to your needs.
Three parameters are required:
symbol
- stock ticker (e.g. AAPL, MSFT), physical currency pair (e.g. EUR/USD, CNY/JPY) or digital currency pair (BTC/USD, XRP/ETH)interval
- time frame (e.g. 1min, 5min, … , 1month)apikey
- your personal API Key obtained from the previous step
format
- output format acceptsjson
orcsv
(json
by default)outputsize
- number of recent data points to retrieve (e.g.12
will show the most recent twelve quotes)start_date
- start date and time of sampling period, acceptsyyyy-MM-dd
oryyyy-MM-dd hh:mm:ss
formatend_date
- end date and time of sampling period, acceptsyyyy-MM-dd
oryyyy-MM-dd hh:mm:ss
formatexchange
- if symbol is traded in multiple exchanges specify the desired one, valid for both stocks and cryptocurrencies
All parameters should be ampersand(&) separated. For a full list of available parameters refer to API Documentation
Mastering request understanding
API request examples
CSV
format, which is very convenient for using in spreadsheets such as Excel, Google Docs or OpenOffice Calc. Remember that outputsize
by default equals 30.
https://api.twelvedata.com/time_series?symbol=CNY/JPY&interval=1day&apikey=your_apikey
This call returns the last 30 trading days’ quotes for Chinese yuan against Japanese yen in JSON format.
https://api.twelvedata.com/time_series?symbol=MSFT&interval=5min&format=csv&start_date=2019-12-04&apikey=your_apikey
This stock API call will return all quotes for the Microsoft Corporation starting from December 4th 2019 up to the latest data point with five-minute intervals in CSV format.
https://api.twelvedata.com/time_series?symbol=BTC/ETH&exchange=Huobi&interval=1h&start_date=2019-12-01&end_date=2019-12-05&apikey=your_apikey
This call will return quotes for Ethereum against Bitcoin from the Huobi cryptocurrency exchange in date range from 2019-12-01 to 2019-12-05 with one-hour intervals.
https://api.twelvedata.com/bbands?symbol=AAPL&interval=1min&apikey=your_apikey
This stock API call returns 30 recent calculations of the Bollinger Band indicator in one-minute intervals for Apple stock.
https://api.twelvedata.com/macd?symbol=BTC/USD&interval=30min&outputsize=100&dp=8&apikey=your_apikey
This request will return MACD indicator 100 recent data points (MACD, MACD Signal and MACD Histogram) with eight decimal places accuracy where applicable for Bitcoin against the US Dollar.
Explore advantage
As we have shown above, API parameters can be combined in arbitrary order in order to build and obtain necessary data.