金融數據下載接口,股票數據下載接口,基金數據下載接口,可轉債數據下載接口 快速獲取滬深股票、港股、大盤指數、基金凈值、基金排行等財經數據,提供免費的財經數據下載接口。接口將提供Txt、Gson、Csv文件等多種數據形式,方便分析人員快速分析數據。我們將持續完善和增加各類財經數據,力求給大家提供高效、全面、穩定的數據服務。一些指數類的ETF,尤其是像創業板、滬深300這類寬基指數,波動相對穩定,存在一定周期性,挖掘財經數據是存在一定價值的,這是歪哥相信的,也是一直在探索的。希望網站提供的財經數據接口能給大家在投資上帶來些許方便,在探索財富奧秘、追求財富自由的道路上,也希望有大家相伴。 目前,提供股票、基金等基本數據下載,保存文件格式多樣化,大家可以根據實際情況設置參數。
金融數據下載接口,可以點擊數據下載接口進入主界面。注冊用戶,建議攜帶token進行下載數據,若是非注冊用戶,每個小時內訪問Api接口的次數是受限制的。
下載示例代碼如下:
import bean.StockBaseInfo; import com.google.gson.Gson; import com.google.gson.JsonParser; import com.google.gson.reflect.TypeToken; import constant.EnumExportType; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import java.io.IOException; import java.util.List; public class DemoApplication { /** * 如果有新的股票數據采集需求,可以直接聯系作者 */ public static void main(String[] args) throws IOException { int exportType = EnumExportType.ExportType_String_Json.getType(); String token = "";//歪棗網上登錄后獲取Token String url = String.format("http://api.waizaowang.com/doc/getStockHSABaseInfo?code=all&fields=code,name,market&export=%s&token=%s", exportType, token); switch (exportType) { case 1: processJson(url); break; default: processTxt(url); } } private static void processTxt(String url) throws IOException { CloseableHttpClient httpclient = HttpClients.createDefault(); HttpGet httpGet = new HttpGet(url); CloseableHttpResponse response = httpclient.execute(httpGet); try { HttpEntity entity = response.getEntity(); String content = EntityUtils.toString(entity); System.out.println(content); String[] data = content.split(";"); System.out.println(data); } finally { response.close(); } } private static void processJson(String url) throws IOException { HttpGet httpGet = new HttpGet(url); CloseableHttpResponse response = getClient().execute(httpGet); try { HttpEntity entity = response.getEntity(); String content = EntityUtils.toString(entity); System.out.println(content); List<StockBaseInfo> data = new Gson().fromJson(JsonParser.parseString(content).getAsJsonObject().get("data"), new TypeToken<List<StockBaseInfo>>() { }.getType()); System.out.println(data); } finally { response.close(); } } private static CloseableHttpClient getClient() { return HttpClients.createDefault(); } }
