goapi-io/php-sdk
最新稳定版本:1.0.3
Composer 安装命令:
composer require goapi-io/php-sdk
包简介
GOAPI.IO PHP SDK
README 文档
README
This is the official GOAPI.IO SDK for PHP. It provides a set of functions and classes to interact with the Goapi API.
Requirements
- PHP 8.1 or higher
- GuzzleHttp library
Installation
You can install the SDK using Composer. Run the following command in your project directory:
composer require goapi-io/php-sdk
Stock Market Data (IDX)
Create Instance
To use the SDK, you need to include the autoloader and create an instance of the main class. Here is an example:
require 'vendor/autoload.php'; $client = new GOAPI\IO\Client(['api_key' => 'your_api_key']); $marketDataIDX = $client->createStockIDX();
Get all listed companies
$companies = $marketDataIDX->getCompanies();
The $companies response is a Collection with GOAPI\IO\Resources\Stock\Company items data.
Get Detail Company Profile
$profile = $marketDataIDX->getProfile('BBCA');
Get price by symbols
$prices = $marketDataIDX->getStockPrices(['AALI','BBCA']);
The $prices is a Collection with StockPrice items data.
Get historical price by symbol
// maximum date range (from-to) is 1 year. $historicalPrice = $marketDataIDX->getHistoricalData('BBCA', '2023-10-01', '2023-10-20');
The $historicalPrice is a Collection with StockPrice items data.
Get trending, top loser, top gainer
$trending = $marketDataIDX->getTrendingStocks(); $gainer = $marketDataIDX->getTopGainerStocks(); $loser = $marketDataIDX->getTopLoserStocks();
The $trending,$gainer, $loser is a Collection with StockPriceChange items data.
Get Broker Summary
$brokerSum = $marketDataIDX->getBrokerSummary('BBCA', '2023-10-30');
The $brokerSum is a Collection with BrokerSummary items data.
Get stock indicators
$indicators = $marketDataIDX->getStockIndicators(page: 1, date: '2023-10-30');
The $indicators is a Collection with StockIndicator items data.
Contributing
If you find any issues or have suggestions for improvement, please open an issue or submit a pull request on GitHub.
统计信息
- 总下载量: 35
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-10-28