Java Stock API Example

Here you can find a Java example on how to use our API.

In this API we provide source code for both EOD API and Fundamentals API. The example works with JSON version of our API, which provide more data and more flexible than CSV output.

Here you can download source code for via github: https://github.com/EodHistoricalData/Java-API-Example.

An example of Java-code for End-of-Day API:

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class EodStock {

    @SerializedName("General")
    @Expose
    private General general;
    @SerializedName("Highlights")
    @Expose
    private Highlights highlights;
    @SerializedName("Earnings")
    @Expose
    private Earnings earnings;
    @SerializedName("Financials")
    @Expose
    private Financials financials;

    public General getGeneral() {
        return general;
    }

    public void setGeneral(General general) {
        this.general = general;
    }

    public Highlights getHighlights() {
        return highlights;
    }

    public void setHighlights(Highlights highlights) {
        this.highlights = highlights;
    }

    public Earnings getEarnings() {
        return earnings;
    }

    public void setEarnings(Earnings earnings) {
        this.earnings = earnings;
    }

    public Financials getFinancials() {
        return financials;
    }

    public void setFinancials(Financials financials) {
        this.financials = financials;
    }

}

Here you can download source code for via github: https://github.com/EodHistoricalData/Java-API-Example.

If you have any questions and/or suggestions, please tell us via email: support@eodhistoricaldata.com.