Skip to content

Instantly share code, notes, and snippets.

@coinscious-io
Created August 2, 2019 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coinscious-io/c0b28b7f542b3d67a4ffb24d805d0a38 to your computer and use it in GitHub Desktop.
Save coinscious-io/c0b28b7f542b3d67a4ffb24d805d0a38 to your computer and use it in GitHub Desktop.
Get VWAP of a trading pair at a specific exchange
import okhttp3.Dispatcher;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
public class Example {
public static void main(String[] args) throws IOException {
Request request = new Request.Builder()
.get()
.url("https://api.coinscious.org/exchange-vwap/binance/eth_btc?interval=1m")
.addHeader("Authorization", "bearer <token>")
.build();
Dispatcher dispatcher = new Dispatcher();
OkHttpClient client = new OkHttpClient.Builder()
.dispatcher(dispatcher)
.build();
Response response = client.newCall(request).execute();
String body = response.body().string();
System.out.println(body);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment