Skip to content

nwartell/yfi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nwartell/yfi

YFi: An easy YFinance wrapper for PHP

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Installation

  1. Ensure composer is initialized for your project directory and its autoloader is required
  2. Open a terminal window and navigate to your project directory
  3. composer require nwartell/yfi
  4. Ready to go!

Usage

<?php
use Nwartell\YFi\YFi;

$yfi = new YFi('aapl', '1d', '1y');

print_r($yfi->meta());
echo $yfi->marketPrice();

?>

With JSON header

<?php
use Nwartell\YFi\YFi;
header("Content-Type: application/json");

echo YFi::quote('AAPL', '1d', '1y'); // returns full JSON-encoded array
?>