当前位置:   article > 正文

股票实时行情数据API接口分享_股票数据api

股票数据api

JAVA版本API接口分享:

  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4. import java.net.HttpURLConnection;
  5. import java.net.URL;
  6. public class TestMain {
  7. public static void main(String[] args) {
  8. System.out.println(get("http://api.waizaowang.com/doc/getWatchStockTimeKLine?type=1&code=000001,000002&export=0&token=登录歪枣网上获取token&fields=code,price,tdate"));
  9. }
  10. public static String get(String strUrl) {
  11. try {
  12. URL url = new URL(strUrl);
  13. HttpURLConnection conn = (HttpURLConnection) url.openConnection();
  14. conn.setRequestProperty("Content-Type", "application/json; charset=utf-8");
  15. conn.setConnectTimeout(10000);
  16. conn.setRequestMethod("GET");
  17. conn.setUseCaches(false);
  18. conn.connect();
  19. BufferedReader reader = new Bu
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/598061
推荐阅读
相关标签
  

闽ICP备14008679号