Twelve Data API

⭐ Beginner's Pick Finance / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

Twelve Data provides real-time and historical stock, forex, cryptocurrency, and ETF market data through a clean and well-documented REST API. It supports over 12,000 financial instruments across global exchanges and offers a generous free tier with 800 API credits per day. Beginners will find it approachable thanks to clear documentation, a free plan, and straightforward API key authentication.

💡

Beginner Tip

Each API call consumes a different number of credits on the free plan — simple quote requests use 1 credit while technical indicator endpoints use more. Check the credits cost in the docs before building to avoid unexpected limits.

Available Data

stock price and symbol
open/close/high/low values
trading volume
market cap
historical price data

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Twelve Data",
    "description": "Stock market data (real-time & historical)",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

price Current market price of the requested symbol as a string (convert to float for calculations).
symbol The ticker symbol that was queried.
open Opening price for the current trading day (available in the /quote endpoint).
close Previous closing price of the security.
volume Trading volume for the current session.
datetime Timestamp of the data point in YYYY-MM-DD HH:MM:SS format.

Implementation Example

const url = "https://twelvedata.com/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

400 Bad Request - symbol not found The ticker symbol is not recognized or requires an exchange suffix.
For non-US stocks, append the exchange (e.g., "RELIANCE:NSE" for Indian stocks). Use the /stocks endpoint to search valid symbols.
429 Too Many Requests Exceeded the 800 daily credits or the per-minute request rate on the free plan.
Implement caching for frequently requested symbols and add retry logic with exponential backoff. Upgrade to a paid plan for higher limits.
401 Unauthorized - api_key is invalid API key is incorrect or has not been activated yet.
Copy the key directly from your Twelve Data dashboard and wait a few minutes after registration for the key to activate.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Finance
Difficulty Intermediate
Verified: 2026-04-04

Alternatives to Twelve Data

Technical alternatives for different use cases.

Covers stocks, forex, crypto with technical indicators

Better For

Free tier generosity (fewer API calls)

Trade-off

Multi-asset class data from a single API

Similar APIs

View All →