股票接口

股票接口


股票数据的获得

  • http/javascript接口
  • web-service接口

使用方法





股票历史数据接口

$stockCode = 600000
$url = "http://money.finance.sina.com.cn/corp/go.php/vMS_MarketHistory/stockid/{0}.phtml"
-f $stockCode
$wc = New-Object System.Net.WebClient
$content = $wc.DownloadString($url)

$reg = "s*([^s]+)s+s*
s* s+s+s+s+" $result = [RegEx]::matches($content, $reg) foreach($item in $result) { $date = $item.Groups[1].Value # 时间 $opening = $item.Groups[2].Value # 开盘 $maxHigh = $item.Groups[3].Value # 最高 $closing = $item.Groups[4].Value # 收盘 $maxLow = $item.Groups[5].Value # 最低 Write-Host $date $opening $maxHigh $closing $maxLow }

你可能感兴趣的:(股票接口)