• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 34,  comments - 5,  trackbacks - 0

            實(shí)時(shí)股票數(shù)據(jù)接口大全

            股票數(shù)據(jù)的獲取目前有如下兩種方法可以獲取:
            1. http/javascript接口取數(shù)據(jù)
            2. web-service接口

            1.http/javascript接口取數(shù)據(jù)

            1.1Sina股票數(shù)據(jù)接口

            以大秦鐵路(股票代碼:601006)為例,如果要獲取它的最新行情,只需訪問(wèn)新浪的股票數(shù)據(jù)
            接口:

            http://hq.sinajs.cn/list=sh601006

            這個(gè)url會(huì)返回一串文本,例如:

            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";

            這個(gè)字符串由許多數(shù)據(jù)拼接在一起,不同含義的數(shù)據(jù)用逗號(hào)隔開(kāi)了,按照程序員的思路,順序號(hào)從0開(kāi)始。

            0:”大秦鐵路”,股票名字;
            1:”27.55″,今日開(kāi)盤(pán)價(jià);
            2:”27.25″,昨日收盤(pán)價(jià);
            3:”26.91″,當(dāng)前價(jià)格;
            4:”27.55″,今日最高價(jià);
            5:”26.20″,今日最低價(jià);
            6:”26.91″,競(jìng)買(mǎi)價(jià),即“買(mǎi)一”報(bào)價(jià);
            7:”26.92″,競(jìng)賣價(jià),即“賣一”報(bào)價(jià);
            8:”22114263″,成交的股票數(shù),由于股票交易以一百股為基本單位,所以在使用時(shí),通常把該值除以一百;
            9:”589824680″,成交金額,單位為“元”,為了一目了然,通常以“萬(wàn)元”為成交金額的單位,所以通常把該值除以一萬(wàn);
            10:”4695″,“買(mǎi)一”申請(qǐng)4695股,即47手;
            11:”26.91″,“買(mǎi)一”報(bào)價(jià);
            12:”57590″,“買(mǎi)二”
            13:”26.90″,“買(mǎi)二”
            14:”14700″,“買(mǎi)三”
            15:”26.89″,“買(mǎi)三”
            16:”14300″,“買(mǎi)四”
            17:”26.88″,“買(mǎi)四”
            18:”15100″,“買(mǎi)五”
            19:”26.87″,“買(mǎi)五”
            20:”3100″,“賣一”申報(bào)3100股,即31手;
            21:”26.92″,“賣一”報(bào)價(jià)
            (22, 23), (24, 25), (26,27), (28, 29)分別為“賣二”至“賣四的情況”
            30:”2008-01-11″,日期;
            31:”15:05:32″,時(shí)間;

            一個(gè)簡(jiǎn)單的JavaScript應(yīng)用例子:

            < script type = " text/javascript " src = " http://hq.sinajs.cn/list=sh601006 " charset = " gb2312 " >< / script>
            <script type="text
            / javascript " >
            ?? ? var elements=hq_str_sh601006.split(
            " , " );
            ?? ?document.write(
            " current price : " +elements[3]);
            </script>

            這段代碼輸出大秦鐵路(股票代碼:601006)的當(dāng)前股價(jià)

            current price:14.20

            如果你要同時(shí)查詢多個(gè)股票,那么在URL最后加上一個(gè)逗號(hào),再加上股票代碼就可以了;比如你要一次查詢大秦鐵路(601006)和大同煤業(yè)(601001)的行情,就這樣使用URL:

            http://hq.sinajs.cn/list=sh601003,sh601001

            查詢大盤(pán)指數(shù),比如查詢上證綜合指數(shù)(000001):

            http://hq.sinajs.cn/list=s_sh000001

            服務(wù)器返回的數(shù)據(jù)為:

            var hq_str_s_sh000001="上證指數(shù),3094.668,-128.073,-3.97,436653,5458126";

            數(shù)據(jù)含義分別為:指數(shù)名稱,當(dāng)前點(diǎn)數(shù),當(dāng)前價(jià)格,漲跌率,成交量(手),成交額(萬(wàn)元);

            查詢深圳成指數(shù):

            http://hq.sinajs.cn/list=s_sz399001

            對(duì)于股票的K線圖,日線圖等的獲取可以通過(guò)請(qǐng)求http://image.sinajs.cn/…./…/*.gif此URL獲取,其中*代表股票代碼,詳見(jiàn)如下:

            查看日K線圖:

            http://image.sinajs.cn/newchart/daily/n/sh601006.gif

            查看日K線圖

            分時(shí)線的查詢:

            http://image.sinajs.cn/newchart/min/n/sh000001.gif

            分時(shí)線的查詢

            日K線查詢:

            http://image.sinajs.cn/newchart/daily/n/sh000001.gif

            日K線查詢

            周K線查詢:

            http://image.sinajs.cn/newchart/weekly/n/sh000001.gif

            周K線查詢

            月K線查詢:

            http://image.sinajs.cn/newchart/monthly/n/sh000001.gif

            月K線查詢

            1.2 Baidu&Google的財(cái)經(jīng)數(shù)據(jù)
            在baidu, google中搜索某只股票代碼時(shí),將會(huì)在頭條顯示此股票的相關(guān)信息,例如在google搜索601006時(shí),
            第一條搜索結(jié)果如下圖:
            通過(guò)點(diǎn)擊左邊的圖片我們發(fā)現(xiàn)會(huì)將此圖片鏈接到sina財(cái)經(jīng)頻道上,也就是說(shuō)google股票數(shù)據(jù)的獲取也是從sina獲取。后經(jīng)抓包分析,發(fā)現(xiàn)google也是采用1.1中介紹的接口。

            Baidu的股票數(shù)據(jù)來(lái)自baidu的財(cái)經(jīng)頻道
            http://stock.baidu.com/

            1.3 其他方式
            除了sina,baidu等網(wǎng)站提供股票信息外,其他網(wǎng)站也有類似的接口。我們分析了一款論壇上采用的股票插件,
            其中有關(guān)于實(shí)時(shí)股票數(shù)據(jù)獲取的介紹,詳見(jiàn)如下代碼,其中可以看到有些數(shù)據(jù)來(lái)自sina。
            以下是ASP示例:

            <%
            ‘==========================
            ‘ file: stock_getdata.asp
            ‘ version: 1.0.0
            ‘ copyright (c) czie.com all rights reserved.
            ‘ web: http://www.czie.com
            ‘==========================
            ?? ? ? ? function gethttp(rurl)
            ?? ? ? ? ? ? ? ? ? dim xml
            ?? ? ? ? ? ? ? ? ? on error resume next
            ?? ? ? ? ? ? ? ? ? set xml=server.createobject("Microsoft.XMLHTTP")
            ?? ? ? ? ? ? ? ? ? xml.open "get",rurl,false
            ?? ? ? ? ? ? ? ? ? xml.send
            ?? ? ? ? ? ? ? ? ? if not xml.readystate=4 or not xml.status=200 or err then gethttp="":exit function
            ?? ? ? ? ? ? ? ? ? gethttp=xml.responsetext
            ?? ? ? ? ? ? ? ? ? set xml=nothing
            ?? ? ? ? end function
            ?? ? ? ? function getstockdata(code)
            ?? ? ? ? ? ? ? ? ? ‘0=股票名稱,1=開(kāi)盤(pán)價(jià)格,2=昨收盤(pán)價(jià)格,3=當(dāng)前價(jià)格,4=最高價(jià),5=最低價(jià),30,31=更新時(shí)間
            ?? ? ? ? ? ? ? ? ? dim checkcode,stockdata,stockdatasplit
            ?? ? ? ? ? ? ? ? ? if len(code)<5 then stockdata="0,0,0,0,0,0,0,0,0,0,0,0":exit function
            ?? ? ? ? ? ? ? ? ? checkcode=mid(code,len(code)-5,1)
            ?? ? ? ? ? ? ? ? ? if int(checkcode)<=4 then
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?stockdata=gethttp("http://hq.sinajs.cn/list=sz"&code&"")
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?if not len(stockdata)=0 then stockdata=split(stockdata,chr(34))(1)
            ?? ? ? ? ? ? ? ? ? end if
            ?? ? ? ? ? ? ? ? ? if int(checkcode)>=5 then
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?stockdata=gethttp("http://hq.sinajs.cn/list=sh"&code&"")
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?if not len(stockdata)=0 then stockdata=split(stockdata,chr(34))(1)
            ?? ? ? ? ? ? ? ? ? end if
            ?? ? ? ? ? ? ? ? ? if len(stockdata)=0 then
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?stockdata="0,0,0,0,0,0,0,0,0,0,0,0"
            ?? ? ? ? ? ? ? ? ? else
            ?? ? ? ? ? ? ? ? ? ? ? ? ? stockdatasplit=split(stockdata,",")? ? ? ? ? ? ? ? ?stockdata=""&exstock.checkstr(stockdatasplit(0))&","&stockdatasplit(1)&","&stockdatasplit(2)&","&stockdatasplit(3)&","&stockdatasplit(4)&","&stockdatasplit(5)&","&formatdatetime(""&stockdatasplit(30)&" "&stockdatasplit(31)&"",0)&""
            ?? ? ? ? ? ? ? ? ? end if
            ?? ? ? ? ? ? ? ? ? ‘0=股票名稱,1=開(kāi)盤(pán)價(jià)格,2=昨收盤(pán)價(jià)格,3=當(dāng)前價(jià)格,4=最高價(jià),5=最低價(jià),6=更新時(shí)間
            ?? ? ? ? ? ? ? ? ? getstockdata=stockdata
            ?? ? ? ? end function

            ?? ? ? ? function getstockimg(code)
            ?? ? ? ? ? ? ? ? ? dim rndnum,addnum,checkcode,imgsource
            ?? ? ? ? ? ? ? ? ? if len(code)<5 then exit function
            ?? ? ? ? ? ? ? ? ? addnum=4
            ?? ? ? ? ? ? ? ? ? randomize:rndnum=cint(rnd*addnum)
            ?? ? ? ? ? ? ? ? ? select case rndnum
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?case 0
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getstockimg="http://www.10jqka.com.cn/curve/kline/?code="&code&""
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? imgsource="http://www.10jqka.com.cn"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?case 1
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getstockimg="http://stock.jrj.com.cn/htmdata/KLINE/"&code&".png"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? imgsource="http://stock.jrj.com.cn"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?case 2
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? checkcode=mid(code,len(code)-5,1)
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if int(checkcode)<=4 then
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getstockimg="http://image.sinajs.cn/newchart/daily/n/sz"&code&".gif"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? end if
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if int(checkcode)>=5 then
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getstockimg="http://image.sinajs.cn/newchart/daily/n/sh"&code&".gif"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? end if
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? imgsource="http://finance.sina.com.cn"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?case 3
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getstockimg="http://hq.gazxfe.com/stockchart/realline.chart?"&code&"&1003&SZ 500 330"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? imgsource="http://hq.gazxfe.com"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?case 4
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getstockimg="http://chartse.stockstar.com/chartserver?code="&code&""
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? imgsource="http://www.stockstar.com/"
            ?? ? ? ? ? ? ? ? ? end select
            ?? ? ? ? ? ? ? ? ? getstockimg=split(""&getstockimg&"||"&imgsource&"","||")
            ?? ? ? ? end function

            ?? ? ? ? function getastockimg()
            ?? ? ? ? ? ? ? ? ? dim rndnum,addnum,checkcode
            ?? ? ? ? ? ? ? ? ? dim getastockimgb,imgsource
            ?? ? ? ? ? ? ? ? ? addnum=6
            ?? ? ? ? ? ? ? ? ? randomize:rndnum=cint(rnd*addnum)
            ?? ? ? ? ? ? ? ? ? select case rndnum
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?case 0
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getastockimg="http://202.109.106.1/gifchartse/gif/000001.gif"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getastockimgb="http://202.109.106.1/gifchartse/gif/399001.gif"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? imgsource="http://www.stockstar.com/"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?case 1
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getastockimg="http://money.163.com/special/100.gif?C39"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getastockimgb="http://money.163.com/special/101.gif?HrS"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? imgsource="http://www.163.com"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?case 2
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getastockimg="http://www.10jqka.com.cn/curve/realtime/index2.php?code=1a0001&w=180&h=140"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getastockimgb="http://www.10jqka.com.cn/curve/realtime/index2.php?code=399001&w=180&h=140"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? imgsource="http://www.10jqka.com.cn"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?case 3
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getastockimg="http://chart.cnlist.com/stockchart/realline.chart?1a0001&1002&SZ 180 140"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getastockimgb="http://chart.cnlist.com/stockchart/realline.chart?399001&1002&SZ 180 140"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? imgsource="http://chart.cnlist.com/"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?case 4
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getastockimg="http://image.sinajs.cn/newchart/small/ish000001.gif?1189176558328"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getastockimgb="http://image.sinajs.cn/newchart/small/isz399001.gif?1189176558328"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? imgsource="http://www.sinajs.cn"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?case 5
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getastockimg="http://218.1.72.66/cgi/pic/sh/realtime/JA000001164143.png"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getastockimgb="http://218.1.72.66/cgi/pic/sz/realtime/JA399001164143.png"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? imgsource="http://www.cnstock.com/"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ?case 6
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getastockimg="http://222.73.29.85/img/000001.png"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? getastockimgb="http://222.73.29.85/img/399001.png"
            ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? imgsource="http://www.eastmoney.com/"
            ?? ? ? ? ? ? ? ? ? end select
            ?? ? ? ? ? ? ? ? ? getastockimg=split(""&getastockimg&"||"&getastockimgb&"||"&imgsource&"","||")
            ?? ? ? ? end function
            %>

            2. web-service接口

            2.1 CHINAstock的web-service:

            http://www.webxml.com.cn/WebServices/ChinaStockWebService.asmx

            中國(guó)股票行情數(shù)據(jù) WEB 服務(wù)(支持深圳和上海股市的全部基金、債券和股票),數(shù)據(jù)即時(shí)更新。輸出GIF分時(shí)走勢(shì)圖、日/周/月 K 線圖、及時(shí)行情數(shù)據(jù)(股票名稱、行情時(shí)間、最新價(jià)、昨收盤(pán)、今開(kāi)盤(pán)、漲跌額、最低、最高、漲跌幅、成交量、成交額、競(jìng)買(mǎi)價(jià)、競(jìng)賣價(jià)、委比、買(mǎi)一 - 買(mǎi)五、賣一 - 賣五)。此WEB服務(wù)提供了如下幾個(gè)接口:

            2.1.1 getStockImageByCode
            GET 股票GIF分時(shí)走勢(shì)圖
            INput:theStockCode = 股票代號(hào),如:sh000001

            POST /WebServices/ChinaStockWebService.asmx HTTP/1.1
            Host: www.webxml.com.cn
            Content-Type: text/xml; charset=utf-8
            Content-Length: length
            SOAPAction: "http://WebXml.com.cn/getStockImageByCode"

            <?xml version="1.0" encoding="utf-8"?>
            <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
            ? <soap:Body>
            ?? ?<getStockImageByCode xmlns="http://WebXml.com.cn/">
            ?? ? ?<theStockCode>string</theStockCode>
            ?? ?</getStockImageByCode>
            ? </soap:Body>
            </soap:Envelope>

            Output:

            2.1.2 getStockImageByteByCode
            獲得中國(guó)股票GIF分時(shí)走勢(shì)圖字節(jié)數(shù)組

            INput:theStockCode = 股票代號(hào),如:sh000001

            POST /WebServices/ChinaStockWebService.asmx HTTP/1.1Host: www.webxml.com.cnContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: "http://WebXml.com.cn/getStockImageByteByCode" <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">? <soap:Body>? ? <getStockImageByteByCode xmlns="http://WebXml.com.cn/">? ? ? <theStockCode>string</theStockCode>? ? </getStockImageByteByCode>? </soap:Body></soap:Envelope>

            返回的數(shù)據(jù)如下:


            R0lGODlhIQIsAfcAAAAAAAwLBxkGBQ4ODhAQEBsSChUVFS4TDB8eGQkA9koPCDAAzy4mFVgAp2UYC0IqEUYuBVwiDEAsI1QnFX8AgDU1NUozFlgxD6cBWVY5FnIwEmQ4Gc0AMlhDHPEADlVJMEpKSm1IHOUBWpY3FZMyVY9IGXRWIEFmWGNYUmpdPXJgHQB8HK9EGGBgX4lXIACoAHhkMyt4m4VkJtstbv8A

            2.1.3 getStockImage_kByCode
            直接獲得中國(guó)股票GIF日/周/月 K 線圖(545*300pixel/72dpi)
            INPUT: theStockCode = 股票代號(hào)
            theType = K 線圖類型(D:日[默認(rèn)]、W:周、M:月),

            POST /WebServices/ChinaStockWebService.asmx HTTP/1.1Host: www.webxml.com.cnContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: "http://WebXml.com.cn/getStockImage_kByCode" <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">? <soap:Body>? ? <getStockImage_kByCode xmlns="http://WebXml.com.cn/">? ? ? <theStockCode>string</theStockCode>? ? ? <theType>string</theType>? ? </getStockImage_kByCode>? </soap:Body></soap:Envelope>

            比如按照下圖所示輸入:
            返回的結(jié)果就是周K線圖:

            2.1.4 getStockImage_kByteByCode
            獲得中國(guó)股票GIF日/周/月 K 線圖字節(jié)數(shù)組
            Input:theStockCode = 股票代號(hào),如:sh000001

            POST /WebServices/ChinaStockWebService.asmx HTTP/1.1Host: www.webxml.com.cnContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: "http://WebXml.com.cn/getStockImage_kByteByCode" <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">? <soap:Body>? ? <getStockImage_kByteByCode xmlns="http://WebXml.com.cn/">? ? ? <theStockCode>string</theStockCode>? ? ? <theType>string</theType>? ? </getStockImage_kByteByCode>? </soap:Body></soap:Envelope>HTTP/1.1 200 OKContent-Type: text/xml; charset=utf-8Content-Length: length <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">? <soap:Body>? ? <getStockImage_kByteByCodeResponse xmlns="http://WebXml.com.cn/">? ? ? <getStockImage_kByteByCodeResult>base64Binary</getStockImage_kByteByCodeResult>? ? </getStockImage_kByteByCodeResponse>? </soap:Body></soap:Envelope>

            比如按照下圖輸入:
            返回的結(jié)果就是周K線圖字節(jié)數(shù)組


            R0lGODlhIQIsAfcAAAAAAAwLBxkGBQ4ODhAQEBsSChUVFS4TDB8eGQkA9koPCDAAzy4mFVgAp2UYC0IqEUYuBVwiDEAsI1QnFX8AgDU1NUozFlgxD6cBWVY5FnIwEmQ4Gc0AMlhDHPEADlVJMEpKSm1IHOUBWpY3FZMyVY9IGXRWIEFmWGNYUmpdPXJgHQB8HK9EGGBgX4lXIACoAHhkMyt4m4VkJtstbv8A

            2.1.5 getStockInfoByCode
            獲得中國(guó)股票及時(shí)行情
            input:theStockCode = 股票代號(hào)

            POST /WebServices/ChinaStockWebService.asmx HTTP/1.1Host: www.webxml.com.cnContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: "http://WebXml.com.cn/getStockInfoByCode" <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">? <soap:Body>? ? <getStockInfoByCode xmlns="http://WebXml.com.cn/">? ? ? <theStockCode>string</theStockCode>? ? </getStockInfoByCode>? </soap:Body></soap:Envelope>

            返回的值一個(gè)一維字符串?dāng)?shù)組 String(24),結(jié)構(gòu)為:String(0)股票代號(hào)、String(1)股票名稱、String(2)行情時(shí)間、String(3)最新價(jià)(元)、String(4)昨收盤(pán)(元)、String(5)今開(kāi)盤(pán)(元)、String(6)漲跌額(元)、String(7)最低(元)、String(8)最高(元)、String(9)漲跌幅(%)、String(10)成交量(手)、String(11)成交額(萬(wàn)元)、String(12)競(jìng)買(mǎi)價(jià)(元)、String(13)競(jìng)賣價(jià)(元)、String(14)委比(%)、String(15)-String(19)買(mǎi)一 - 買(mǎi)五(元)/手、String(20)-String(24)賣一 - 賣五(元)/手。

            Web service的方法類似于現(xiàn)在concurrent項(xiàng)目的DBWS數(shù)據(jù)的獲取,都是通過(guò)SOAP協(xié)議向DBWS服務(wù)器獲取相關(guān)的數(shù)據(jù)。

            利用雅虎查中國(guó)股票

            http://quote.yahoo.com/d/quotes.csv?s=MSFT&f=slc1wop

            返回微軟的股票價(jià)格

            "MSFT","4:00pm - 30.70",+1.04,"21.46 - 30.75",29.77,29.66

            http://quote.yahoo.com/d/quotes.csv?s=000969.SZ&f=slc1wop

            這個(gè)返回安泰科技的,一般有半個(gè)小時(shí)的延遲

            但是s=000969.sz 這個(gè)后面的sz是深圳的意思, 滬市是SS后綴

            posted on 2009-07-14 17:22 披星戴月 閱讀(5413) 評(píng)論(0)  編輯 收藏 引用 所屬分類: misc
            <2025年6月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            293012345

            常用鏈接

            留言簿(2)

            隨筆分類

            隨筆檔案

            文章檔案

            相冊(cè)

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            久久久久国产| 1000部精品久久久久久久久| 成人精品一区二区久久| 狠狠精品干练久久久无码中文字幕 | 久久99精品国产麻豆宅宅| 一本一道久久精品综合| 亚洲精品久久久www| 成人妇女免费播放久久久| 国产成人久久久精品二区三区| 伊人色综合久久天天网| 九九99精品久久久久久| 久久婷婷色香五月综合激情| 99久久久精品| 一本一本久久A久久综合精品 | 国产精品99久久精品| 亚洲国产天堂久久综合| 久久国产成人精品麻豆| 97精品依人久久久大香线蕉97| 日本久久久久久中文字幕| 精品无码久久久久国产动漫3d| 国产日韩久久久精品影院首页| 亚洲∧v久久久无码精品| 久久精品国产亚洲AV不卡| 久久久久久久97| 久久久无码精品亚洲日韩按摩| 18禁黄久久久AAA片| 99久久综合国产精品二区| 99久久国语露脸精品国产| 亚洲va久久久噜噜噜久久狠狠| 久久久久亚洲av成人网人人软件| 日本道色综合久久影院| 久久精品嫩草影院| 久久精品www| 97精品伊人久久久大香线蕉| 狠狠色丁香久久综合婷婷| 狠狠狠色丁香婷婷综合久久五月| 国产Av激情久久无码天堂| 国产精品久久免费| 色综合久久综精品| 久久99精品久久久久久秒播| 国产成人精品久久一区二区三区av|