Overview
Twelve Data offers an API that delivers financial market data, catering to developers and organizations that require access to real-time and historical information for a range of asset classes. Established in 2018, the service provides endpoints for stocks, exchange-traded funds (ETFs), foreign exchange (forex) pairs, cryptocurrencies, futures, and options. The API is structured to support various use cases, from powering consumer-facing financial applications to backend systems for algorithmic trading strategies and quantitative analysis.
The core utility of Twelve Data lies in its ability to provide both streaming real-time data and extensive historical data. This combination allows developers to build applications that monitor live market movements, backtest trading strategies against past performance, and perform in-depth fundamental analysis. For instance, developers can retrieve current stock prices for a specific ticker, historical daily closing prices over several years, or fundamental data like earnings reports and balance sheets for a company.
Twelve Data's API is suitable for a range of financial technology projects. Algorithmic trading platforms can use the real-time data feeds to execute trades based on predefined rules, while portfolio management applications can track the performance of holdings and display current valuations. Financial researchers and analysts can utilize the historical data to identify trends, test hypotheses, and develop predictive models. The service emphasizes ease of integration, offering client libraries (SDKs) in popular programming languages such as Python, JavaScript, and Java, which can streamline the development process.
The API's design focuses on providing specific data points efficiently. For example, a developer might query for the current price of a specific cryptocurrency or retrieve historical minute-by-minute data for a forex pair to analyze short-term volatility. The documentation includes practical code examples for common requests, aiding developers in quickly implementing data retrieval logic. While a free tier is available for initial exploration and low-volume applications, higher-tier paid plans typically unlock increased request limits, access to more granular data (e.g., tick data), and real-time streaming capabilities, which are often critical for high-frequency trading or latency-sensitive applications.
The provision of a comprehensive API reference and SDKs aims to reduce the barrier to entry for developers needing financial data. The focus on different asset classes means that a single integration can potentially cover diverse data requirements, rather than relying on multiple specialized APIs. This consolidation can simplify data management and reduce overhead for developers managing complex financial systems. For a comparison of similar financial data providers, developers might examine the offerings of platforms like Alpha Vantage, which also provides a range of financial APIs for both real-time and historical data, as detailed in their developer documentation.
Key features
- Real-time Market Data: Access live prices and market updates for stocks, forex, cryptocurrencies, futures, and options.
- Historical Data: Retrieve extensive historical data, including intraday, daily, weekly, and monthly intervals for backtesting and analysis.
- Fundamental Data: Obtain financial statements (income statements, balance sheets, cash flow statements), earnings reports, and other fundamental metrics for companies.
- Technical Indicators: Calculate and retrieve common technical analysis indicators directly through API endpoints, such as Moving Averages (MA), Relative Strength Index (RSI), and Bollinger Bands.
- Forex and Crypto Data: Specific endpoints for currency exchange rates and cryptocurrency market data, including pairs, prices, and volumes.
- Futures and Options Data: Access data relevant to futures contracts and options chains, including expiry dates and strike prices.
- Multiple SDKs: Client libraries available in JavaScript, Python, PHP, Ruby, Go, C#, and Java to simplify integration.
- Global Coverage: Data coverage across various global exchanges and markets for a broad range of assets.
Pricing
As of May 2026, Twelve Data offers a free tier and several paid subscription plans. Pricing is structured based on request limits, data granularity, and access to specific features like real-time streaming or premium data sets. All plans include access to historical data, with higher tiers offering more extensive history and finer time intervals.
| Plan Name | Monthly Cost | Daily Request Limit | Key Features |
|---|---|---|---|
| Free | Free | 250 | Basic historical data, limited real-time snapshots |
| Starter | $29 | 8,000 | All Free features, more historical data, additional technical indicators |
| Growth | $89 | 80,000 | All Starter features, real-time data access, more granular historical data |
| Enterprise | Custom | Custom | All Growth features, dedicated support, custom data feeds, higher limits |
For the most current and detailed pricing information, including annual discounts and specific feature breakdowns for each tier, please refer to the official Twelve Data pricing page.
Common integrations
Twelve Data's API is designed for integration into a variety of financial applications and data analysis workflows. Its SDKs facilitate connections with popular programming environments.
- Python applications: Used for algorithmic trading bots, quantitative analysis, and data science projects that require fetching and processing market data. The Twelve Data Python SDK examples provide guidance.
- JavaScript/Node.js backend services: Powering web applications that display real-time stock tickers, portfolio dashboards, or financial news feeds. Developers can find implementation details in the Twelve Data JavaScript documentation.
- C#/.NET desktop applications: Building custom trading terminals, market scanners, or investment management tools. The Twelve Data C# SDK documentation offers integration patterns.
- Data visualization tools: Exporting historical data for charting and graphical representation in tools like Tableau or custom dashboards.
- Spreadsheet software (e.g., Google Sheets, Excel): Custom scripts can fetch data directly into spreadsheets for personal portfolio tracking or simple analysis.
Alternatives
Developers seeking financial market data APIs may consider several alternatives, each with distinct features and pricing models:
- Marketstack: Offers real-time and historical stock data for global exchanges, including EOD data and fundamental financial information.
- Alpha Vantage: Provides free and paid APIs for real-time and historical data on stocks, forex, cryptocurrencies, and technical indicators.
- Financial Modeling Prep: Focuses on fundamental data, financial statements, and real-time stock data, often used for valuation models.
- PayPal Developer: While not a direct market data provider, PayPal's APIs are relevant for financial transaction processing and payment integrations within financial applications.
- Stripe API Documentation: Similar to PayPal, Stripe offers robust payment processing APIs, which are essential for applications involving financial transactions, though not for market data itself.
Getting started
To begin using the Twelve Data API, you first need to obtain an API key from your Twelve Data account. The following Python example demonstrates how to fetch the real-time price for Apple (AAPL) using the requests library, which is a common way to interact with REST APIs in Python. Ensure you replace YOUR_API_KEY with your actual key.
import requests
API_KEY = "YOUR_API_KEY" # Replace with your actual API key
SYMBOL = "AAPL"
def get_real_time_price(symbol, api_key):
url = f"https://api.twelvedata.com/price?symbol={symbol}&apikey={api_key}"
try:
response = requests.get(url)
response.raise_for_status() # Raises an HTTPError for bad responses (4xx or 5xx)
data = response.json()
if data and 'price' in data:
print(f"The current price of {symbol}: {data['price']}")
elif 'message' in data:
print(f"Error fetching data for {symbol}: {data['message']}")
else:
print(f"Could not retrieve price for {symbol}. Response: {data}")
except requests.exceptions.RequestException as e:
print(f"An error occurred: {e}")
if __name__ == "__main__":
get_real_time_price(SYMBOL, API_KEY)
This script defines a function get_real_time_price that constructs a URL for the Twelve Data /price endpoint, including the specified stock symbol and your API key. It then sends an HTTP GET request to this URL. If the request is successful, it parses the JSON response and prints the current price. Error handling is included to catch network issues or API-specific error messages. After running this script with a valid API key, you should see the current trading price for Apple Inc. in your console. For more details on available endpoints and parameters, consult the Twelve Data API reference documentation.