PHP code example of goapi-io / php-sdk

1. Go to this page and download the library: Download goapi-io/php-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/ */

    

goapi-io / php-sdk example snippets




$client = new GOAPI\IO\Client(['api_key' => 'your_api_key']);

$marketDataIDX = $client->createStockIDX();

$companies = $marketDataIDX->getCompanies();

$profile = $marketDataIDX->getProfile('BBCA');

$prices = $marketDataIDX->getStockPrices(['AALI','BBCA']);

// maximum date range (from-to) is 1 year.
$historicalPrice = $marketDataIDX->getHistoricalData('BBCA', '2023-10-01', '2023-10-20');

$trending = $marketDataIDX->getTrendingStocks();
$gainer = $marketDataIDX->getTopGainerStocks();
$loser = $marketDataIDX->getTopLoserStocks();

$brokerSum = $marketDataIDX->getBrokerSummary('BBCA', '2023-10-30');

$indicators = $marketDataIDX->getStockIndicators(page: 1, date: '2023-10-30');