YFi: An easy YFinance wrapper for PHP
- Ensure composer is initialized for your project directory and its autoloader is required
- Open a terminal window and navigate to your project directory
composer require nwartell/yfi
- Ready to go!
<?php
use Nwartell\YFi\YFi;
$yfi = new YFi('aapl', '1d', '1y');
print_r($yfi->meta());
echo $yfi->marketPrice();
?>
<?php
use Nwartell\YFi\YFi;
header("Content-Type: application/json");
echo YFi::quote('AAPL', '1d', '1y'); // returns full JSON-encoded array
?>