首页 期货查询 期货查询示例代码 期货历史查询[Java]

期货历史查询示例代码Java

作者: 阅读数:3037 上传时间:2026-06-12

期货历史查询

String url = "https://api.jisuapi.com/futures/history?market=shfutures&type=SC2703&startdate=2026-06-01&enddate=2026-06-10&appkey=yourappkey";
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());