PHP code example of sukhrobnurali / alphavantage-sdk

1. Go to this page and download the library: Download sukhrobnurali/alphavantage-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sukhrobnurali / alphavantage-sdk example snippets



AlphaVantage\Client;

$apiKey = 'YOUR_ALPHA_VANTAGE_API_KEY';
$client = new Client($apiKey);


$intradayData = $client->timeSeries()->intraday('MSFT', '5min');
print_r($intradayData);


$smaData = $client->technicalIndicator()->get('SMA', [
    'symbol'      => 'MSFT',
    'interval'    => 'daily',
    'time_period' => 10,
    'series_type' => 'close'
]);
print_r($smaData);


$exchangeRate = $client->forex()->getExchangeRate('USD', 'EUR');
print_r($exchangeRate);


$cryptoData = $client->crypto()->daily('BTC', 'USD');
print_r($cryptoData);