JAVA Code Example

The following code using JAVA to output the EPV in Valuation for WMT.

Request Libraries:

                  import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import org.apache.commons.io.IOUtils;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;

public class GuruFocusAPI {
  public static void main(String[] args) throws MalformedURLException, JSONException, IOException {
    JSONObject jo = (JSONObject) new JSONTokener(IOUtils.toString(new URL("https://api.gurufocus.com/public/user/{api_token}/stock/WMT/keyratios"))).nextValue();
    JSONObject valuation = jo.getJSONObject("Valuation");
    String epv = valuation.getString("EPV");
    System.out.println(epv);
  }
}

The output JAVA String of EPV:

85.68

Continue to read: Code Examples - C#