PHPackages                             tigusigalpa/taapi-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tigusigalpa/taapi-php

ActiveLibrary[API Development](/categories/api)

tigusigalpa/taapi-php
=====================

Modern PHP/Laravel library for taapi.io technical analysis API

v1.0.0(3mo ago)20MITPHPPHP ^8.1

Since Feb 1Pushed 3mo agoCompare

[ Source](https://github.com/tigusigalpa/taapi-php)[ Packagist](https://packagist.org/packages/tigusigalpa/taapi-php)[ RSS](/packages/tigusigalpa-taapi-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

TAAPI PHP Library
=================

[](#taapi-php-library)

[![TAAPI PHP](https://private-user-images.githubusercontent.com/2721390/543374967-69dae5e6-56bc-4973-9ea2-920f9eaa7d75.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU0Mzc4MjYsIm5iZiI6MTc3NTQzNzUyNiwicGF0aCI6Ii8yNzIxMzkwLzU0MzM3NDk2Ny02OWRhZTVlNi01NmJjLTQ5NzMtOWVhMi05MjBmOWVhYTdkNzUuanBnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDQwNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA0MDZUMDEwNTI2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZWQzMTZkYjE5ZGRiMGNmNGRkNTBiNDE2NTA4MzVkOWJjZmI3NTk2ZGY5MGFmYWNkYzVlODE3Y2M2OTVlN2IwNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.45iLdkV7yy6R7Xy8gL0DeToIDL-iW5pVL9gq0cZT1-A)](https://private-user-images.githubusercontent.com/2721390/543374967-69dae5e6-56bc-4973-9ea2-920f9eaa7d75.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU0Mzc4MjYsIm5iZiI6MTc3NTQzNzUyNiwicGF0aCI6Ii8yNzIxMzkwLzU0MzM3NDk2Ny02OWRhZTVlNi01NmJjLTQ5NzMtOWVhMi05MjBmOWVhYTdkNzUuanBnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDQwNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA0MDZUMDEwNTI2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZWQzMTZkYjE5ZGRiMGNmNGRkNTBiNDE2NTA4MzVkOWJjZmI3NTk2ZGY5MGFmYWNkYzVlODE3Y2M2OTVlN2IwNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.45iLdkV7yy6R7Xy8gL0DeToIDL-iW5pVL9gq0cZT1-A)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![PHP Version](https://camo.githubusercontent.com/cc9cdea9aa96b40a822425e981b0a030e3371202973c7d57b74e8e99834f81dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c7565)](https://php.net)

Modern, object-oriented PHP/Laravel library for the [taapi.io](https://taapi.io/) technical analysis API.

Features
--------

[](#features)

- ✨ **Modern PHP 8.1+** with strict types and enums
- 🔄 **Fluent Interface** for intuitive request building
- 📦 **Full API Coverage** - GET (Direct), POST (Bulk), and POST (Manual) requests
- 🎯 **Type-Safe** - Strongly typed responses with DTOs
- 🚀 **Laravel Integration** - Service Provider, Facade, and configuration
- 🛡️ **Error Handling** - Custom exceptions for different error types
- ✅ **Well Tested** - Comprehensive unit and integration tests
- 📖 **Fully Documented** - Complete PHPDoc documentation

Installation
------------

[](#installation)

Install via Composer:

```
composer require tigusigalpa/taapi-php
```

Configuration
-------------

[](#configuration)

### Standard PHP

[](#standard-php)

```
use Tigusigalpa\TAAPI\TAAPIClient;

$taapi = new TAAPIClient('YOUR_API_SECRET');
```

### Laravel

[](#laravel)

1. **Publish the configuration file** (optional):

```
php artisan vendor:publish --tag=taapi-config
```

2. **Add your API secret to `.env`**:

```
TAAPI_SECRET=your_api_secret_here
TAAPI_TIMEOUT=30
TAAPI_DEFAULT_EXCHANGE=binance
TAAPI_DEFAULT_INTERVAL=1h
```

3. **Use the Facade**:

```
use Tigusigalpa\TAAPI\Laravel\Facades\TAAPI;

// Or with alias
use TAAPI;
```

Usage
-----

[](#usage)

### GET (Direct) Requests

[](#get-direct-requests)

Get a single indicator value for a specific exchange, symbol, and interval.

#### Basic Example

[](#basic-example)

```
use Tigusigalpa\TAAPI\Laravel\Facades\TAAPI;

$rsi = TAAPI::exchange('binance')
    ->symbol('BTC/USDT')
    ->interval('1h')
    ->indicator('rsi')
    ->get();

echo "RSI Value: " . $rsi->getValue();
```

#### Using Enums

[](#using-enums)

```
use Tigusigalpa\TAAPI\Enums\Exchange;
use Tigusigalpa\TAAPI\Enums\Indicator;
use Tigusigalpa\TAAPI\Enums\Interval;

$macd = TAAPI::exchange(Exchange::BINANCE)
    ->symbol('ETH/USDT')
    ->interval(Interval::FOUR_HOURS)
    ->indicator(Indicator::MACD)
    ->get();

echo "MACD: " . $macd->get('valueMACD');
echo "Signal: " . $macd->get('valueMACDSignal');
echo "Histogram: " . $macd->get('valueMACDHist');
```

#### With Additional Parameters

[](#with-additional-parameters)

```
$ema = TAAPI::exchange('binance')
    ->symbol('BTC/USDT')
    ->interval('1h')
    ->indicator('ema')
    ->withParams(['period' => 50])
    ->get();

echo "EMA(50): " . $ema->getValue();
```

#### With Backtrack

[](#with-backtrack)

```
// Get historical data
$rsi = TAAPI::exchange('binance')
    ->symbol('BTC/USDT')
    ->interval('1h')
    ->indicator('rsi')
    ->backtrack(5)
    ->get();

// Get multiple historical values
$rsi = TAAPI::exchange('binance')
    ->symbol('BTC/USDT')
    ->interval('1h')
    ->indicator('rsi')
    ->backtracks(10)
    ->get();
```

### POST (Bulk) Requests

[](#post-bulk-requests)

Execute multiple indicator requests in a single API call for better performance.

#### Basic Bulk Request

[](#basic-bulk-request)

```
$results = TAAPI::bulk()
    ->addConstruct(
        TAAPI::construct('binance', 'BTC/USDT', '1h')
            ->addIndicator('rsi', ['id' => 'btc_rsi'])
            ->addIndicator('macd', ['id' => 'btc_macd'])
    )
    ->addConstruct(
        TAAPI::construct('binance', 'ETH/USDT', '4h')
            ->addIndicator('sma', ['period' => 200, 'id' => 'eth_sma'])
    )
    ->execute();

// Access results by ID
$btcRsi = $results->findById('btc_rsi');
echo "BTC RSI: " . $btcRsi->getValue();

// Iterate through all results
foreach ($results as $result) {
    echo "{$result->indicator}: {$result->getValue()}\n";
}
```

#### Advanced Bulk Request

[](#advanced-bulk-request)

```
use Tigusigalpa\TAAPI\Enums\Exchange;
use Tigusigalpa\TAAPI\Enums\Interval;

$results = TAAPI::bulk()
    ->addConstruct(
        TAAPI::construct(Exchange::BINANCE, 'BTC/USDT', Interval::ONE_HOUR)
            ->addIndicator('rsi', ['period' => 14, 'id' => 'rsi_14'])
            ->addIndicator('rsi', ['period' => 21, 'id' => 'rsi_21'])
            ->addIndicator('ema', ['period' => 50, 'id' => 'ema_50'])
            ->addIndicator('ema', ['period' => 200, 'id' => 'ema_200'])
    )
    ->addConstruct(
        TAAPI::construct(Exchange::COINBASE, 'ETH/USD', Interval::FOUR_HOURS)
            ->addIndicator('bbands', ['id' => 'eth_bb'])
            ->addIndicator('stoch', ['id' => 'eth_stoch'])
    )
    ->execute();

// Filter by indicator type
$rsiResults = $results->filterByIndicator('rsi');
foreach ($rsiResults as $rsi) {
    echo "RSI ({$rsi->id}): {$rsi->getValue()}\n";
}
```

### POST (Manual) Requests

[](#post-manual-requests)

Calculate indicators using your own candle data.

#### Basic Manual Request

[](#basic-manual-request)

```
$candles = [
    [1609459200, 28923.63, 28923.63, 28923.63, 28923.63, 0.00000000],
    [1609462800, 29083.37, 29188.78, 28963.64, 29103.37, 1107.05626800],
    [1609466400, 29103.38, 29152.98, 28980.01, 29050.00, 978.58108600],
    // ... more candles
];

$ema = TAAPI::manual('ema')
    ->withCandles($candles)
    ->withParams(['period' => 50])
    ->execute();

echo "EMA(50): " . $ema->getValue();
```

#### Using Indicator Enum

[](#using-indicator-enum)

```
use Tigusigalpa\TAAPI\Enums\Indicator;

$rsi = TAAPI::manual(Indicator::RSI)
    ->withCandles($candles)
    ->withParam('period', 14)
    ->execute();

echo "RSI: " . $rsi->getValue();
```

Response Handling
-----------------

[](#response-handling)

### IndicatorResponse

[](#indicatorresponse)

All single indicator requests return an `IndicatorResponse` object:

```
$response = TAAPI::exchange('binance')
    ->symbol('BTC/USDT')
    ->interval('1h')
    ->indicator('rsi')
    ->get();

// Get the main value
$value = $response->getValue();

// Access specific fields
$value = $response->get('value');
$value = $response['value'];
$value = $response->value;

// Check if field exists
if ($response->has('value')) {
    // ...
}

// Convert to array
$array = $response->toArray();

// JSON serialization
$json = json_encode($response);
```

### BulkResponse

[](#bulkresponse)

Bulk requests return a `BulkResponse` object:

```
$results = TAAPI::bulk()
    ->addConstruct(/* ... */)
    ->execute();

// Count results
$count = count($results);

// Find by ID
$result = $results->findById('my_indicator');

// Filter by indicator
$rsiResults = $results->filterByIndicator('rsi');

// Iterate
foreach ($results as $result) {
    echo $result->indicator . ': ' . $result->getValue();
}

// Array access
$first = $results[0];

// Convert to array
$array = $results->toArray();
```

Error Handling
--------------

[](#error-handling)

The library provides custom exceptions for different error scenarios:

```
use Tigusigalpa\TAAPI\Exceptions\InvalidArgumentException;
use Tigusigalpa\TAAPI\Exceptions\ApiException;
use Tigusigalpa\TAAPI\Exceptions\RateLimitException;

try {
    $result = TAAPI::exchange('binance')
        ->symbol('BTC/USDT')
        ->interval('1h')
        ->indicator('rsi')
        ->get();
} catch (InvalidArgumentException $e) {
    // Handle invalid parameters
    echo "Invalid argument: " . $e->getMessage();
} catch (RateLimitException $e) {
    // Handle rate limiting
    echo "Rate limit exceeded. Retry after: " . $e->getRetryAfterSeconds() . " seconds";
} catch (ApiException $e) {
    // Handle general API errors
    echo "API Error [{$e->statusCode}]: " . $e->getMessage();
    print_r($e->responseData);
}
```

Available Enums
---------------

[](#available-enums)

### Exchanges

[](#exchanges)

```
use Tigusigalpa\TAAPI\Enums\Exchange;

Exchange::BINANCE
Exchange::BINANCEUS
Exchange::BINANCEUSDM
Exchange::BITFINEX
Exchange::BITGET
Exchange::BITMEX
Exchange::BITSTAMP
Exchange::BYBIT
Exchange::COINBASE
Exchange::CRYPTOCOM
Exchange::GATEIO
Exchange::HUOBI
Exchange::KRAKEN
Exchange::KUCOIN
Exchange::MEXC
Exchange::OKX
Exchange::PHEMEX
Exchange::POLONIEX
```

### Intervals

[](#intervals)

```
use Tigusigalpa\TAAPI\Enums\Interval;

Interval::ONE_MINUTE      // '1m'
Interval::FIVE_MINUTES    // '5m'
Interval::FIFTEEN_MINUTES // '15m'
Interval::THIRTY_MINUTES  // '30m'
Interval::ONE_HOUR        // '1h'
Interval::TWO_HOURS       // '2h'
Interval::FOUR_HOURS      // '4h'
Interval::TWELVE_HOURS    // '12h'
Interval::ONE_DAY         // '1d'
Interval::ONE_WEEK        // '1w'
```

### Indicators

[](#indicators)

```
use Tigusigalpa\TAAPI\Enums\Indicator;

Indicator::RSI
Indicator::MACD
Indicator::EMA
Indicator::SMA
Indicator::BBANDS
Indicator::STOCH
Indicator::STOCHRSI
Indicator::ATR
Indicator::ADX
Indicator::CCI
// ... and many more
```

See the [Indicator enum](src/Enums/Indicator.php) for the complete list.

Advanced Usage
--------------

[](#advanced-usage)

### Custom Timeout

[](#custom-timeout)

```
// Standard PHP
$taapi = new TAAPIClient('YOUR_API_SECRET');
$taapi->setTimeout(60);

// Laravel
TAAPI::setTimeout(60);
```

### Dependency Injection (Laravel)

[](#dependency-injection-laravel)

```
use Tigusigalpa\TAAPI\TAAPIClient;

class TradingService
{
    public function __construct(
        private TAAPIClient $taapi
    ) {}

    public function analyzeMarket(string $symbol): array
    {
        $rsi = $this->taapi
            ->exchange('binance')
            ->symbol($symbol)
            ->interval('1h')
            ->indicator('rsi')
            ->get();

        return [
            'rsi' => $rsi->getValue(),
            'signal' => $rsi->getValue() > 70 ? 'overbought' : 'oversold',
        ];
    }
}
```

Testing
-------

[](#testing)

Run the test suite:

```
composer test
```

Run tests with coverage:

```
composer test -- --coverage
```

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Guzzle HTTP client 7.5+
- Laravel 10.0+ or 11.0+ (for Laravel integration)

Links
-----

[](#links)

- [taapi.io Official Website](https://taapi.io/)
- [taapi.io Documentation](https://taapi.io/documentation/)
- [taapi.io API Reference](https://taapi.io/documentation/integration/)
- [GitHub Repository](https://github.com/tigusigalpa/taapi-php)

License
-------

[](#license)

This library is open-sourced software licensed under the [MIT license](LICENSE).

Author
------

[](#author)

**Igor Sazonov**

- Email:
- GitHub: [@tigusigalpa](https://github.com/tigusigalpa)

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

Support
-------

[](#support)

If you encounter any issues or have questions, please [open an issue](https://github.com/tigusigalpa/taapi-php/issues) on GitHub.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance81

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

100d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/76c3a1d93c3213a8a22b4b637708d8b66a1ba3a5252624046cae7683a198b3a8?d=identicon)[tigusigalpa](/maintainers/tigusigalpa)

---

Top Contributors

[![tigusigalpa](https://avatars.githubusercontent.com/u/2721390?v=4)](https://github.com/tigusigalpa "tigusigalpa (2 commits)")

---

Tags

apibitcoinchainlinkcomposer-packagefinancial-analysisfinancial-datalaravelmacdmacd-indicatornear-protocolphprsirsi-strategytaapi

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tigusigalpa-taapi-php/health.svg)

```
[![Health](https://phpackages.com/badges/tigusigalpa-taapi-php/health.svg)](https://phpackages.com/packages/tigusigalpa-taapi-php)
```

###  Alternatives

[skagarwal/google-places-api

Google Places Api

1913.0M8](/packages/skagarwal-google-places-api)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1344.8k1](/packages/jasara-php-amzn-selling-partner-api)[grantholle/powerschool-api

A Laravel package to make interacting with PowerSchool less painful.

1715.6k1](/packages/grantholle-powerschool-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
