Â
API - PHP
PHP Code Example
The following code using PHP to output the Valuation Ratio for WMT.
$url = 'https://api.gurufocus.com/public/user/{api_token}/stock/WMT/keyratios';
$content = file_get_contents($url);
$arr = json_decode($content, true);
print_r($arr['Valuation Ratio']);
The output PHP array:
Array
(
[PE Ratio] => 14.74
[PS Ratio] => 0.49
[PB Ratio] => 3.07
[PE Ratio without NRI] => 14.90
[PEG Ratio] => 2.22
[Net Current Asset Value] => -27.55
[Median PS Value] => 79.38
[Graham Number] => 45.72
[Peter Lynch Fair Value] => 26.91
[Earnings Yield %] => 9.49
[Forward Rate of Return (Yacktman) %] => 10.70
[Shiller PE Ratio] => 15.02
[EV-to-EBIT] => 10.54
[EV-to-EBITDA] => 7.83
[Price-to-Tangible-Book] => 3.99
[Price-to-Operating-Cash-Flow] => 8.79
[Price-to-Free-Cash-Flow] => 15.93
[Price-to-Operating-Cash-Flow (10y Median)] => 9.76
[Intrinsic Value: DCF (Earnings Based)] => 63.77
[Intrinsic Value: DCF (FCF Based)] => 130.67
[Intrinsic Value: Projected FCF] => 62.87
[Forward PE Ratio] => 15.17
)
Continue to read: Code Examples - R