当前位置:首页 » 股票资讯 » 大东海股票历史数据查询接口
扩展阅读
设计总院股票历史股价 2023-08-31 22:08:17
股票开通otc有风险吗 2023-08-31 22:03:12
短线买股票一天最好时间 2023-08-31 22:02:59

大东海股票历史数据查询接口

发布时间: 2022-04-24 09:58:26

1. 如何使用 Yahoo Finance stock API 获取股票数据

1、通过API获取实时数据

请求地址

http://finance.yahoo.com/d/quotes.csv?s=<股票名称>&f=<数据列选项>

参数

s – 表示股票名称,多个股票之间使用英文加号分隔,如”XOM+BBDb.TO+JNJ+MSFT”,罗列了四个公司的股票:XOM, BBDb.TO, JNJ, MSFT。

f – 表示返回数据列,如”snd1l1yr”。更详细的参见雅虎股票 API f 参数对照表。

2、通过API获取历史数据

请求地址

http://ichart.yahoo.com/table.csv?s=<string>&a=<int>&b=<int>&c=<int>&d=<int>&e=<int>&f=<int>&g=d&ignore=.csv

参数

s – 股票名称

a – 起始时间,月

b – 起始时间,日

c – 起始时间,年

d – 结束时间,月

e – 结束时间,日

f – 结束时间,年

g – 时间周期。Example: g=w, 表示周期是’周’。d->’日’(day), w->’周’(week),m>’月’(mouth),v->’dividends only’一定注意月份参数,其值比真实数据-1。如需要9月数据,则写为08。

3、通过API获取深沪股票数据

雅虎的API是国际性的,支持查询国内沪深股市的数据,但代码稍微变动一下,如浦发银行的代号是:600000.SS。规则是:上海市场末尾加.ss,深圳市场末尾加.sz。

2. 请问怎样用Java获取股票行情历史数据新浪、搜狐、百度财经都可以......

publicclassStockConnection{
publicstaticvoidmain(String[]args){
URLur=null;
try{
//搜狐股票行情历史接口
// ur=newURL("http://q.stock.sohu.com/hisHq?code=cn_300228&start=20130930&end=20131231&stat=1&order=D&period=d&callback=historySearchHandler&rt=jsonp");
//新浪股票行情历史接口
ur=newURL("http://biz.finance.sina.com.cn/stock/flash_hq/kline_data.php?&rand=random(10000)&symbol=sh600000&end_date=20150809&begin_date=20000101&type=plain");
HttpURLConnectionuc=(HttpURLConnection)ur.openConnection();
BufferedReaderreader=newBufferedReader(newInputStreamReader(ur.openStream(),"GBK"));
Stringline;
while((line=reader.readLine())!=null){
System.out.println(line);
}
}catch(Exceptione){
//TODOAuto-generatedcatchblock
e.printStackTrace();
}
}
}

3. 目前国内还有没有能够查询股票历史数据的接口

虽然市场很强,但我们最近一直强调说市场没有显得太过热。为什么这么说基于两方面:一是技术上无论K线、成交量还是均线,都不算太过热二是因为资金面推动力没有减弱或市场未进入疯狂状态,虽然量能放得很大,但量能是逐渐上来且从资金面供给上有大量的新入资金。市场现在处于什么状态一个接近过热的状态,如果这种状态继续强势持续,3000点是一大关,市场进入调整概率大。现在大盘逼近了2800点,看现在架势会有震荡,但大概率仍然拦不住。

4. 上证指数历史数据在哪里可以看到呢

适用股票分析软件、上证网以及其他证券网站均可查询!
股市指数是由证券交易所或金融服务机构编制的、表明股票行市变动的一种供参考的数字。
通过指数,对于当前各个股票市场的涨跌情况我们可以直观地看到。
股票指数的编排原理还是比较错综复杂的,那学姐就不在这里细讲了,点击下方链接,教你快速看懂指数:新手小白必备的股市基础知识大全
一、国内常见的指数有哪些?
会由股票指数的编制方法和性质来分类,股票指数有五种类型:规模指数、行业指数、主题指数、风格指数和策略指数。
这当中,最频繁遇见的当属规模指数,比如我们熟知的“沪深300”指数,它说明的是在沪深市场中交易活跃,且代表性和流动性都很好的300家大型企业股票的整体情况。
当然还有,“上证50 ”指数也属于规模指数,代表的是上海证券市场代表性好、规模大、流动性好的50 只股票的整体情况。

行业指数代表的则是某个行业目前的整体状况。比如说“沪深300医药”就算是一个行业指数,代表沪深300中的医药行业股票,反映该行业公司股票的整体表现。
某一主题的整体情况是用主题指数作为代表的,就好比人工智能、新能源汽车这些方面,以下是相关指数:“科技龙头”、“新能源车”等。
想了解更多的指数分类,可以通过下载下方的几个炒股神器来获取详细的分析:炒股的九大神器免费领取(附分享码)
二、股票指数有什么用?
经过文章前面的介绍,大家可以知道,指数选取了市场中具有代表性的一些股票,因此,指数能够帮助我们比较快速的了解到市场的整体涨跌情况,这也是对市场的热度做一个简单的了解,甚至可以预测未来的走势是怎么样的。具体则可以点击下面的链接,获取专业报告,学习分析的思路:最新行业研报免费分享

应答时间:2021-09-06,最新业务变化以文中链接内展示的数据为准,请点击查看

5. 股票历史数据接口

股票排行榜 里有个股诊断功能里面有效的分析了大年夜盘及个股压力位支撑位及消息面分析一切都是免费的。

6. 寻找股票期货数据接口。急!急!急!

国内A股的我已经列完出来了,问题那里的连接就是,改改股票代码就OK了,国外期货那些哪里找?

7. 开发炒股软件,从哪里获得股票数据

目前市场上有很多股票行情交易软件,各种软件提供了丰富的分析和展示功能,而且基本上是免费的。但这些数据都是在线的、无法统一地下载到本地进行分析,于是上网找了些资料,有的是将程序到新浪搜狐的财经频道或其他财经类网站抓取并分析网页,这种方法操作性不强而且准确率较低,遇到广告或网页变动时风险较大。于是找到了Sina股票数据接口,这个接口是通过在IE端输入"http://hq.sinajs.cn/list="+相应股票代码网站返回一个文件形式的数据,也可以通过JS获取该文件中的变量得到想要的数据字符串。
以大秦铁路(股票代码:601006)为例,如果要获取它的最新行情,只需访问新浪的股票数据接口:http://hq.sinajs.cn/list=sh601006这个url会返回一串文本,例如:
var hq_str_sh601006="大秦铁路, 27.55, 27.25, 26.91, 27.55, 26.20, 26.91, 26.92,
22114263, 589824680, 4695, 26.91, 57590, 26.90, 14700, 26.89, 14300,
26.88, 15100, 26.87, 3100, 26.92, 8900, 26.93, 14230, 26.94, 25150, 26.95, 15220, 26.96, 2008-01-11, 15:05:32";
这个字符串由许多数据拼接在一起,不同含义的数据用逗号隔开了,按照程序员的思路,顺序号从0开始。
0:”大秦铁路”,股票名字;
1:”27.55″,今日开盘价;
2:”27.25″,昨日收盘价;
3:”26.91″,当前价格;
4:”27.55″,今日最高价;
5:”26.20″,今日最低价;
6:”26.91″,竞买价,即“买一”报价;
7:”26.92″,竞卖价,即“卖一”报价;
8:”22114263″,成交的股票数,由于股票交易以一百股为基本单位,所以在使用时,通常把该值除以一百;
9:”589824680″,成交金额,单位为“元”,为了一目了然,通常以“万元”为成交金额的单位,所以通常把该值除以一万;
10:”4695″,“买一”申请4695股,即47手;
11:”26.91″,“买一”报价;
12:”57590″,“买二”
13:”26.90″,“买二”
14:”14700″,“买三”
15:”26.89″,“买三”
16:”14300″,“买四”
17:”26.88″,“买四”
18:”15100″,“买五”
19:”26.87″,“买五”
20:”3100″,“卖一”申报3100股,即31手;
21:”26.92″,“卖一”报价
(22, 23), (24, 25), (26,27), (28, 29)分别为“卖二”至“卖四的情况”
30:”2008-01-11″,日期;
31:”15:05:32″,时间;
相应地,也可以获得深市相关股票信息,但是这种方法的弊病是只能获得最新的或者是当天的股票数据,无法将历史数据导入到数据库,当然,你也可以以某一天为起始点自己重新创造历史数据。所以继续寻找其他网站接口,终于找到了雅虎财经网站,它提供的接口可以直接把股票历史数据导成Excel,真实太方便了!直接在浏览器地址中数据网址即可http://table.finance.yahoo.com/table.csv?s=股票代码,但是如果手动输入再逐一下载保存简直是太麻烦了,光上证股票就800多个,估计刚手动下载完就又开盘了还得重新下载。所以我的思路是,1、利用多线程方法下载股票文件。2、将这些文件统一导入数据库。
1.1文件下载类:
import java.io.*;
import java.net.*;
import java.util.List;
import fatowen.stocksystem.sysconfig.data.DownLoadVO;
public class HttpDownFile {
private static int BUFFER_SIZE = 8096;
/**根据URL下载文件并保存
* @param destUrl String
* @param fileName String
* @throws Exception
*/
public void saveToFile(String destUrl, String fileName) throws IOException {

FileOutputStream fos = null;
BufferedInputStream bis = null;
HttpURLConnection httpUrl = null;
URL url = null;
byte[] buf = new byte[BUFFER_SIZE];
int size = 0;

url = new URL(destUrl);
httpUrl = (HttpURLConnection) url.openConnection();
httpUrl.connect();
bis = new BufferedInputStream(httpUrl.getInputStream());
fos = new FileOutputStream(fileName);
while ((size = bis.read(buf)) != -1)
fos.write(buf, 0, size);
fos.close();
bis.close();
httpUrl.disconnect();
}
}
1.2多线程实现下载类:
import java.util.ArrayList;
import java.util.List;
public class HisDataAddThread extends Thread {
boolean runFlag = true;
List myParamList = null;
String downLoadData ="";
String baseUrl = "http://table.finance.yahoo.com/table.csv?s=";
String result = "";
String savePath = "";

public HisDataAddThread(List paramList,String savePath){
this.myParamList = paramList;
this.savePath = savePath;
}

public void run() {

while(runFlag){
downLoadData = PublicDataUtil.getDownLoadData(myParamList);
if(!Lib.isEmpty(downLoadData)){
HttpDownFile oInstance = new HttpDownFile();
try {
oInstance.saveToFile(baseUrl + downLoadData, savePath + downLoadData + ".csv");
}catch (Exception err) {
System.out.println(err.toString());
}
}else{
runFlag = false;
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public List getFailureList() {
return failureList;
}
public void setFailureList(List failureList) {
this.failureList = failureList;
}
public List getSuccessList() {
return successList;
}
public void setSuccessList(List successList) {
this.successList = successList;
}
}
2.将下载完的文件统一保存到数据库工具类
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class CSVUtitl {
private BufferedReader bufferedreader = null;
private List list = new ArrayList();

public CSVUtitl(){
}
public CSVUtitl(String filename) throws IOException{
bufferedreader = new BufferedReader(new FileReader(filename));
String stemp;
while((stemp = bufferedreader.readLine()) != null){
list.add(stemp);
}
}
public List getList() throws IOException {
return list;
}
// 得到csv文件的行数
public int getRowNum(){
return list.size();
}
//得到csv文件的列数
public int getColNum(){
if(!list.toString().equals("[]")) {

//csv文件中,每列之间的是用','来分隔的
if(list.get(0).toString().contains(",")) {
return list.get(0).toString().split(",").length;
}else if(list.get(0).toString().trim().length() != 0) {
return 1;
}else{
return 0;
}
}else{
return 0;
}
}

//取得指定行的值
public String getRow(int index) {
if (this.list.size() != 0)
return (String) list.get(index);
else
return null;
}
//取得指定列的值
public String getCol(int index){
if (this.getColNum() == 0){
return null;
}

StringBuffer scol = new StringBuffer();
String temp = null;
int colnum = this.getColNum();

if (colnum > 1){
for (Iterator it = list.iterator(); it.hasNext();) {
temp = it.next().toString();
scol = scol.append(temp.split(",")[index] + ",");
}
}else{
for (Iterator it = list.iterator(); it.hasNext();) {
temp = it.next().toString();
scol = scol.append(temp + ",");
}
}
String str=new String(scol.toString());
str = str.substring(0, str.length() - 1);
return str;
}
//取得指定行,指定列的值
public String getString(int row, int col) {
String temp = null;
int colnum = this.getColNum();
if(colnum > 1){
temp = list.get(row).toString().split(",")[col];
}else if(colnum == 1) {
temp = list.get(row).toString();
}else{
temp = null;
}
return temp;
}

public void CsvClose() throws IOException {
this.bufferedreader.close();
}
public void run(String filename) throws IOException {

CSVUtitl cu = new CSVUtitl(filename);
for(int i=0;i<cu.getRowNum();i++){
String SSCCTag = formatData(cu.getString(i,1));//得到第i行.第一列的数据.
String SiteName = formatData(cu.getString(i,2));//得到第i行.第二列的数据.
String StationId= formatData(cu.getString(i,3));

//将数据保存到数据库中
... ...
... ...
... ...
}
cu.CsvClose();
}
public String formatData(String baseData){

String result = null;
if(!"".equals(baseData) && baseData != null){
if(baseData.length() > 1){
result = baseData.substring(1,baseData.length());
result = result.substring(0, result.length()-1);
}else{
result = baseData;
}
}else{
result = "";
}
return result.trim();
}

public static void main(String[] args) throws IOException {
CSVUtitl test = new CSVUtitl();
try{
File path = new File("e:\\data");
File[] f = path.listFiles();
List l = new ArrayList();
for(int i=0;i<f.length;i++){
if(f[i].getName().endsWith(".csv"))
l.add(f[i]); www.2cto.com
}
Iterator it = l.iterator();
while(it.hasNext()){
File ff = (File)it.next();
test.run(path.toString()+File.separator+ff.getName());
}
}catch (Exception e){

}
}
}

8. 搜狐股票历史数据接口

publicclassStockConnection{
publicstaticvoidmain(String[]args){
URLur=null;
try{
//搜狐行情历史接口
// ur=newURL(");
//新浪行情历史接口
ur=newURL("(10000)&symbol=sh600000&end_date=20150809&begin_date=20000101&type=plain");
HttpURLConnectionuc=(HttpURLConnection)ur.openConnection();
BufferedReaderreader=newBufferedReader(newInputStreamReader(ur.openStream(),"GBK"));
Stringline;
while((line=reader.readLine())!=null){
System.out.println(line);
}
}catch(Exceptione){
//TODOAuto-generatedcatchblock
e.printStackTrace();
}
}
}

9. 如何获取沪深股票历史行情数据 http://hq.sinajs.cn/list=sh601006可以拿到实时数据, 但拿不到历史数据

我这里有沪股通、港股通的所有历史数据,我在我的公众中分享了获取方式,请看这篇文章:

网页链接

10. 有什么免费的股票数据web api

免费的很多,例如新浪的web api。但这种会被对方封IP。
其实免费的,最好是使用股票软件中自带的接口。例如通达信、同花顺、大智慧的公式系统。这些软件里面可编写公式,通过这些公式,就可按自己要求得到对应的股票数据了。
如果是机构,有专业的这种API接口的提供。例如微盛的金融实时行情API接口,但这种需要软件人员才搞得懂,一般人没法使用。