加载中…
个人资料
文和_股市脉冲波复利
文和_股市脉冲波复利
  • 博客等级:
  • 博客积分:0
  • 博客访问:486,425
  • 关注人气:353
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
相关博文
推荐博文
谁看过这篇博文
加载中…
正文 字体大小:

Google 财经接口  数据格式

(2012-09-08 12:14:40)
标签:

google

财经

数据接口

数据格式

股票

分类: 数据接口/API

【使用例子】

Building the URL and downloading the data

As it has been said, the URL matches the format: http://www.google.com/finance/getprices?q={Code}&x={Exchange}&i={Interval}&p={Period}&f={Fields}. The meaning of the parameters is:

  • Code. The code of the security. For example, GOOG for Google or EURUSD for the Euro/Dollar currency pair. This parameter is case sensitive and must be capitalized to be recognized.
  • Exchange. The exchange where the security is listed. For example, NASDAQ for GOOG or CURRENCY for EURUSD. The exchange must be in upper case and can be left blank for American exchanges.
  • Interval. Google groups the data into intervals whose length in seconds is defined by this parameter. Its minimum value is 60 seconds.
  • Period. The period of time from which data will be returned. Google always returns the most recent data. Examples of this parameter are 1d (one day), 1w (one week), 1m (one month), or 1y (one year).
  • Fields. The fields to return. This parameter seems to be ignored by Google, as it always returns the date, open, high, low, close, and volume of every interval.

Exchange :交易所 

沪市代码为SHA, 参数设成 x=SHA 

深市代码为SHE,参数设成 x=SHE

Interval:时间周期

1分钟  i=60;5min  i=300; 15min i=900 ; 30 min i=1800 ;1Hour i=3600;1day i=86400

 

取近6个月的上证指数000001 数据

http://www.google.com/finance/getprices?q=000001&x=SHA&i=86400&p=6M&f=d,c,v,o,h,l

取近6个月的深圳综指399106 数据

http://www.google.com/finance/getprices?q=399106&x=SHE&i=86400&p=6M&f=d,c,v,o,h,l

 

【数据格式】

HTTP request

http://www.google.com/finance/getprices?q=399106&x=SHE&i=86400&p=6M&f=d,c,v,o,h,l

HTTP response
_____________________START_________________________________
EXCHANGE=SHE
MARKET_OPEN_MINUTE=570
MARKET_CLOSE_MINUTE=900
INTERVAL=86400
COLUMNS=DATE,CLOSE,HIGH,LOW,OPEN,VOLUME
DATA_SESSIONS=[MORNING,570,690],[AFTERNOON,780,900]
DATA=
TIMEZONE_OFFSET=480
a1331190000,980.0236,983.2562,969.984,969.984,6796418075
1,995.8681,995.8683,980.3035,982.6962,7326550219
4,999.6296,1001.2822,991.5754,996.4511,7502153263
5,1010.4592,1010.4592,996.8134,999.4803,7633937795
6,969.1217,1020.2912,963.461,1014.1604,12309332642
7,960.963,974.3542,947.9808,967.0835,8299724857
8,982.8479,982.8504,960.5722,962.4154,7150017620
11,993.7547,993.7547,977.4286,982.2991,6992950883
12,972.0265,991.0656,971.9821,991.0648,6766129881
13,971.9348,980.1245,958.7266,974.9965,6436174796
14,969.9838,976.2458,964.671,970.8633,5362984184
15,952.8054,967.3888,949.0101,966.3851,5220387531
18,952.76,956.0808,946.0832,950.5662,4203964195
19,948.0977,960.5579,947.2232,955.2892,4554159694
20,909.58,944.452,908.0241,944.452,6078582849
21,895.0688,907.9847,886.351,903.821,5309268282
22,891.8436,899.6902,885.1904,894.2305,4329726103
28,919.4222,920.1838,889.7666,891.4346,5107759353
29,925.5289,928.6316,917.0398,918.9195,4988439293
32,915.7713,926.5963,915.0361,922.9082,4452583551
33,924.2835,924.2835,895.249,912.2968,5341260818
34,927.3665,933.2594,910.77,914.3998,5552747517
35,945.3272,945.3272,925.4915,927.8084,7137608857
36,950.9111,956.0057,946.0091,948.3098,7721420904
39,949.2265,953.9988,941.9067,944.4593,6640527061
40,936.7371,951.4223,936.4512,948.5537,6530304508
41,956.4856,957.0838,936.6225,938.4886,7308761324
42,954.2691,959.3931,949.7073,955.8173,6331875412
43,961.7736,962.4607,950.6867,952.5573,6996896698
46,944.8679,961.5457,941.2796,960.915,7839544085
47,936.5097,948.3341,913.5793,937.2284,8202009780
48,944.6487,946.412,930.5706,933.4529,8125074282
49,943.0313,948.8056,938.7225,945.2184,7498313353
50,940.3516,945.4148,938.2753,941.5213,5788713107
55,956.2334,960.4387,943.667,950.4052,7216977174
56,961.9881,961.9881,953.5639,954.6741,6552925170
57,972.3025,972.6703,959.8369,961.7076,7004519415
60,981.4873,981.4876,967.0182,968.0913,6980057456
61,980.2558,983.627,971.8953,981.6848,6761991952
62,963.179,973.5045,962.4203,973.5045,6582218658
63,966.6596,970.2523,962.2811,962.3981,5347739609
64,960.5298,971.7235,960.5298,965.511,5642408976
67,956.1925,969.2069,955.9357,966.9263,6199067790
68,955.4039,955.4039,943.5603,949.2938,5791236443
69,942.0434,955.4894,942.0434,953.632,5228592397
70,954.9501,955.9833,939.1805,942.2757,5569178921
71,940.912,952.9218,938.5323,949.3089,5628276977
74,941.6748,947.9544,932.6318,939.2482,4943984619
75,955.7026,955.7026,945.0438,945.0438,5104312191
76,954.8338,959.0797,945.6517,953.943,5827984388
77,945.9535,957.518,943.2172,952.6386,5650504186
78,935.0511,947.7402,931.8952,945.6661,5399701622
81,948.4185,948.4194,918.293,930.9796,6513666656
82,962.8456,965.0473,947.2562,948.0724,7619984782
83,964.2571,967.6876,960.3366,961.8371,6470032956
84,967.585,972.6757,957.1754,959.56,6364804186
85,966.7928,973.7001,962.2839,967.2574,5738637627
88,939.3332,959.1075,939.3332,951.7039,6112540105
89,937.3943,944.5388,934.4753,940.5059,4636791736
90,935.5103,943.523,931.4012,939.0189,4218269718
91,931.8305,946.7339,929.4263,943.6802,4706048506
92,928.8628,940.392,926.7702,939.2856,4964159493
95,945.6214,946.2084,927.0785,929.4903,5138116122
96,942.1825,947.1296,938.6017,941.5564,4977419205
97,959.1086,959.1086,943.7296,944.0356,5752423629
98,954.065,964.0569,953.3682,957.6952,5559755789
99,954.3125,960.3633,942.5435,955.6168,5406078254
102,964.7083,966.8275,957.458,957.458,5330162962
103,957.996,964.187,956.4945,963.4568,5455902243
104,956.2323,962.3281,954.0792,959.4853,4871651505
105,943.0635,953.946,937.6433,953.946,4986928739
109,919.3959,939.2634,919.2353,939.2634,5037413200
110,918.2375,921.4421,905.0397,914.3695,4671425503
111,918.3755,929.0659,916.9396,917.255,4645887293
112,909.2844,923.5518,909.2844,919.6766,4759545910
113,921.4046,921.4046,902.834,905.8282,4871566096
116,932.5449,936.481,923.8625,926.2856,5151603618
117,936.254,942.9492,930.2605,932.2575,5650065731
118,931.6469,939.3435,928.8346,937.3379,5039410328
119,914.3113,928.2053,910.9702,928.2053,4882323570
120,934.8465,935.2413,910.344,918.4208,5903507729
123,914.2058,934.6938,914.0585,929.2025,5753987249
124,905.7458,914.0182,904.3407,910.7978,4576398207
125,913.4617,913.4617,901.3364,903.6304,4261290164
126,928.2059,930.5679,908.2817,911.7799,5917174514
127,922.6242,931.1722,919.5517,924.7465,5094991041
130,889.101,920.5475,888.9938,920.5423,5973944117
131,893.5107,894.6402,882.485,885.0848,4450705093
132,896.1844,896.186,877.6923,892.0913,5141357637
133,903.2545,909.9353,892.0444,894.0805,5952763661
134,895.6202,905.8325,893.8149,900.7397,4980096464
137,886.4707,891.5165,880.5248,890.2485,4418681750
138,893.6109,898.3897,880.2399,881.5564,4139676361
139,887.5447,896.4362,886.4032,891.1473,4385016294
140,880.7618,893.7092,879.8791,886.3994,4474211122
141,876.2514,885.34,872.4219,882.6374,3931097078
144,861.8157,880.1093,858.9116,875.1046,4054863609
145,849.9571,861.1359,847.1574,859.9817,3946492033
146,862.698,868.172,848.3769,848.3769,4082502075
147,855.2768,864.6122,851.0821,861.3437,4160827978
148,871.8099,871.8103,854.7214,857.0798,4634255235
151,891.3,891.9198,867.6303,868.9705,5765184590
152,898.4837,898.4837,890.0616,890.9232,6011674109
153,895.9417,901.2793,890.7647,898.0363,5625562709
154,909.6869,909.6869,892.0852,895.3813,6220360007
155,906.3226,909.9748,902.6684,908.9122,5798039405
158,887.6514,904.6127,887.4077,904.6127,5811143985
159,893.8048,893.8058,872.4579,886.5295,5827747553
160,886.9762,892.846,886.0469,891.3698,4900392918
161,879.9407,887.5435,878.4976,884.6044,4293046166
162,876.9294,880.4736,868.3693,878.806,3919897204
165,879.2476,880.8523,866.1644,871.8656,4163651325
166,891.3071,895.2516,877.422,878.8283,5601200259
167,884.7271,892.9684,881.1363,891.7027,5606352842
168,889.262,890.3334,879.1927,884.6988,5556564195
169,871.3606,886.723,871.3606,886.0434,5546857778
172,852.3361,867.7791,851.9845,867.7791,5043766100
173,856.0906,861.315,848.202,850.4718,4471324613
174,851.1376,861.5515,849.9566,854.0788,4579848686
175,835.9494,853.1803,823.816,848.6869,5555672966
176,838.5321,841.3976,832.2515,833.8177,3839035183
179,854.757,856.4099,836.2893,837.6847,4888398035
180,846.8793,858.3611,845.562,855.1797,4926739433
181,850.984,854.085,842.6632,844.7972,4777772018
182,859.2961,859.2961,851.8083,852.2961,4871797658
183,891.5283,899.4786,865.1357,865.1357,10292094174
______________________END___________________________________

 

 

 

【数据具体含义】

以下是header,数据头

EXCHANGE=SHE    

第一行:交易所=SHE


MARKET_OPEN_MINUTE=570

第二行:股市开始时刻 570分钟 = 60 * 9 + 30 = 9:30


MARKET_CLOSE_MINUTE=900

第三行:股市结束时刻 900分钟 = 60 * 15 = 15:00

 

INTERVAL=86400

第四行:时间周期 86400 = 60s * 60m * 24  = 86400 s


COLUMNS=DATE,CLOSE,HIGH,LOW,OPEN,VOLUME

第五行:列顺序=日期,收盘价,最高,最低,开盘价,成交量


DATA_SESSIONS=[MORNING,570,690],[AFTERNOON,780,900]

第六行:时间段: 上午9:30-11:30  下午13:00-15:00


第七行:DATA=

 


TIMEZONE_OFFSET=480

第八行:时区偏移量 480 = 60 * 8 = 8个小时,东八区,北京时间。

 

以下是数据行


a1331190000,980.0236,983.2562,969.984,969.984,6796418075

开始行,a1331190000 ,a开头的时间是绝对偏移量,相对于1970年1月1日的偏移量。


1,995.8681,995.8683,980.3035,982.6962,7326550219

相对上次的a1331190000 的偏移量,1个周期,即1个Interval,这里等于 84600 = 1天


4,999.6296,1001.2822,991.5754,996.4511,7502153263

相对上次的a1331190000 的偏移量,4个周期,即4个Interval,这里等于 84600 * 4 =4天

 

5,1010.4592,1010.4592,996.8134,999.4803,7633937795

周期偏移量,DATE,CLOSE,HIGH,LOW,OPEN,VOLUME


【30分钟数据】

好像有问题。

左侧是大智慧的30分钟数据2012年9月10日。右侧是google财经的数据,多了3条记录

9:00-9:30 的一条;11:30-12:00 一条; 15:00  - 15:30 一条。

Google <wbr>财经接口 <wbr> <wbr>数据格式

【60分钟数据】

经过测试,发现每天有6条数据,多了2条数据。

2012-09-04 10:00:00
2012-09-04 11:00:00
2012-09-04 12:00:00
2012-09-04 14:00:00
2012-09-04 15:00:00
2012-09-04 16:00:00

0

阅读 评论 收藏 禁止转载 喜欢 打印举报/Report
  • 评论加载中,请稍候...
发评论

    发评论

    以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

      

    新浪BLOG意见反馈留言板 电话:4000520066 提示音后按1键(按当地市话标准计费) 欢迎批评指正

    新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

    新浪公司 版权所有