此web service提供个股2005年至今的日内历史数据。例如,如果要查询工商银行(601398)2006年10月27日的数据,发送请求
http://shuorel.com/ws/share/daily/v1/601398?date=2006-10-27
将返回结果
{"data":[{"code":"601398","date":"2006-10-27","open":3.4,"high":3.44,"close":3.28,"low":3.26,"volume":2582539562,"amount":8725310440}],"status":"done"}
如果要查询多日的数据,例如要查询2006-10-27, 2007-10-27, 2008-10-27, 2009-10-27, 2010-10-27这五日的数据,发送请求
将返回结果
{"data":[{"code":"601398","date":"2006-10-27","open":3.4,"high":3.44,"close":3.28,"low":3.26,"volume":2582539562,"amount":8725310440},{"code":"601398","date":"2009-10-27","open":5.19,"high":5.2,"close":5.09,"low":5.07,"volume":158426192,"amount":814316736},{"code":"601398","date":"2010-10-27","open":4.44,"high":4.51,"close":4.45,"low":4.41,"volume":155510368,"amount":691467648}],"status":"done"}
表明07和08年的10月27日不是交易日无数据。
如果要查询一段范围内的数据,例如2016年一月份所有交易日的数据,发送请求
http://shuorel.com/ws/share/daily/v1/601398?from=2016-1-1&to=2016-1-31
将返回结果
{"data":[{"code":"601398","date":"2016-01-04","open":4.58,"high":4.59,"close":4.45,"low":4.44,"volume":147508685,"amount":669360275},{"code":"601398","date":"2016-01-05","open":4.42,"high":4.51,"close":4.47,"low":4.38,"volume":160629284,"amount":715484718},{"code":"601398","date":"2016-01-06","open":4.45,"high":4.52,"close":4.51,"low":4.45,"volume":113177263,"amount":508161231},{"code":"601398","date":"2016-01-07","open":4.49,"high":4.5,"close":4.43,"low":4.42,"volume":34491508,"amount":153712624},{"code":"601398","date":"2016-01-08","open":4.44,"high":4.49,"close":4.46,"low":4.4,"volume":186134474,"amount":827886955},{"code":"601398","date":"2016-01-11","open":4.43,"high":4.43,"close":4.32,"low":4.31,"volume":164702051,"amount":722038638},{"code":"601398","date":"2016-01-12","open":4.36,"high":4.38,"close":4.32,"low":4.31,"volume":115754335,"amount":502307243},{"code":"601398","date":"2016-01-13","open":4.35,"high":4.35,"close":4.3,"low":4.29,"volume":101544385,"amount":439299085},{"code":"601398","date":"2016-01-14","open":4.26,"high":4.31,"close":4.31,"low":4.21,"volume":131047547,"amount":559263229},{"code":"601398","date":"2016-01-15","open":4.29,"high":4.3,"close":4.23,"low":4.21,"volume":101190760,"amount":430207041},{"code":"601398","date":"2016-01-18","open":4.19,"high":4.25,"close":4.19,"low":4.17,"volume":119484135,"amount":502408250},{"code":"601398","date":"2016-01-19","open":4.19,"high":4.27,"close":4.25,"low":4.18,"volume":98135774,"amount":415090802},{"code":"601398","date":"2016-01-20","open":4.25,"high":4.25,"close":4.22,"low":4.17,"volume":106584738,"amount":448627145},{"code":"601398","date":"2016-01-21","open":4.2,"high":4.26,"close":4.18,"low":4.18,"volume":84601580,"amount":356768999},{"code":"601398","date":"2016-01-22","open":4.21,"high":4.22,"close":4.22,"low":4.18,"volume":84696499,"amount":355912034},{"code":"601398","date":"2016-01-25","open":4.22,"high":4.25,"close":4.23,"low":4.2,"volume":62768998,"amount":264870077},{"code":"601398","date":"2016-01-26","open":4.21,"high":4.22,"close":4.08,"low":4.05,"volume":112381408,"amount":464737013},{"code":"601398","date":"2016-01-27","open":4.09,"high":4.15,"close":4.11,"low":4.06,"volume":152478645,"amount":625439810},{"code":"601398","date":"2016-01-28","open":4.1,"high":4.1,"close":4.05,"low":4.02,"volume":90199334,"amount":366284746},{"code":"601398","date":"2016-01-29","open":4.04,"high":4.12,"close":4.1,"low":4.03,"volume":137585643,"amount":561102779}],"status":"done"}
请注意,范围查询最多返回前50日的结果。