{ "info": { "_postman_id": "5b7a9924-99e9-4a4f-8541-f73f127202e3", "name": "Twelve Data API", "description": "## Overview\n\nWelcome to Twelve Data developer docs \u2014 your gateway to comprehensive financial market data through a powerful and easy-to-use API.\nTwelve Data provides access to financial markets across over 50 global countries, covering more than 1 million public instruments, including stocks, forex, ETFs, mutual funds, commodities, and cryptocurrencies.\n\n## Quickstart\n\nTo get started, you'll need to sign up for an API key. Once you have your API key, you can start making requests to the API.\n\n### Step 1: Create Twelve Data account\n\nSign up on the Twelve Data website to create your account [here](https://twelvedata.com/register). This gives you access to the API dashboard and your API key.\n\n### Step 2: Get your API key\n\nAfter signing in, navigate to your [dashboard](https://twelvedata.com/account/api-keys) to find your unique API key. This key is required to authenticate all API and WebSocket requests.\n\n### Step 3: Make your first request\n\nTry a simple API call with cURL to fetch the latest price for Apple (AAPL):\n\n```\ncurl \"https://api.twelvedata.com/price?symbol=AAPL&apikey=your_api_key\"\n```\n\n### Step 4: Make a request from Python or Javascript\n\nUse our client libraries or standard HTTP clients to make API calls programmatically. Here\u2019s an example in [Python](https://github.com/twelvedata/twelvedata-python) and [Node.js](https://github.com/twelvedata/twelvedata-node):\n\n#### Python (using official Twelve Data SDK):\n\n```python\nfrom twelvedata import TDClient\n\n# Initialize client with your API key\ntd = TDClient(apikey=\"your_api_key\")\n\n# Get latest price for Apple\nprice = td.price(symbol=\"AAPL\").as_json()\n\nprint(price)\n```\n\n#### JavaScript (Node.js):\n\n```javascript\nimport { MarketDataApi, CreateConfig } from \"@twelvedata/twelvedata-node\";\n\nconst config = CreateConfig('your_api_key');\nconst api = new MarketDataApi(config);\n\nasync function main() {\n const response = await api.getPrice({\n symbol: \"AAPL\",\n });\n console.log(response.data);\n}\n\nmain().catch(console.error);\n```\n\n### Step 5: Perform correlation analysis between Tesla and Microsoft prices\n\nFetch historical price data for Tesla (TSLA) and Microsoft (MSFT) and calculate the correlation of their closing prices:\n\n```python\nfrom twelvedata import TDClient\nimport pandas as pd\n\n# Initialize client with your API key\ntd = TDClient(apikey=\"your_api_key\")\n\n# Fetch historical price data for Tesla\ntsla_ts = td.time_series(\n symbol=\"TSLA\",\n interval=\"1day\",\n outputsize=100\n).as_pandas()\n\n# Fetch historical price data for Microsoft\nmsft_ts = td.time_series(\n symbol=\"MSFT\",\n interval=\"1day\",\n outputsize=100\n).as_pandas()\n\n# Align data on datetime index\ncombined = pd.concat(\n [tsla_ts['close'].astype(float), msft_ts['close'].astype(float)],\n axis=1,\n keys=[\"TSLA\", \"MSFT\"]\n).dropna()\n\n# Calculate correlation\ncorrelation = combined[\"TSLA\"].corr(combined[\"MSFT\"])\nprint(f\"Correlation of closing prices between TSLA and MSFT: {correlation:.2f}\")\n```\n\n### Authentication\n\nAuthenticate your requests using one of these methods:\n\n#### Query parameter method\n```\nGET https://api.twelvedata.com/endpoint?symbol=AAPL&apikey=your_api_key\n```\n\n#### HTTP header method (recommended)\n```\nAuthorization: apikey your_api_key\n```\n\n##### API key useful information\n
apikey=demo) available for demo requests& to separate multiple parameterssymbol=AAPL = symbol=aapl)null value handling in your application429 Too Many Requests).Exchange for local exchange timeUTC for datetime at universal UTC standardAmerica/New_York, Asia/Singapore. Full list of timezones can be found hereInterval Limitation: The timezone parameter is only applicable for intraday intervals (less than 1 day). For intervals of 1day, 1week, or 1month, the timezone parameter is ignored, and data is strictly returned in the Exchange local time.
\nTake note that the IANA Timezone name is case-sensitive", "key": "timezone", "value": "Exchange" }, { "description": "Can be used separately and together with `end_date`. Format `2006-01-02` or `2006-01-02T15:04:05`\n\nDefault location:\nUTCAmerica/New_York)timezone parameter is provided.timezone is given then, start_date and end_date will be used in the specified location\n\nExamples:\n&symbol=AAPL&start_date=2019-08-09T15:50:00&\u2026&symbol=EUR/USD&timezone=Asia/Singapore&start_date=2019-08-09T15:50:00&\u2026&symbol=ETH/BTC&timezone=Europe/Zurich&start_date=2019-08-09T15:50:00&end_date=2019-08-09T15:55:00&...Exchange for local exchange timeUTC for datetime at universal UTC standardAmerica/New_York, Asia/Singapore. Full list of timezones can be found hereInterval Limitation: The timezone parameter is only applicable for intraday intervals (less than 1 day). For intervals of 1day, 1week, or 1month, the timezone parameter is ignored, and data is strictly returned in the Exchange local time.
\nTake note that the IANA Timezone name is case-sensitive", "key": "timezone", "value": "Exchange" }, { "description": "Can be used separately and together with `end_date`. Format `2006-01-02` or `2006-01-02T15:04:05`\n\nDefault location:\nUTCAmerica/New_York)timezone parameter is provided.timezone is given then, start_date and end_date will be used in the specified location\n\nExamples:\n&symbol=AAPL&start_date=2019-08-09T15:50:00&\u2026&symbol=EUR/USD&timezone=Asia/Singapore&start_date=2019-08-09T15:50:00&\u2026&symbol=ETH/BTC&timezone=Europe/Zurich&start_date=2019-08-09T15:50:00&end_date=2019-08-09T15:55:00&...Exchange for local exchange timeUTC for datetime at universal UTC standardAmerica/New_York, Asia/Singapore. Full list of timezones can be found hereInterval Limitation: The timezone parameter is only applicable for intraday intervals (less than 1 day). For intervals of 1day, 1week, or 1month, the timezone parameter is ignored, and data is strictly returned in the Exchange local time.
\nTake note that the IANA Timezone name is case-sensitive", "key": "timezone", "value": "Exchange" }, { "description": "Can be used separately and together with `end_date`. Format `2006-01-02` or `2006-01-02T15:04:05`\n\nDefault location:\nUTCAmerica/New_York)timezone parameter is provided.timezone is given then, start_date and end_date will be used in the specified location\n\nExamples:\n&symbol=AAPL&start_date=2019-08-09T15:50:00&\u2026&symbol=EUR/USD&timezone=Asia/Singapore&start_date=2019-08-09T15:50:00&\u2026&symbol=ETH/BTC&timezone=Europe/Zurich&start_date=2019-08-09T15:50:00&end_date=2019-08-09T15:55:00&...Exchange for local exchange timeUTC for datetime at universal UTC standardAmerica/New_York, Asia/Singapore. Full list of timezones can be found hereInterval Limitation: The timezone parameter is only applicable for intraday intervals (less than 1 day). For intervals of 1day, 1week, or 1month, the timezone parameter is ignored, and data is strictly returned in the Exchange local time.
\nTake note that the IANA Timezone name is case-sensitive", "key": "timezone", "value": "Exchange" }, { "description": "Can be used separately and together with `end_date`. Format `2006-01-02` or `2006-01-02T15:04:05`\n\nDefault location:\nUTCAmerica/New_York)timezone parameter is provided.timezone is given then, start_date and end_date will be used in the specified location\n\nExamples:\n&symbol=AAPL&start_date=2019-08-09T15:50:00&\u2026&symbol=EUR/USD&timezone=Asia/Singapore&start_date=2019-08-09T15:50:00&\u2026&symbol=ETH/BTC&timezone=Europe/Zurich&start_date=2019-08-09T15:50:00&end_date=2019-08-09T15:55:00&...Exchange for local exchange timeUTC for datetime at universal UTC standardAmerica/New_York, Asia/Singapore. Full list of timezones can be found hereInterval Limitation: The timezone parameter is only applicable for intraday intervals (less than 1 day). For intervals of 1day, 1week, or 1month, the timezone parameter is ignored, and data is strictly returned in the Exchange local time.
\nTake note that the IANA Timezone name is case-sensitive", "key": "timezone", "value": "Exchange" }, { "description": "Can be used separately and together with `end_date`. Format `2006-01-02` or `2006-01-02T15:04:05`\n\nDefault location:\nUTCAmerica/New_York)timezone parameter is provided.timezone is given then, start_date and end_date will be used in the specified location\n\nExamples:\n&symbol=AAPL&start_date=2019-08-09T15:50:00&\u2026&symbol=EUR/USD&timezone=Asia/Singapore&start_date=2019-08-09T15:50:00&\u2026&symbol=ETH/BTC&timezone=Europe/Zurich&start_date=2019-08-09T15:50:00&end_date=2019-08-09T15:55:00&...Exchange for local exchange timeUTC for datetime at universal UTC standardAmerica/New_York, Asia/Singapore. Full list of timezones can be found hereInterval Limitation: The timezone parameter is only applicable for intraday intervals (less than 1 day). For intervals of 1day, 1week, or 1month, the timezone parameter is ignored, and data is strictly returned in the Exchange local time.
\nTake note that the IANA Timezone name is case-sensitive", "key": "timezone", "value": "Exchange" }, { "description": "Can be used separately and together with `end_date`. Format `2006-01-02` or `2006-01-02T15:04:05`\n\nDefault location:\nUTCAmerica/New_York)timezone parameter is provided.timezone is given then, start_date and end_date will be used in the specified location\n\nExamples:\n&symbol=AAPL&start_date=2019-08-09T15:50:00&\u2026&symbol=EUR/USD&timezone=Asia/Singapore&start_date=2019-08-09T15:50:00&\u2026&symbol=ETH/BTC&timezone=Europe/Zurich&start_date=2019-08-09T15:50:00&end_date=2019-08-09T15:55:00&...Exchange for local exchange timeUTC for datetime at universal UTC standardAmerica/New_York, Asia/Singapore. Full list of timezones can be found hereInterval Limitation: The timezone parameter is only applicable for intraday intervals (less than 1 day). For intervals of 1day, 1week, or 1month, the timezone parameter is ignored, and data is strictly returned in the Exchange local time.
\nTake note that the IANA Timezone name is case-sensitive", "key": "timezone", "value": "Exchange" }, { "description": "Can be used separately and together with `end_date`. Format `2006-01-02` or `2006-01-02T15:04:05`\n\nDefault location:\nUTCAmerica/New_York)timezone parameter is provided.timezone is given then, start_date and end_date will be used in the specified location\n\nExamples:\n&symbol=AAPL&start_date=2019-08-09T15:50:00&\u2026&symbol=EUR/USD&timezone=Asia/Singapore&start_date=2019-08-09T15:50:00&\u2026&symbol=ETH/BTC&timezone=Europe/Zurich&start_date=2019-08-09T15:50:00&end_date=2019-08-09T15:55:00&...Exchange for local exchange timeUTC for datetime at universal UTC standardAmerica/New_York, Asia/Singapore. Full list of timezones can be found hereInterval Limitation: The timezone parameter is only applicable for intraday intervals (less than 1 day). For intervals of 1day, 1week, or 1month, the timezone parameter is ignored, and data is strictly returned in the Exchange local time.
\nTake note that the IANA Timezone name is case-sensitive", "key": "timezone", "value": "Exchange" }, { "description": "Can be used separately and together with `end_date`. Format `2006-01-02` or `2006-01-02T15:04:05`\n\nDefault location:\nUTCAmerica/New_York)timezone parameter is provided.timezone is given then, start_date and end_date will be used in the specified location\n\nExamples:\n&symbol=AAPL&start_date=2019-08-09T15:50:00&\u2026&symbol=EUR/USD&timezone=Asia/Singapore&start_date=2019-08-09T15:50:00&\u2026&symbol=ETH/BTC&timezone=Europe/Zurich&start_date=2019-08-09T15:50:00&end_date=2019-08-09T15:55:00&...Exchange for local exchange timeUTC for datetime at universal UTC standardAmerica/New_York, Asia/Singapore. Full list of timezones can be found hereInterval Limitation: The timezone parameter is only applicable for intraday intervals (less than 1 day). For intervals of 1day, 1week, or 1month, the timezone parameter is ignored, and data is strictly returned in the Exchange local time.
\nTake note that the IANA Timezone name is case-sensitive", "key": "timezone", "value": "Exchange" }, { "description": "Can be used separately and together with `end_date`. Format `2006-01-02` or `2006-01-02T15:04:05`\n\nDefault location:\nUTCAmerica/New_York)timezone parameter is provided.timezone is given then, start_date and end_date will be used in the specified location\n\nExamples:\n&symbol=AAPL&start_date=2019-08-09T15:50:00&\u2026&symbol=EUR/USD&timezone=Asia/Singapore&start_date=2019-08-09T15:50:00&\u2026&symbol=ETH/BTC&timezone=Europe/Zurich&start_date=2019-08-09T15:50:00&end_date=2019-08-09T15:55:00&...Exchange for local exchange timeUTC for datetime at universal UTC standardAmerica/New_York, Asia/Singapore. Full list of timezones can be found hereInterval Limitation: The timezone parameter is only applicable for intraday intervals (less than 1 day). For intervals of 1day, 1week, or 1month, the timezone parameter is ignored, and data is strictly returned in the Exchange local time.
\nTake note that the IANA Timezone name is case-sensitive", "key": "timezone", "value": "Exchange" }, { "description": "Can be used separately and together with `end_date`. Format `2006-01-02` or `2006-01-02T15:04:05`\n\nDefault location:\nUTCAmerica/New_York)timezone parameter is provided.timezone is given then, start_date and end_date will be used in the specified location\n\nExamples:\n&symbol=AAPL&start_date=2019-08-09T15:50:00&\u2026&symbol=EUR/USD&timezone=Asia/Singapore&start_date=2019-08-09T15:50:00&\u2026&symbol=ETH/BTC&timezone=Europe/Zurich&start_date=2019-08-09T15:50:00&end_date=2019-08-09T15:55:00&...