I am now working on making get current order book of crypto currencies.
my codes are as shown below.
public static void bid_ask () {
HttpClient client = HttpClientBuilder.create().build();
HttpGet request = new HttpGet("https://api.binance.com//api/v1/depth?symbol=ETHUSDT");
System.out.println("Binance ETHUSDT");
try {
HttpResponse response = client.execute(request);
HttpEntity entity = response.getEntity();
if (entity != null) {
try (InputStream stream = entity.getContent()) {
BufferedReader reader =
new BufferedReader(new InputStreamReader(stream));
String line;
while ((line = reader.readLine()) != null) {
System.out.println(line);
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
result of this code is as follows..
Binance ETHUSDT
"lastUpdateId":236998360,"bids":[["88.98000000","2.30400000",[]]..........,"asks":[["89.04000000","16.06458000",[]],.......
What I want to make is a kind of price array..
Double Binance[][] = [88.98000000][2.30400000][89.04000000][6.06458000]
How can I extract just Price and Qty from the HTTP/GET response?