跳至正文

【东方财富网】抓取股票K线数据

个股【行情单页】页面,如:雅化集团 http://quote.eastmoney.com/concept/sz002497.html

作者:php-note.com  发布于:2021-10-01 18:27  分类:网络数据采集 

1.全部的【K线数据】

http://push2his.eastmoney.com/api/qt/stock/kline/get?fields1=f1%2Cf2%2Cf3%2Cf4%2Cf5%2Cf6&fields2=f51%2Cf52%2Cf53%2Cf54%2Cf55%2Cf56%2Cf57%2Cf58%2Cf59%2Cf60%2Cf61&ut=7eea3edcaed734bea9cbfc24409ed989&klt=101&fqt=1&secid=0.002497&beg=0&end=20500000&_=1633082201530

2.半年内的【K线数据】 

注意:参数 lmt=120,是用来限制返回天数的,可以自行修改。

http://61.push2his.eastmoney.com/api/qt/stock/kline/get?secid=0.002497&ut=fa5fd1943c7b386f172d6893dbfba10b&fields1=f1%2Cf2%2Cf3%2Cf4%2Cf5%2Cf6&fields2=f51%2Cf52%2Cf53%2Cf54%2Cf55%2Cf56%2Cf57%2Cf58%2Cf59%2Cf60%2Cf61&klt=101&fqt=0&end=20500101&lmt=120&_=1633085585421

返回数据:

{
  "rc": 0,
  "rt": 17,
  "svr": 182482249,
  "lt": 1,
  "full": 0,
  "data": {
    "code": "002497",
    "market": 0,
    "name": "雅化集团",
    "decimal": 2,
    "dktotal": 2592,
    "preKPrice": 42.5,
    "klines": [
      "2021-09-15,42.60,42.31,43.80,41.30,917972,3913900304.00,5.88,-0.45,-0.19,8.81",
      "2021-09-16,41.40,38.08,42.00,38.08,1037559,4104957296.00,9.26,-10.00,-4.23,9.96",
      "2021-09-17,37.00,38.47,39.10,35.15,1227038,4558927616.00,10.37,1.02,0.39,11.77",
      "2021-09-22,37.30,36.82,38.13,36.21,814484,3026831072.00,4.99,-4.29,-1.65,7.81",
      "2021-09-23,37.82,36.33,37.97,36.23,776712,2897024704.00,4.73,-1.33,-0.49,7.45",
      "2021-09-24,36.50,35.28,37.28,35.10,699515,2527602816.00,6.00,-2.89,-1.05,6.71",
      "2021-09-27,35.27,32.78,35.59,31.95,899456,3010388784.00,10.32,-7.09,-2.50,8.63",
      "2021-09-28,33.06,32.30,33.40,32.00,546692,1780502672.00,4.27,-1.46,-0.48,5.25",
      "2021-09-29,32.40,31.05,32.63,30.19,689156,2165586960.00,7.55,-3.87,-1.25,6.61",
      "2021-09-30,31.26,33.10,33.55,31.22,705757,2303402672.00,7.50,6.60,2.05,6.77"
    ]
  }
}

# 字段解析

2021-09-30,         // 日期
31.26,              // 开盘价(元)
33.10,              // 收盘价(元)
33.55,              // 最高价(元)
31.22,              // 最低价(元)
705757,             // 成交量(手)
2303402672.00,      // 成交额(元)
7.50,               // 振幅(%)
6.60,               // 涨跌幅(%)
2.05,               // 涨跌额(元)  今天的收盘价,相对昨天收盘价,增加的股价,即 涨跌额=今天收盘价-昨天收盘价
6.77                // 换手率(%)