Closed Evanok closed 3 years ago
Yes it is.
market.get_klines(symbol, "5m", number, start_time, end_time)
where
None
None
for example, the price on january 1st 2021
fn main() {
let market: Market = Binance::new(None, None);
match market.get_klines("ETHUSDT", "5m", 1, 1609452000000, None) {
Ok(klines) => match klines {
binance::model::KlineSummaries::AllKlineSummaries(klines) => {
// will only run once since limit is 1
for z in klines {
println!("{}", z.open);
println!("{}", z.close);
println!("{}", z.high);
println!("{}", z.low);
}
}
},
Err(e) => println!("Error: {}", e),
}
}
You could change the "5m"
to something else, like "1m"
for a smaller interval, but you get the idea
Thanks for your answer !
Hello,
Nice job on this code ! You have really cool feature on your api Did I miss something about the api to get price symbol ?
I would like to be able to get the prince of a specific symbol at a specific date ? Is it possible with this api ?
Thanks, Eva.