marekskopal / twelvedata
TwelveData API client library
v0.8.0
2025-08-11 20:04 UTC
Requires
- php: >=8.3
- php-http/discovery: ^1.19
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.1 || ^2.0
Requires (Dev)
- php-http/guzzle7-adapter: ^1.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^12.3
- slevomat/coding-standard: ^8.14
- spatie/ray: ^1.39
Suggests
- nyholm/psr7: PSR-7 message implementation
- symfony/http-client: HTTP client
README
Unofficial PHP API client library for the Twelve Data API service.
Install
composer require marekskopal/twelvedata
Usage
use MarekSkopal\TwelveData\TwelveData; use MarekSkopal\TwelveData\Enum\IntervalEnum; // Create TwelveData instance $twelveData = new TwelveData('<yourApiKey>'); // Get the one minute time series for the AAPL symbol. Response is in form of strict typed DTO (Data Transfer Object) $response = $twelveData->coreData->timeSeries( symbol: 'AAPL', interval: IntervalEnum::OneMinute, ); // Alternatively, you can use the low level interface $response = $twelveData->get( '/time_series', [ 'symbol' => 'AAPL', 'interval' => '1min', ], );
Covered endpoints
More endpoints will be covered in future versions.
Core Data
- Time Series ✅
- Time Series Cross ✅
- Quote ✅
- Latest Price ✅
- Edd of Day Price ✅
- Market Movers ✅
Reference Data
Asset Catalogs
- Stocks ✅
- Forex Pairs ✅
- Cryptocurrency Pairs ✅
- ETFs ✅
- Funds ✅
- Commodities ✅
- Fixed Income ✅
- Indices List ✅
Discovery
- Symbol Search ✅
- Cross listings ✅
- Earliest Timestamp ✅
Markets
- Exchanges ✅
- Exchange schedule ✅
- Cryptocurrency Exchanges ✅
- Market State ✅
Supporting Metadata
- Instrument Type ✅
- Countries ✅
- Technical Indicators ❌
Fundamentals
- Logo ✅
- Profile ✅
- Dividends ✅
- Dividends Calendar ✅
- Splits ✅
- Splits Calendar ✅
- Earnings ✅
- Earnings Calendar ✅
- IPO Calendar ✅
- Statistics ✅
- Income Statement ✅
- Income Statement Consolidated ✅
- Balance Sheet ✅
- Balance Sheet Consolidated ✅
- Cash Flow ✅
- Cash Flow Consolidated ✅
- Key Executives ✅
- Options Expiration ✅
- Options Chain ✅
- Market Capitalization ✅
- Last changes ✅
Currencies
- Exchange Rate ✅
- Currency Conversion ✅
ETFs ❌
Mutual Funds ❌
Technical Indicators ❌
Analysis
- Earnings Estimate ✅
- Revenue Estimate ✅
- EPS Trend ✅
- EPS Revisions ✅
- Growth Estimates ✅
- Recommendations ✅
- Price Target ✅
- Analyst Ratings Snapshot ✅
- Analyst Ratings US Equities ✅
Regulatory
- EDGAR Fillings ✅
- Insider Transactions ✅
- Institutional Holders ✅
- Fund Holders ✅
- Direct Holders ✅
- Tax Information ✅
- Sanctioned Entities ✅
Advanced
- Complex Data ❌
- Usage ✅
WebSocket ❌
Notice
This is NOT an official Twelve Data library, and the authors of this library are not affiliated with Twelve Data in any way, shape or form. Twelve Data APIs and data are Copyright © 2025 Twelve Data Pte. Ltd.
Contributing
If you want to contribute, feel free to submit a pull request.