How to get stock real-time trading data

Source: Internet
Author: User

Call Sina dedicated JS server to get the data, fast: http://hq.sinajs.cn/list=sh600151,sz000830,s_sh000001,s_sz399001,s_sz399106,s_sz399107,s_sz399108 return
var hq_str_sh600151= "Aerospace electromechanical, 7.08,7.09,6.95,7.08,6.90,6.95,6.96,4368014,30484831,2900,6.95,5700,6.94,11687,6.93,19700,6.92,28200,6.91,700,6.96,6000,6.9 7,26600,6.98,21701,6.99,104259,7.00,2012-06-12,15:03:05 "; var hq_str_sz000830=", Lu XI Chemical, 4.90,4.93,4.85,4.90,4.83,4.84,4.85,5637089,27390414.02,147400,4.84,123000,4.83,90200,4.82,103300,4.81,280200,4.80,37510,4 .85,34949,4.86,27899,4.87,31500,4.88,75400,4.89,2012-06-12,15:05:52 "; var hq_str_s_sh000001=" Shanghai Composite, 2289.791,- 16.065,-0.70,599419,5529858 "; var hq_str_s_sz399001=" Shen exponentially, 9790.197,-59.573,-0.60,71142542,5714888 "; var hq_str_s_ Sz399106= "deep syndrome, 942.182,-3.439,-0.36,49774192,5544763", var hq_str_s_sz399107= "Shen-A-means, 985.824,-3.544,- 0.36,49558295,5535505 "; var hq_str_s_sz399108=" Deep certificate B means, 621.687,-5.293,-0.84,215896,9258 ";
Note:
Shanghai Composite (index name), 2289.791 (current points), 16.065 (Chg.), 0.70 (percentage change), 599419 (total), 5529858 (transaction amount) ";
"Aerospace electromechanical, name
7.08, open today
7.09, closed yesterday
6.95, current
7.08, today's highest
6.90, today's lowest
6.95, bid price, that is, buy a quote
6.96, bid price, that is, sell an offer
4368014, the number of shares traded, should be divided by 100
30484831, transaction amount, unit of Yuan
2900,6.95, buy an application number (29 lots), buy a quote
5700,6.94, buy two application, buy two offer
11687,6.93, buy three application, buy three offer
19700,6.92, buy four application, buy four offer
28200,6.91, buy five application, buy five offers
700,6.96, sell an application, sell an offer
6000,6.97, sell two applications, sell two offers
26600,6.98, sell three applications, sell three offers
21701,6.99, sell four applications, sell four offers
104259,7.00, sell five applications, sell five offers
2012-06-12, date
15:03:05 time
Altogether 31 values.
http://hq.sinajs.cn/list=s_sz399001,s_sz399002,s_sz399003,s_sz399010,s_sz399106,s_sz399107,s_sz399108
Return
var hq_str_s_sz399001= "Deep certificate exponentially, 9790.197,-59.573,-0.60,71142542,5714888";
var hq_str_s_sz399002= "Ingredient a means, 10776.287,-64.126,-0.59,6351301,791833", var hq_str_s_sz399003= "ingredient B means, 4425.993,-39.460 , -0.88,59239,4837 "var hq_str_s_sz399010=" Shen 700,3403.759,-8.677,-0.25,17953551,1896751 "; var hq_str_s_sz399106=" Deep syndrome, 942.182,-3.439,-0.36,49774192,5544763 ", var hq_str_s_sz399107=" Shen-A-means, 985.824,-3.544,-0.36,49558295,5535505 "; var hq_str_s_sz399108= "Shen Certificate B means, 621.687,-5.293,-0.84,215896,9258";
http://hq.sinajs.cn/list=s_sh000001,s_sh000002,s_sh000003,s_sh000004,s_sh000005,s_sh000006,s_sh000007,s_sh000008
Return
var hq_str_s_sh000001= "Shanghai Composite, 2289.791,-16.065,-0.70,599419,5529858" var hq_str_s_sh000002= "A-share index, 2398.401,-16.998, -0.70,597460,5512715 "var hq_str_s_sh000003=" B-Share index, 232.017,1.908,0.83,1958,17143 "var hq_str_s_sh000004=" industrial Index, 1952.040,-17.161,-0.87,306777,3263599 "var hq_str_s_sh000005=" Business Index, 2650.303,-18.454,-0.69,19013,166771 "; var hq_ str_s_sh000006= "Real Estate Index, 3500.208,60.763,1.77,46296,287382"; var hq_str_s_sh000007= "Common Index, 3769.470,-40.401,- 1.06,63828,372671 "; var hq_str_s_sh000008=" Comprehensive index, 1931.844,-10.102,-0.52,163504,1439434 ";
http://hq.sinajs.cn/list=sh600151,sh600152,sh600153,sz000830,
Return
var hq_str_sh600151= "Aerospace electromechanical, 7.08,7.09,6.95,7.08,6.90,6.95,6.96,4368014,30484831,2900,6.95,5700,6.94,11687,6.93,19700,6.92,28200,6.91,700,6.96,6000,6.9 7,26600,6.98,21701,6.99,104259,7.00,2012-06-12,15:03:05 "; var hq_str_sh600152=" The essence of the Vico, 6.89,7.10,6.94,6.97,6.48,6.83,6.84,17509035,116787535,4900,6.83,19900,6.82,3500,6.81,38800,6.80,100,6.79,26700,6.84,4000 , 6.85,1400,6.86,14500,6.89,13600,6.90,2012-06-12,15:03:05 "var hq_str_sh600153=" to build shares, 7.47,7.52,7.62,7.68,7.46,7.61,7.62,15063933,113836559,537575,7.61,77600,7.60,102600,7.59,93900,7.58,133299,7.57,41400,7.6 2,39800,7.63,129349,7.64,193540,7.65,130400,7.66,2012-06-12,15:03:05 "; var hq_str_sz000830=", Lu XI Chemical, 4.90,4.93,4.85,4.90,4.83,4.84,4.85,5637089,27390414.02,147400,4.84,123000,4.83,90200,4.82,103300,4.81,280200,4.80,37510,4 .85,34949,4.86,27899,4.87,31500,4.88,75400,4.89,2012-06-12,15:05:52 ";
Format of the exponent
 "S_sh" + "000001" Stock code stock name 000001 Shanghai Composite 000002 A-share index 000003 B-Shares Index 000004 Industrial index 000005 Business Index 000006 Real Estate index 000007 Common index 000010 SSE 180000011 Shanghai Stock Fund 000012 Debt Index 000013 debt Index 000015 Dividend Index 000016 Shanghai 50000017 New comprehensive means 000019 governance index 000042 Shanghai Central Enterprise 000043 Super Large market 00004   9 Shanghai Private Enterprise 000054 Shanghai overseas 000055 Shanghai SSE 000056 Shanghai State-owned enterprises 000057 all-meaning growth 000058 all-meaning value 000059 all r growth 000060 all R value 000061 Shanghai-Enterprises bond 30000062 Shanghai Shanghai Cycle 000064 Non-cyclical 000066 Shanghai commodity 000067 Shanghai Emerging 000300 CSI 300000926 Central Enterprises (upper) 000927 Central Enterprises 100 (UP) 000964 the emerging 9,992 Bank three "S_SZ" + "39900 1 "399001 deep card exponentially 399002 ingredient A means 399003 component B means 399004 shen 100r399006 gem" 399101 SME Board comprehensive 399102 gem "399106 shen" comprehensive means 399107 Shen Certificate B means 399110 Agroforestry index 399120 Mining Index 399130 Manufacturing index 399131 Food Index 399132 Textile Index 399133 Timber Index 399134 paper Index 399135 Petrochemical Index 399136 Electronic index 399137 Metal Index 399138 Mechanical Index 399139 Pharmaceutical Index 399140 Hydropower Index 399150 Construction Index 399160 Transport index 399170 it index 399180 Zero Index 399190 financial index 399200 Real Estate index 399210 Service index 39 9220 Transmission Index 399300 CSI 300399305 Shenzhen Fund 399323 Deep Certificate Dividend 399352 deep report 399369 cbn-Xingye 399481 Enterprise Debt index 399606 gem R399926 Central Enterprise (deep) 399927 SOEs 100 (deep) 
Http://hq.stock.sohu.com/hqindex/finaceindex/financeindexhq1.js
Return
FORTUNE_HQ ({"CNA": [["Shanghai Index", "2289.79", " -16.06", " -0.70%", "http://q.stock.sohu.com/zs/000001/index.shtml"],["Shen Certificate exponentially "," 9790.20 "," -59.57 "," -0.60% "," http://q.stock.sohu.com/zs/399001/index.shtml "],[" SME Board Heald "," 5253.22 "," 13.70 ","- 0.26% "," http://q.stock.sohu.com/zs/399101/index.shtml "]]," CNB ": [[" B-Share Index "," 232.02 "," 1.91 "," 0.83% ","/HTTP/ q.stock.sohu.com/zs/000003/index.shtml "],[" ingredient B means "," 4425.99 "," -39.46 "," -0.88% "," http://q.stock.sohu.com/zs/ 399003/index.shtml "]", "CNF": [["Shanghai Stock Fund", "3824.81", " -21.85", " -0.57%", "http://q.stock.sohu.com/zs/000011/ Index.shtml "],[" Shenzhen Fund, "4601.38", " -25.05", " -0.54%", "http://q.stock.sohu.com/zs/399305/index.shtml"], "HK": [[" Hang Seng Index "," 18872.56 "," -81.07 "," -0.43% "," http://q.stock.sohu.com/hk/HSI/index.shtml "],[" SOE Index "," 9519.53 "," 55.27 ","- 0.58% "," http://q.stock.sohu.com/hk/HSCEI/index.shtml "],[" Red chip index "," 3789.30 "," -3.77 "," -0.10% "," http// Q.stock.sohu.com/hk/hscci/index.shtml "]", "US": [["Dow Jones Industrial Index", "12411.23", " -142.97", " -1.14%", "/http Q.stock.sohu.com/us/index.shtml? DJI "],[" Nasdaq Composite Index, "2809.73", "-48.69 "," -1.70% "," http://q.stock.sohu.com/us/index.shtml? " IXIC "],[" standard and poor 500 index "," 1312.39 "," 3.46 "," 0.26% "," http://q.stock.sohu.com/us/index.shtml? " GSPC "]})
Http://hq.stock.sohu.com/hqindex/finaceindex/financeindexhq2.js
Return
 Peak_odia ([' FINANCEINDEXHQ ', [[' zs_000001 ', ' Shanghai Composite ', ' 2289.79 ', ' -16.06 ', ' -0.70% ', ' http://q.stock.sohu.com/zs/ 000001/index.shtml '],[' zs_399001 ', ' deep proof exponentially ', ' 9790.20 ', ' -59.57 ', ' -0.60% ', ' http://q.stock.sohu.com/zs/399001/ Index.shtml '],[' zs_399101 ', ' SME board ', ' 5253.22 ', ' -13.70 ', ' -0.26% ', ' http://q.stock.sohu.com/zs/399101/index.shtml ' , [' zs_000003 ', ' B-Share index ', ' 232.02 ', ' +1.91 ', ' 0.83% ', ' http://q.stock.sohu.com/zs/000003/index.shtml '],[' zs_399003 ', ' Ingredient B means ', ' 4425.99 ', ' -39.46 ', ' -0.88% ', ' http://q.stock.sohu.com/zs/399003/index.shtml '],[' zs_000011 ', ' Shanghai Stock Fund ', ' 3824.81 ', ' -21.85 ', ' -0.57% ', ' http://q.stock.sohu.com/zs/000011/index.shtml '],[' zs_399305 ', ' Shenzhen Fund ', ' 4601.38 ', '- 25.05 ', ' -0.54% ', ' http://q.stock.sohu.com/zs/399305/index.shtml '],[' HSI ', ' Hang Seng index ', ' 18872.56 ', '-81.07 ', '-0.43% ', ' Http://q.stock.sohu.com/hk/HSI/index.shtml '],[' Hscci ', ' Red chip index ', ' 3789.30 ', ' -3.77 ', ' -0.10% ', '/HTTP ' Q.stock.sohu.com/hk/hscci/index.shtml '],[' HSCEI ', ' SOE index ', ' 9519.53 ', ' -55.27 ', ' -0.58% ', ' http://q.stock.sohu.com/ Hk/hscei/index.shtml ']) 

Http://hq.stock.sohu.com/hqindex/finaceindex/financeindexhq.js
Return
Peak_odia ([' FINANCEINDEXHQ ', [[' zs_000001 ', ' Shanghai Composite ', ' 2289.79 ', ' -16.06 ', ' -0.70% ', ' http://q.stock.sohu.com/zs/ 000001/index.shtml '],[' zs_399001 ', ' deep proof exponentially ', ' 9790.20 ', ' -59.57 ', ' -0.60% ', ' http://q.stock.sohu.com/zs/399001/ Index.shtml '],[' zs_399101 ', ' SME board ', ' 5253.22 ', ' -13.70 ', ' -0.26% ', ' http://q.stock.sohu.com/zs/399101/index.shtml ' , [' zs_000003 ', ' Shanghai share B ', ' 232.02 ', ' +1.91 ', ' 0.83% ', ' http://q.stock.sohu.com/zs/000003/index.shtml '],[' zs_399003 ', ' Ingredient B means ', ' 4425.99 ', ' -39.46 ', ' -0.88% ', ' http://q.stock.sohu.com/zs/399003/index.shtml '],[' zs_000011 ', ' Shanghai Stock Fund ', ' 3824.81 ', ' -21.85 ', ' -0.57% ', ' http://q.stock.sohu.com/zs/000011/index.shtml '],[' zs_399305 ', ' Shenzhen Fund ', ' 4601.38 ', '- 25.05 ', ' -0.54% ', ' http://q.stock.sohu.com/zs/399305/index.shtml '],[' HSI ', ' Hang Seng index ', ' 18872.56 ', '-81.07 ', '-0.43% ', ' Http://q.stock.sohu.com/hk/HSI/index.shtml '],[' HSCEI ', ' State Enterprise index ', ' 9519.53 ', ' -55.27 ', ' -0.58% ', '/HTTP ' Q.stock.sohu.com/hk/hscei/index.shtml '],[' Hscci ', ' Red chip index ', ' 3789.30 ', ' -3.77 ', ' -0.10% ', ' HTTP://Q.STOCK.SOHU.COM/HK /hscci/index.shtml ']],[[[' cn_600401 ', ' hairun photovoltaic ',' 7.99 ', ' 10.06% '],[' cn_600978 ', ' Yihua wood ', ' 5.27 ', ' 7.55% '],[' cn_600777 ', ' trendy industry ', ' 5.35 ', ' 6.36% '],[' cn_600596 ', ' Xin ' an shares ', ' 6.62 ', ' 6.09% '],[' cn_600657 ', ' Xinda property ', ' 5.01 ', ' 5.92% ']],[[' cn_601339 ', ' N Blum ', ' 12.33 ', ' -9.34% '],[' cn_601908 ', ' Beijing Express ', ' 8.60 ', ' -7.13% '],[' cn_600495 ', ' jinxi axle ', ' 12.30 ', ' -6.32% '],[' cn_600158 ', ' xd-in-production ', ' 6.99 ', ' -6.30% '],[' cn_600470 ', ' six-nation chemical ', ' 10.42 ', ' -6.21% ']],[[' cn_002683 ', ' N Grand ', ' 16.00 ', ' 10.65% '],[' cn_000736 ', ' Chongqing Industrial ', ' 10.85 ', ' 10.04% '],[' cn_002499 ', ' Colin Green ', ' 21.43 ', ' 10.01% '],[' cn_300147 ', ' Snow Pharma ', ' 8.37 ', ' 9.99% '],[' cn_300266 ', ' Xing Yuan filter ', ' 19.07 ', ' 9.98% ']],[[' cn_ 002238 ', ' Tianwei video ', ' 14.74 ', ' -9.40% '],[' cn_002685 ', ' N Wah heavy Machine ', ' 9.08 ', ' -9.11% '],[' cn_002682 ', ' N Dragon Continent ', ' 9.76 ', ' -7.92% '],[' CN _300136 ', ' letter-dimensional communication ', ' 15.36 ', ' -7.69% '],[' cn_002616 ', ' Evergreen Group ', ' 17.45 ', ' -6.03% ']]],[[' ', ' s board ', ' 8 ', ' 10.16 ', ' +0.12 ', ' 0.65% ', ' 111101 ', ' 9321 ', ' cn_600733 ', ' s*st striker ', ' 18.26 ', ' +0.87 ', ' 5% '],[' 22 ', ' real estate ', ' 143 ', ' 7.69 ', ' +0.05 ', ' 0.65% ', ' 14823974 ', ' 1117434 ', ' cn_000736 ', ' Chongqing Industrial ', ' 10.85 ', ' +0.99 ', ' 10.04% '],[' 59 ', ' Medicine plate ', ' 188 ', ' 16.54 ', ' +0.16 ', ' 0.63% ', ' 6170241 ', ' 874796 ', ' cn_300147 ', ' Snow Pharma ', ' 8.37 ', ' +0.76 ', ' 9.99% '],[' the ', ' st plate ', ' 139 ', ' 7.18 ', ' +0.02 ', ' 0.56% ', ' 3426392 ', ' 203147 ' , ' cn_600074 ', ' St Delta ', ' 3.07 ', ' +0.15 ', ' 5.14% '],[' 291 ', ' Chongqing plate ', ' ', ' 10.57 ', ' +0.03 ', ' 0.40% ', ' 1374186 ', ' 139496 ', ' cn_ ' 000736 ', ' Chongqing Industrial ', ' 10.85 ', ' +0.99 ', ' 10.04% ']]
---------------------------------------------
HTTP://HQ.SINAJS.CN/LIST=S_SH000001 Index
Http://hq.sinajs.cn/list=s_sz399001 deep syndrome exponentially
Http://hq.sinajs.cn/list=int_hangseng Hang Seng Index
http://hq.sinajs.cn/list=s_sz399300 Shanghai Sheng 300
Http://hq.sinajs.cn/list=int_dji Dow Jones
Http://hq.sinajs.cn/list=int_nasdaq Nasdaq
http://hq.sinajs.cn/list=int_sp500 S & P 500
Http://hq.sinajs.cn/list=int_ftse ft Index
---------------------------------------------------------Futures http://hq.sinajs.cn/rn=1318986550609&list= Hf_cl,hf_gc,hf_si,hf_cad,hf_zsd,hf_s,hf_c,hf_w
Return
 var hq_str_hf_cl= " 83.3500,0.7860,83.3400,83.3500,83.4300,81.0700,22:47:46,82.7000,81.2700,17929,0,0,2012-06-12 "; var hq_str_hf_GC= "1608.4000,0.7265,1608.3000,1608.4000,1611.6000,1587.0000,22:47:46,1596.8000,1597.1000,17965,0,0,2012-06-12"; var hq_str_hf_si= "28.7500,0.4893,28.7400,28.7500,28.9500,28.3100,22:47:44,28.6100,28.5000,7509,0,0,2012-06-12"; var hq_str_hf_cad= "7392.5000,- 0.2133,7390.5000,7392.2998,7444.2998,7328.2998,22:47:46,7408.2998,7368.0000,12568,1,1,2012-06-12 "; var hq_str_hf _zsd= "1886.0000,- 0.2116,1886.0000,1888.3000,1893.3000,1874.3000,22:47:34,1890.0000,1885.0000,3502,1,2,2012-06-12 "; var hq_str_hf_ S= "1428.5000,0.2632,1428.0000,1428.5000,1449.2500,1416.2500,22:47:46,1424.7500,1426.7500,5144,0,0,2012-06-12"; var hq_str_hf_c= "584.5000,- 1.2669,584.5000,584.7500,598.5000,575.5000,22:47:45,592.0000,593.5000,3509,0,0,2012-06-12 "; var hq_str_hf_W=" 622.7500,-1.2292,622.7500,623.0000,639.5000,618.2500,22:47:45,630.5000,628.5000,2433,0,0,2012-06-12 "; 
Foreign exchange
Http://hq.sinajs.cn/rn=1318986628214&list=USDCNY,USDHKD,EURCNY,GBPCNY,USDJPY,EURUSD,GBPUSD,
Return
var hq_str_usdcny= "16:58:22,6.3705,6.3673,6.3692,32,6.3694,6.3782,6.3685,6.3705, USD rmb"; var hq_str_usdhkd= " 22:48:57,7.7594,7.7596,7.7599,2,7.7601,7.7601,7.7531,7.7594, US Dollar "; var hq_str_eurcny=" 22:44:55,7.9453,7.9478,7.8917,25,7.9491,7.9725,7.8917,7.9453, euro renminbi "; var hq_str_gbpcny=" 22:44:55,9.9032,9.9057,9.7923,25,9.8649,9.9103,9.7923,9.9032, GBP RMB "; var hq_str_usdjpy=" 22:48:56,79.50,79.50,79.38,0,79.38,79.69,79.15,79.50, USD yen "; var hq_str_eurusd=" 22:48:57,1.2468,1.2468,1.2467,0,1.2469,1.2529,1.2441,1.2468, Euro dollar "; var hq_str_gbpusd=" 22:48:57,1.5537,1.5542,1.5471,5,1.5469,1.5557,1.5454,1.5537, GBP USD ";
--------------
Day Candlestick
Http://image.sinajs.cn/newchart/daily/n/sh601006.gif
Weekly Candlestick
Http://image.sinajs.cn/newchart/weekly/n/sh601006.gif
Moon Candlestick
Http://image.sinajs.cn/newchart/monthly/n/sh601006.gif
Tick chart
Http://image.sinajs.cn/newchart/min/n/sh000001.gif
This is the code that a person (http://blog.csdn.net/jiangxinyu/article/details/6150476) writes Java to get the data:
  String url = "http://hq.sinajs.cn/list=sh600151,sz000830,s_sh000001,s_sz399001,s_sz399106";            try {URL u = new url (URL);            Byte[] B = new byte[256];            InputStream in = null;            Bytearrayoutputstream bo = new Bytearrayoutputstream ();                    while (true) {try {in = U.openstream ();                    int i;                    while ((i = In.read (b))! =-1) {bo.write (b, 0, I);                    The String result = bo.tostring ();                    string[] stocks = Result.split (";");                        for (String stock:stocks) {string[] datas = Stock.split (",");                According to the control of their corresponding data} bo.reset ();                } catch (Exception e) {System.out.println (E.getmessage ()); } finally {if (in! = null) {in.close ();                   }}}} catch (Exception ex) {System.out.println (ex.getmes        Sage ()); }
Sohu Securities Http://q.stock.sohu.com/index.shtml

How to get stock real-time trading data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.