如何从 Google Finance API post 2017 年 9 月 6 日获取多只股票的数据

How to fetch data from Google Finance API post 6th September 2017 for multiple stocks

Post 9 月 6 日

我正在做一个项目,我想显示来自 Google Finance API 的多个股票的实时价格,其中包含 change change in % [=17= 等信息] Timestamp of data

很少有像 ROI/EROANet-profit-margin 这样的比率 -- 这完全是可选的。 (如果可用,那就太棒了,如果没有,那也不是什么大问题。)

就效率而言,为每只股票发送一个请求是荒谬的。

我试过很多东西,比如

https://finance.google.com/finance?q=NSE:ABAN,NSE:ABB&output=json

这给了我股票的基本信息,但不是实时价格。

https://finance.google.com/finance?q=NSE:ABAN,ABB&output=json

此查询刚刚确认名称为 ABAN 的股票存在。

我对 NSE(印度国家证券交易所)的数据感兴趣。 我已经为这件事经历了 2-3 个线程,但无法获得太多信息, 雅虎也停止了对印度市场的支持,因此该选项也被排除在列表之外。

该项目是学术性的,所以如果可能的话我想要一个免费的数据源。

我们将不胜感激任何与此相关的帮助。

更新:Google 杀死了它。

您可以使用以下技巧:

  1. 查询你需要的股票ID(一次就可以,ID好像是永久的):

https://finance.google.com/finance?output=json&q=,...(每次查询最多 14 只股票)

输出将包含您应该收集的 'id' 字段。 示例:

{...
"searchresults" : [
{
"title" : "Aban Offshore Ltd",
"id" : "3302534",
"ticker" : "ABAN",
"exchange" : "NSE",
...
} , {
"title" : "ABB India Ltd",
"id" : "5296497",
"ticker" : "ABB",
"exchange" : "NSE",
...
}]
...
  1. 使用 ID 查询信息:

https://finance.google.com/finance/data?dp=mra&output=json&catid=all&cid=3302534,5296497,...(不知道限制但超过 14 个 ID)

输出将包含每个 ID 的信息

{...,company:{related:{cols:[...],
rows:[
{id:"3302534",
values:["3302534","ABAN","Aban Offshore Ltd","ABAN","NSE","INR","178.35","+0.40","chg","0.22","","-184.19","","0.39","0.59","10.41B","","0.00","","0.63","63.15","74.78","448.77","531.41","-5.34","-32.89","-6.46","1.40","-59.21","93.14","52.77","12.88","1,275","17,579.20","-10,408.33","9,275.71"]},
{id:"5296497",
values:["5296497","ABB","ABB India Ltd","ABB","NSE","INR","1,365.20","+24.00","chg","1.79","","17.88","76.36","8.66","3.09","289.56B","","4.00","0.30","1.56","7.76","7.76","18.28","18.28","4.95","11.90","9.86","1.43","4.08","32.94","7.56","5.92","5,603","91,840.50","3,744.70","6,945.30"]}],
visible_cols:[...]}}}

列是:ID、代码、名称、代码、交易所、货币、价格、变化、未知、变化%、未知、EPS、PE、PB、PS、市值, EntValue, Div, DivYield, CurrRatio, LtDebtToAssets, TotalDebtToAssets, LtDebtToEquity, TotalDebtToEquity, ReturnOnAvgAssets, ReturnOnAvgEquity, ReturnOnAvgInvestment, Beta, NetProfitMargin, GrossMargin, EBITDMargin, OperatingMargin, Employees, EBIDARevenue, 净收入=14=]

遗憾的是,没有延长时段价格或任何最后交易时间。 如果您知道如何获取股票的最后交易时间,请告诉我。