Original information: 04 / 14 2018
The main sources of stock data are: data supermarket, Yahoo, Sina, Google, Hexun, Sohu, China Stock Web Service, Oriental Wealth Client, Securities Star, Netease Finance.
YAHOO
Disadvantages: Some U.S. holiday data will be in short supply; calls should not exceed 200 times a minute, otherwise IP addresses will be warned and blocked; custom column fetching methods can only fetch U.S. stock data.
Advantages: Data is most standardized and can be obtained from other countries’markets; return data types can be customized combinations.
Method 1:http://table.finance.yahoo.com/table.csv? S= stock code
Return result: CSV file, return column is “date, opening price, highest price, lowest price, closing price, volume, compound price”.
Its stock code needs to be marked at the end of the market, such as the Shanghai Stock Exchange Index stock code 600000.ss, Shenzhen Stock Index 399001.sz.
Methods 2:http://finance.yahoo.com/d/quotes.csv? S= stock code & f=[custom column]
Return result: CSV file, data of the last trading day, column returned according to the set custom column.
For example: http://finance.yahoo.com/d/quotes.csv?S = TWTR& f = nt1, returns the name of the TWTR stock and the last trading time.
Methods 3:http://quote.yahoo.com/d/quotes.csv? S= stock code & f=[custom column]
Similar to method 2.
Custom column
Market code and instructions
ChinaStockWebService
Disadvantages: instability, frequent maintenance and stop service; only the current market and historical trend chart can be obtained.
Advantages: domestic data providers, XML response, faster.
Method reference: http://www.webxml.com.cn/WebServices/ChinaStockWebService.asmx
Sina
Disadvantages: historical stock price data is not complete enough to obtain only 1023 nearest data nodes.
Advantages: Very fast; can get quotation pictures; return to JSON, easy to handle; can get historical price chart data and time-sharing trading columns.
Method 1:HTTP://HQ.SINAJS.CN/LIST=[stock code]
Return results: JSON real-time data, separated by commas related data, the data is “stock name, opening price today, closing price yesterday, current price, today’s highest price, today’s lowest price, bidding price, auction price, the number of shares traded, the amount of transaction, bidder 1, bid 1, bid 2, bid 2, bid 2, bid 2, bid 2, bid 2, bid 2, bid 1, bid 1, bid 1, bid 2, bid 2, bid 1, bid 2, bid 2, bid 2, bid 2, bid 2, bid… Buy 5 quotations,… Sell 5 quotations, dates and time.
Get the current stock market, such as http://hq.sinajs.cn/list=sh601006. Note that Sina distinguishes Shanghai from Shenzhen by SH and sz.
Method 2: get quotations for different time periods.
View the daily K-line diagram: http://image.sinajs.cn/newchart/daily/n/sh601006.gif Timeline query: http://image.sinajs.cn/newchart/miK-line query for n/n/sh000001.gif day: http://image.sinajs.cn/newchart/daily/n/sh000001.gif week K-line query: http://image.sinajs.Cn/newchart/weekly/n/sh000001.gif Monthly K-line query: http://image.sinajs.cn/newchart/monthly/n/sh000001.gif
Method 3: http://money.finance.sina.com.cn/quotes_service/api/json_v2.php/CN_MarketData.getKLineData?SymboL=[market] [stock code]& scale=[cycle]& ma=no& datalen=[length]
Return results: get 5, 10, 30, 60 minutes JSON data; day date, open opening price, high highest price, low lowest price, close closing price, volume volume; forward weight data.
Note that only the nearest 1023 data nodes can be obtained at most.
For example, http://money.finance.sina.com.cn/quotes_service/api/json_v2.php/CN_MarketData.getKLineData?= sz002095 & amp; scale = 60 & amp; Ma = no & amp; datalen = 1023, get the 60-minute data of 002095 stock in Shenzhen market, get the most recent 1023 nodes.
Method 4:http://finance.sina.com.cn/realstock/company/[market] [Stock Code] / [duplicate].js? D=[date]
[]:qianfuquan- is restored to power before reinstated, and houfuquan- is restored after power.
Returns result: stock date stock price JSON data.
For example, http://finance.sina.com.cn/realstock/company/sz002095/qianfuquan.js?D=2015-06-16, the front of the 002095 stock market in ShenzhenData for 2015-06-16 restoration.
Note that no duplicate data can be obtained.
Note that you need to process the returned data to use, Sina will add a comment at the end of the statement, scrambling date data, the key value needs to add double quotes, otherwise can not resolve JSON.
Note that since the weekly and monthly data of Sina are calculated directly from all the data of the stock daily line, it is impossible to obtain the weekly and monthly data directly through the API, which needs to be processed by oneself.
Method 5: http://market.finance.sina.com.cn/downxls.php?Date=[date]& symbol=[market][stock code]
Return data: XLS file; stock history transaction details.
For example, http://market.finance.sina.com.cn/downxls.php? Date = 2015-06-15 & amp; symbol = sz002095, to get the date of 2015-06-15Shenzhen mayor 002095 data.
Method 6: http://market.finance.sina.com.cn/pricehis.php?Symbol=[market][stock code]& startdate=[start date]& enddatE=[end date]
Return data: HTML text; stock price list within the specified date range.
For example, http://market.finance.sina.com.cn/pricehis.php? Symbol = sh600900 & amp; StartDate = 2011-08-17 & amp; enddaTe=2011-08-19, get the sub price data of Shanghai 600900 stock 2011-08-17 to 2011-08-19 date.
GoogleData is actually obtained from Sina, so you can give priority to getting from Sina, if you like Google’s API, then consider.
Advantages: reliable data.
Disadvantages: historical data can only be obtained by decomposing HTML pages; foreign data sources are slow.
Method 1: get relevant data from stock historical data.
Methods 2: https://www.google.com.hk/finance/getprices?Q=[stock code]& x=[market]& i=[interval]& p=[cycle]
For example, https://www.google.com.hk/finance/getprices?Q=002673 & x = SHE & I = 1800 & P = 30d, meaning 00267.3 of stock has a period of 30 days with a 1800 interval.
Securities Star
Disadvantages: only 80 data can be obtained.
Advantages: domestic speed is fast; JSON return is easy to resolve.
Method 1:HTTP://CQ.SSAJAX.CN/INTERACT/GETTRADEDATA.ASHX? PIC=QLPIC_[stock code] [market] [cycle]
Among them, the stock code is 000001; the market 1 represents Shanghai, 2 represents Shenzhen; the cycle 6 represents day, 7 represents week, 8 represents month. Such as: http://cq.ssajax.cn/interact/getTradedata.ashx? Pic=qlpiC_000001_1_6, get the daily data of Shanghai Composite Index.
Return result: JSON data.
Method 2:HTTP://CQ.SSAJAX.CN/INTERACT/GETTRADEDATA.ASHX? PIC=QMPIC_600308_1_6_N80
Using the Yahoo Finance API for CSV
http://blog.sina.com.cn/s/blog_54fae2350101c7ye.html
http://blog.sina.com.cn/s/blog_7ed3ed3d0102v5y7.html
http://blog.sina.com.cn/s/articlelist_2127818045_10_1.html
http://www.webxml.com.cn/WebServices/ChinaStockWebService.asmx
http://blog.sina.com.cn/s/blog_7ed3ed3d010146ti.html
http://www.cnblogs.com/me115/archive/2011/05/09/2040826.html