# 股票行情
# 阿里云地址
https://market.aliyun.com/products/57000002/cmapi010845.html
# 大盘股指行情_批量
# 数据准备
export default {
data(){
return {
data:{
"showapi_res_code": 0,
"showapi_res_error": "",
"showapi_res_body": {
"ret_code": 0,
"indexList": [//股票指数列表
{
"yestodayClosePrice": 3131.9385,//昨日收盘价
"max52": "",
"diff_money": "-16.1398",//涨跌金额
"tradeNum": 130848835,//成交量
"code": "sh000001",//指数编码
"maxPrice": 3129.8382,//最高价
"nowPrice": 3115.7987,//当前价
"min52": "",
"time": "2016-10-26 13:37:00.022",//刷新时间
"name": "上证指数",//指数名称
"tradeAmount": 147643643377,//成交金额
"swing": "0.5515%",
"todayOpenPrice": 3129.8382,//今日开盘价
"diff_rate": "-0.5153%",//涨跌幅度
"minPrice": 3112.5663//最低价
},
//...
]
}
}
}
}
}
# 页面呈现
<aps-ali-010845 :data="data" ></aps-ali-010845>
# 最终的展示效果
提示
可以按价格排序
# 大盘股指K线数据
# 数据准备
export default {
data(){
return {
kline_data:{
"showapi_res_code": 0,
"showapi_res_error": "",
"showapi_res_body": {
"dataList": [//k线数据结构
{
"min": "3231.050",//时间区间内最小的价格
"time": "201612091500",//时间点,5分|30分|60分k线时,此时间返回到分钟级别。day|week|month的k线时,时间返回到天级别。
"open": "3232.030",//时间区间开始的价格
"volumn": "6283731.000",//时间区间成交手数总合
"max": "3233.590",//时间区间内最高的价格
"close": "3232.880"//时间区间结束的价格
},
{
"min": "3227.070",//时间区间内最小的价格
"time": "201612091455",//时间点,5分|30分|60分k线时,此时间返回到分钟级别。day|week|month的k线时,时间返回到天级别。
"open": "3227.330",//时间区间开始的价格
"volumn": "5896942.000",//时间区间成交手数总合
"max": "3231.810",//时间区间内最高的价格
"close": "3231.810"//时间区间结束的价格
},
{
"min": "3225.540",//时间区间内最小的价格
"minute": "201612091450",//时间点,分钟
"open": "3226.550",//时间区间开始的价格
"volumn": "4614218.000",//时间区间成交手数总合
"max": "3228.230",//时间区间内最高的价格
"close": "3228.230"//时间区间结束的价格
}
],
"ret_code": 0,
"market": "sh",
"count": "232",
"name": "上证指数",
"code": "000001"
}
}
}
}
}
# 页面呈现
<aps-ali-010845-kline :data="kline_data" ></aps-ali-010845-kline>
# 最终的展示效果
# 大盘历史查询
# 数据准备
export default {
data(){
market_history:{
"showapi_res_code": 0,
"showapi_res_error": "",
"showapi_res_body": {
"ret_code": 0,
"month": "201702",
"list": [
{
"min_price": "3225.97", //最低价
"trade_num": "1512443", //交易手数
"trade_money": "186019288810", //交易金额(元)
"diff_money": "13.07", //涨跌额
"close_price": "3241.73",//收盘价
"open_price": "3225.97", //开盘价
"max_price": "3242.68", //最高价
"date": "2017-02-28", //日期
"diff_rate": "0.40" //涨跌幅
},
{
"min_price": "3224.09",
"trade_num": "1825810",
"trade_money": "211395715856",
"diff_money": "-24.77",
"close_price": "3228.66",
"open_price": "3249.19",
"max_price": "3251.65",
"date": "2017-02-27",
"diff_rate": "-0.76"
}
]
}
}
}
}
# 页面呈现
<aps-ali-010845-market-history :data="market_history" ></aps-ali-010845-market-history>
# 最终的展示效果
# 大盘股指分时线
# 数据准备
export default {
data(){
index_timeline:{
"showapi_res_code": 0,
"showapi_res_error": "",
"showapi_res_body": {
"dataList": [//分时线每天的数据结构
{
"minuteList": [//分时线数据列表
{
"time": "0930",//当前分钟
"avgPrice": "3209.34",//均价
"volume": "80373500",//交易量(单位股)
"nowPrice": "3209.34"//当前时间的价格
},
{
"time": "0931",//当前分钟
"avgPrice": "3208.4",//均价
"volume": "288984500",//交易量(单位股)
"nowPrice": "3207.46"//当前时间的价格
}
],
"count": "242",//总条目数
"yestclose": "3215.37",//昨日收盘价
"lastVolume": "20402395600",//昨日成交量
"date": "20161209"//当前日期
},
{
"minuteList": [//分时线数据列表
{
"time": "0932",//当前分钟
"avgPrice": "3209.34",//均价
"volume": "80373500",//交易量(单位股)
"nowPrice": "3207.46"//当前时间的价格
},
{
"time": "0933",//当前分钟
"avgPrice": "3208.4",//均价
"volume": "288984500",//交易量(单位股)
"nowPrice": "3209.34"//当前时间的价格
}
],
"count": "242",//总条目数
"yestclose": "3215.37",//昨日收盘价
"lastVolume": "20402395600",//昨日成交量
"date": "20161210"//当前日期
},
],
"ret_code": 0,
"market": "sh",
"name": "上证指数",
"code": "000001"
}
}
}
}
# 页面呈现
<aps-ali-010845-index-timeline :data="index_timeline" ></aps-ali-010845-index-timeline>
# 最终的展示效果
上证指数 - 股票代码 000001
# 股票实时分时线数据
# 数据准备
export default {
data(){
return {
timeline:{
"showapi_res_code": 0,
"showapi_res_error": "",
"showapi_res_body": {
"dataList": [//分时线每天的数据结构
{
"minuteList": [//分时线数据列表
{
"time": "0930",//当前分钟
"avgPrice": "7.55",//均价
"volume": "0",//交易量
"nowPrice": "7.55"//当前时间的价格
},
{
"time": "0931",//当前分钟
"avgPrice": "7.555",//均价
"volume": "347785",//交易量
"nowPrice": "7.56"//当前时间的价格
},
{
"time": "0932",//当前分钟
"avgPrice": "7.56",//均价
"volume": "146900",//交易量
"nowPrice": "7.57"//当前时间的价格
},
{
"time": "0933",//当前分钟
"avgPrice": "7.563",//均价
"volume": "47800",//交易量
"nowPrice": "7.57"//当前时间的价格
},
{
"time": "0934",//当前分钟
"avgPrice": "7.564",//均价
"volume": "166800",//交易量
"nowPrice": "7.57"//当前时间的价格
},
{
"time": "0935",//当前分钟
"avgPrice": "7.565",//均价
"volume": "131200",//交易量
"nowPrice": "7.57"//当前时间的价格
},
{
"time": "0936",//当前分钟
"avgPrice": "7.564",//均价
"volume": "162900",//交易量
"nowPrice": "7.56"//当前时间的价格
}
],
"count": "242",//总条目数
"yestclose": "7.55",//昨日收盘价
"lastVolume": "22240988",//昨日成交量
"date": "20161125"//当前日期
}
],
"ret_code": 0,
"market": "sh",
"name": "中国石油",
"code": "601857"
}
}
}
}
}
# 页面呈现
<aps-ali-010845-timeline :data="timeline" ></aps-ali-010845-timeline>
# 最终的展示效果
中国石油 - 股票代码 601857
# 股票行情单支查询
# 数据准备
export default {
data(){
return {
real_stockinfo:{
"showapi_res_code": 0,
"showapi_res_error": "",
"showapi_res_body": {
"ret_code": 0,
"stockMarket": {
"todayMax": "16.160",//今日最高价
"highLimit": "17.57",//涨停价
"buy5_n": "18100",//买五
"buy2_n": "56600",//买二
"tradeNum": "3336273",//成交量(股,不是手)
"buy2_m": "16.080",//买二报价
"buy5_m": "16.050",//买五报价
"currcapital": "115641.6852",
"sell3_m": "16.120",//卖三报价
"openPrice": "15.950",//今日开盘价
"buy3_m": "16.070",//买三报价
"buy4_m": "16.060",//买四报价
"circulation_value": "186.18",//流通市值,亿元
"buy4_n": "25000",//买四
"date": "2017-04-18",//日期
"sell5_n": "19300",//卖五
"buy3_n": "35800",//买三
"all_value": "186.18",//总市值,亿元
"sell5_m": "16.140",//卖五报价
"closePrice": "15.970",//昨日收盘价
"time": "11:11:43",//刷新时间
"turnover": "0.289%",//换手率
"sell3_n": "12900",//卖三
"name": "白云机场",//上证指数
"sell4_n": "9600",//卖四
"downLimit": "14.37",//跌停价
"sell4_m": "16.130",//卖四报价
"tradeAmount": "53647432.000",//成交金额(元)
"swing": "1.31",//振幅
"totalcapital": "115641.6852", //总股本,万股
"diff_rate": "0.81",//涨跌幅度
"yestodayClosePrice": "15.970",//昨日收盘价
"sell1_n": "67963",//卖一
"todayMin": "15.950",//今日最低价
"sell1_m": "16.100",//卖一报价
"max52": "",//52周最高价
"diff_money": "0.13",//涨跌金额
"code": "600004",//sh000001
"nowPrice": "16.100",//当前价
"sell2_m": "16.110",//卖二
"min52": "",//52周最低价
"sell2_n": "20879",//卖二
"buy1_m": "16.090",//买一报价(金额,元)
"pe": "13.64",//市盈率(TTM,动态)
"buy1_n": "53900",//买一数量(股)
"market": "sh",
"pb": "1.74"//市净率
},
"indexList": [
//...
]
}
}
}
}
}
# 页面呈现
<aps-ali-010845-real-stockinfo :data="real_stockinfo" ></aps-ali-010845-real-stockinfo>
# 最终的展示效果
白云机场(600004.SH)
16.100
0.13
+0.81%
涨停:17.57
跌停:14.37
2017-04-18 11:11:43
今 开: 15.950
最 高: 16.160
最 低: 15.950
昨 收: 15.970
总股本: 115.64亿
成交量: 333.63万股
成交额: 5364.74万元
总市值: 186.18亿元
流通值: 186.18亿元
流通股: --
振 幅: 1.31%
换手率:0.289%
市净率: 1.74
市盈率: 13.64
# 股票K线数据
# 数据准备
export default {
data(){
return {
timeline_k:{
"showapi_res_code": 0,
"showapi_res_error": "",
"showapi_res_body": {
"dataList": [//k线数据结构
{
"min": "14.910",//时间区间内最小的价格
"open": "14.910",//时间区间开始的价格
"volumn": "53486.000",//时间区间成交手数总合
"time": "20161110",//时间点,5分|30分|60分k线时,此时间返回到分钟级别。day|week|month的k线时,时间返回到天级别。
"max": "15.320",//时间区间内最高的价格
"close": "15.170"//时间区间结束的价格
},
{
"min": "14.680",
"open": "15.040",
"volumn": "57193.000",
"time": "20161109",
"max": "15.070",
"close": "14.830"
},
{
"min": "14.850",
"open": "14.880",
"volumn": "48127.000",
"time": "20161108",
"max": "15.090",
"close": "15.050"
},
{
"min": "14.580",
"open": "14.640",
"volumn": "44579.000",
"time": "20161107",
"max": "14.860",
"close": "14.840"
}
],
"ret_code": 0,
"market": "sh",
"count": "8",
"name": "白云机场",
"code": "600004"
}
}
}
}
}
# html代码
<aps-ali-010845-timeline-k :data="timeline_k" />
# 最终展示
# 沪深及港股历史行情
# 数据准备
export default {
data(){
return {
sz_sh_stock_history:{
"showapi_res_code": 0,
"showapi_res_error": "",
"showapi_res_body": {
"ret_code": 0,
"list": [//历史记录的列表
{
"min_price": "11.510",//最低价
"market": "sh",//市场,例如sh
"trade_num": "17541504",//交易手数
"trade_money": "215834624",//交易金额元
"close_price": "12.480",//收盘价
"open_price": "11.700",//开盘价
"code": "600004",//股票代码
"max_price": "12.700",//最高价
"date": "2015-09-02"//日期,例如2015-09-02
},
{
"min_price": "11.920",//最低价
"market": "sh",//市场,例如sh
"trade_num": "8111935",//交易手数
"trade_money": "99310240",//交易金额元
"close_price": "12.110",//收盘价
"open_price": "12.680",//开盘价
"code": "600004",//股票代码
"max_price": "12.680",//最高价
"date": "2015-09-01"//日期,例如2015-09-02
}
]
}
}
}
}
}
# html代码
<aps-ali-010845-sz-sh-stock-history :data="sz_sh_stock_history" />
# 最终展示
# 大盘股指列表查询
# 数据准备
export default {
data(){
return {
stockindexsearch:{
"showapi_res_code": 0,
"showapi_res_error": "",
"showapi_res_body": {
"allPages": 6,
"contentlist": [
{
"market": "sh",//市场简写
"name": "港中小企",//股票名称
"code": "000867",//编码
"pinyin": "gzxq"//拼音首字母
},
{
"market": "sh",//市场简写
"name": "HK银行",//股票名称
"code": "000869",//编码
"pinyin": "hkyx"//拼音首字母
}
],
"currentPage": 1,
"allNum": 296,
"maxResult": 50
}
}
}
}
}
# html代码
<aps-ali-010845-stockindexsearch :data="stockindexsearch" />
<!--不显示翻页-->
<aps-ali-010845-stockindexsearch :data="stockindexsearch" :showPage="false" />
<!--切换页码事件-->
<aps-ali-010845-stockindexsearch :data="stockindexsearch" @current-change="changePage" />
<script>
function changePage(page){
alert(page);
}
</script>
# 最终展示
共 296 条
- 1
- 2
- 3
- 4
- 5
- 6
# 参数列表
参数 | 类型 | 说明 |
---|---|---|
showPage | boolean | 是否显示分页,默认true |
# 事件
事件名称 | 说明 | 回调参数 |
---|---|---|
current-change | 当前页码改变时会触发 | 当前页码 |
# 查询港股板块中的股票列表
# 数据准备
export default {
data(){
return {
hk_in_block:{
"showapi_res_code": 0,
"showapi_res_error": "",
"showapi_res_body": {
"ret_code": 0,
"pagebean": {
"allPages": 1,
"contentlist": [
{
"totalcapital_val": "10129054.8192", //总市值,万元
"market": "hk",
"currcapital_val": "10129054.8192", //流通市值,万元
"name": "新世界发展",
"code": "00017"
},
{
"totalcapital_val": "7010820.47",
"market": "hk",
"currcapital_val": "7010820.47",
"name": "太古A",
"code": "00019"
}
],
"name": "恒生行业>综合企业",
"currentPage": 1,
"allNum": 24,
"maxResult": 40,
"typeId": "hk_hshy800"
}
}
}
}
}
}
# html代码
<aps-ali-010845-hk-in-block :data="hk_in_block" />
<!--不显示翻页-->
<aps-ali-010845-hk-in-block :data="hk_in_block" :showPage="false" />
<!--切换页码事件-->
<aps-ali-010845-hk-in-block :data="hk_in_block" @current-change="changePage" />
<script>
function changePage(page){
alert(page);
}
</script>
# 最终展示
共 24 条
- 1
# 参数列表
参数 | 类型 | 说明 |
---|---|---|
showPage | boolean | 是否显示分页,默认true |
# 事件
事件名称 | 说明 | 回调参数 |
---|---|---|
current-change | 当前页码改变时会触发 | 当前页码 |
# 查询沪深板块中的股票列表
提示
由于数据格式跟港股板块中的股票列表一样,可以使用 aps-ali-010845-hk-in-block
# 当日除权停复牌上市股票
# 准备数据
export default {
data(){
return {
stop_start_divide:{
"showapi_res_code": 0,
"showapi_res_error": "",
"showapi_res_body": {
"date": "2017-04-18",
"ret_code": 0,
"stopList": [ //停牌股票列表
{
"reason": "重大事项", //原因
"name": "东旭蓝天", //股票名称
"code": "000040" //股票编码
}
],
"recoverList": [ //复牌股票列表
{
"reason": "重大事项",
"name": "中基健康",
"code": "000972"
}
],
"startList": [ //首发上市股票列表
{
"reason": "发行数量5550万股,发行价格人民币5.48元/股,发行市盈率21.92倍,本次流通数量5550万股",
"name": "今飞凯达",
"code": "002863"
}
],
"newStockNetPublishList": [ //首发新股网上发行列表
{
"reason": "发行数量7685万股,发行价格人民币19.92元/股,发行市盈率22.99倍,网下询价发行,申购代码002867\\002867",
"name": "周大生",
"code": "002867"
}
],
"stockholderList": [ //股东资格登记日列表
{
"reason": "2016年度股东大会",
"name": "深深房A",
"code": "000029"
}
],
"addNewStockNetPublishList": [ //增发新股上市列表
{
"reason": "发行数量2956.9706万股,发行价格人民币70.63元/股",
"name": "天神娱乐",
"code": "002354"
}
],
"shareRegistList": [ //分红转增股权登记列表
{
"reason": "10派0.8元",
"name": "贵州百灵",
"code": "002424"
}
],
"shareDividendList": [ //除权除息列表
{
"reason": "10转增10股派1元",
"name": "京蓝科技",
"code": "000711"
}
],
"stockAlarmList": [//退市风险警示列表
{
"reason": "*ST,最近两年净利润均为负",
"name": "中基健康",
"code": "000972"
}
]
}
}
}
}
}
# html代码
<aps-ali-010845-stop-start-divide :data="stop_start_divide" />
# 最终展示
← PM2.5空气质量指数 今日油价 →