All Projects → crazzyghost → alphavantage-java

crazzyghost / alphavantage-java

Licence: MIT License
Fluent Java wrapper for Alpha Vantage API

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to alphavantage-java

Lean
Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
Stars: ✭ 5,675 (+11974.47%)
Mutual labels:  forex, stock-indicators
currency-api
Free Currency Exchange Rates API with 150+ Currencies & No Rate Limits
Stars: ✭ 507 (+978.72%)
Mutual labels:  forex, crypto-currency
mt4-mql
MetaTrader MQL4 framework
Stars: ✭ 205 (+336.17%)
Mutual labels:  forex
EA31337-classes
📦📈 EA31337 framework (MQL library for writing trading Expert Advisors, indicators and scripts)
Stars: ✭ 103 (+119.15%)
Mutual labels:  forex
Flapi
Flapi is an API generator for Java, which generates 'smart' interfaces for improved fluency in your code.
Stars: ✭ 56 (+19.15%)
Mutual labels:  fluent-api
xapi-node
xStation5 Trading API for NodeJS/JS
Stars: ✭ 36 (-23.4%)
Mutual labels:  forex
Sequence-to-Sequence-Learning-of-Financial-Time-Series-in-Algorithmic-Trading
My bachelor's thesis—analyzing the application of LSTM-based RNNs on financial markets. 🤓
Stars: ✭ 64 (+36.17%)
Mutual labels:  forex
TerminalStocks
Pure terminal stock ticker for Windows.
Stars: ✭ 88 (+87.23%)
Mutual labels:  stock-indicators
python-forex-quotes
Library to fetch and parse realtime Forex quotes and convert currencies
Stars: ✭ 25 (-46.81%)
Mutual labels:  forex
ig-markets
IG Markets API wrapper for Node.js
Stars: ✭ 23 (-51.06%)
Mutual labels:  forex
tradeview
A platform for trading crypto currency pairs on crypto exchanges and running crypto currency pair strategies.
Stars: ✭ 69 (+46.81%)
Mutual labels:  crypto-currency
dOOv
dOOv, a fluent API for type-safe domain model validation
Stars: ✭ 38 (-19.15%)
Mutual labels:  fluent-api
javascript-forex-quotes
JavaScript Library for fetching realtime forex quotes.
Stars: ✭ 38 (-19.15%)
Mutual labels:  forex
1broker-client
Complete node.js client for 1Broker API, open sourced by @telebroker_bot for Telegram!
Stars: ✭ 19 (-59.57%)
Mutual labels:  forex
forex-web-app
💱 foreign currency exchange app built with react hooks
Stars: ✭ 17 (-63.83%)
Mutual labels:  forex
nordnet
Uonfficial wrapper for financial data api from the Scandinavian broker Nordnet
Stars: ✭ 13 (-72.34%)
Mutual labels:  forex
alpha-vantage-cookbook
JavaScript examples to help you with accessing market data from https://www.alphavantage.co/
Stars: ✭ 97 (+106.38%)
Mutual labels:  alpha-vantage
fling
A fluent API generator
Stars: ✭ 20 (-57.45%)
Mutual labels:  fluent-api
binary.com-bot
Scripts for using on Binary.com Bots.
Stars: ✭ 60 (+27.66%)
Mutual labels:  forex
saxo openapi
The saxo_openapi package provides easy access to SAXO Bank OpenAPI (https://www.developer.saxo/openapi/learn). Checkout the Jupyter notebooks covering most aspects of the API.
Stars: ✭ 50 (+6.38%)
Mutual labels:  forex

An easy to use, fluent Java wrapper for accessing the AlphaVantage API.

Getting Started

To get started using this library, make sure to get an API Key from Alphavantage's website. Add the library as a dependency to your java/android project

Gradle Installation

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
    ...
    implementation 'com.github.crazzyghost:alphavantage-java:x.y.z'
}

Maven Installation

<repositories>
    ...
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
    ...
</repositories>
<dependencies>
    ...
    <dependency>
        <groupId>com.github.crazzyghost</groupId>
        <artifactId>alphavantage-java</artifactId>
        <version>x.y.z</version>
    </dependency>
    ...
</dependencies>

Quick Usage Guide

These five steps summarize how to access data using this library

Step 1. configure the wrapper

Step 2. Select a category

Step 3. Set the parameters for the selected category

Step 4. (Optional) Add response callbacks

Step 5. fetch results

1. Configuring the wrapper

Access to the API is through the AlphaVantage Singleton which is accessed using the static api() method of the class. Initialize the singleton with a Config instance once throughout your app's lifetime.

Config cfg = Config.builder()
    .key("#&ALPHA10100DEMOKEY")
    .timeOut(10)
    .build();

Initialize the instance with the config. You will use this object to set your api key and configure the http client. Using the wrapper without setting a config or a config key will throw an exception.

AlphaVantage.api().init(cfg);

We're good to go.

2. Selecting a category

Here, we choose which data category/endpoint we want to access

Category Method
Stock Time Series Data .timeSeries()
Forex Rate Data .forex()
Exchange Rate Data .exchangeRate()
Digital Currency Data .crypto()
Technical Indicator Data .indicator()
Sector Performance Data .sector()
Fundamental Data .fundamentalData()

For example, to select the Stock Time Series:

AlphaVantage.api()
    .timeSeries()

3. Setting the parameters for the selected category

To set the api request parameters, call the appopriate parameter methods. For instance for the function parameter function you call daily() for the TIME_SERIES_DAILY function, intraday() for the TIME_SERIES_INTRADAY, and so on.

Let's select the TIME_SERIES_INTRADAY function

AlphaVantage.api()
    .timeSeries()
    .intraday()
...

Start setting parameters by calling an appropriate function method in the selected category

4. Adding response callbacks

To handle responses add the onSuccess() or onFailure() async callbacks. Starting from version 1.5.0, this is an optional step.

public void handleSuccess(TimeSeriesResponse response) {
    plotGraph(reponse.getStockUnits());
}
public void handleFailure(AlphaVantageException error) {
    /* uh-oh! */
}

AlphaVantage.api()
    .timeSeries()
    .intraday()
    .forSymbol("IBM")
    .interval(Interval.FIVE_MIN)
    .outputSize(OutputSize.FULL)
    .onSuccess(e->handleSuccess(e))
    .onFailure(e->hanldeFailure(e))
    ...

5. fetch results

When you are okay with setting the parameters call the fetch() method. Simple!

AlphaVantage.api()
    .timeSeries()
    .intraday()
    .forSymbol("IBM")
    .interval(Interval.FIVE_MIN)
    .outputSize(OutputSize.FULL)
    .onSuccess(e->handleSuccess(e))
    .onFailure(e->hanldeFailure(e))
    .fetch();

If you want a synchronous response, call the fetchSync() method.

TimeSeriesResponse response = AlphaVantage.api()
    .timeSeries()
    .intraday()
    .forSymbol("IBM")
    .interval(Interval.FIVE_MIN)
    .outputSize(OutputSize.FULL)
    .fetchSync();

That's it! 🎉 See site and demo project for more examples & documentation

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].