About this project

twelvedata-python is the official Python client for Twelve Data's financial API and WebSocket service. It requires a Twelve Data API key; the README states that WebSocket access is available on Pro plans and above. The library retrieves OHLC time series for stocks, forex, cryptocurrency, ETFs, and indices. It also provides quotes, real-time and end-of-day prices, exchange rates, and currency conversion. Fundamentals methods cover company profiles and logos, dividends, splits, earnings and calendars, IPO calendars, statistics, insider transactions, income statements, balance sheets, cash flow, executives, and institutional or fund holders. Time-series requests support parameters including symbol, interval, exchange, MIC code, country, output size, timezone, start and end dates, and sort order. Results can be returned as JSON, CSV, pandas DataFrames, or request URLs. Over 100 technical indicators can be chained onto a time-series request, and OHLC data can be excluded when only indicators are needed. Batch requests accept either a comma-separated string or a list of symbols, with up to 120 symbols per API call. Batch output supports JSON and pandas formats, including a MultiIndex DataFrame for symbol and datetime. Optional dependencies add charting and streaming features. Static charts use matplotlib and mplfinance, while interactive charts use Plotly. The WebSocket client provides event-driven streams for stocks, forex, and crypto, with methods for subscribing, unsubscribing, resetting subscriptions, connecting, disconnecting, and sending heartbeats. Advanced functionality includes requests to custom Twelve Data endpoints, inspection of current API credit usage, and generation of underlying URLs for debugging. The package is installed with pip and distributed under the MIT license.