@Override
public String getMarketChart(String coinId, int days) throws Exception {
String url = "https://api.coingecko.com/api/v3/coins/"+coinId+"/market_chart/?vs_currency=usd&days=" + days;
RestTemplate restTemplate = new RestTemplate();
try{
HttpHeaders headers = new HttpHeaders();
HttpEntity<String> entity = new HttpEntity<String>("parameters",headers);
ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
return response.getBody();
}
catch (HttpClientErrorException e){
throw new Exception(e.getMessage());
}
}