用于非美国股市数据的Stooq API

时间:2019-04-12 19:40:08

标签: python python-3.x finance pandas-datareader

我一直在尝试从WSE(华沙证券交易所)完成几只股票的当前数据。我专注于stooq,因为雅虎不涉及波兰股市。

一旦我尝试从pandas-datareader中获取stooq的代码,就会看到以下错误:

"StooqDailyReader request returned no data;
check URL for invalid inputs: https://stooq.com/q/d/l/"

在此链接csv文件下,告诉我所提供的代码错误,但同一代码可以直接在stooq网站上正常运行。 您知道那里可能有什么问题吗?

import pandas_datareader.data as web
prices = web.DataReader('KGH', 'stooq')
print(prices)

1 个答案:

答案 0 :(得分:0)

您想要这样的东西吗?

import quandl
mydata = quandl.get("WSE/WIG20TR")
print(mydata)

那会产生以下结果。

               Open     High      Low    Close  % Change  Turnover (1000s)
Date                                                                      
2016-10-03  2911.76  2919.84  2911.76  2919.84      0.93         401910.61
2016-10-04  2940.43  2968.24  2940.43  2968.24      1.66         707134.92
2016-10-05  2970.79  2982.08  2970.79  2982.08      0.47         713899.62
2016-10-06  2972.15  2981.52  2972.15  2981.52     -0.02         522210.82
2016-10-07  2972.68  2974.87  2964.30  2964.30     -0.58         456252.80
2016-10-10  2977.32  2988.68  2977.32  2988.39      0.81         472514.88
2016-10-11  2987.31  2987.31  2973.30  2973.30     -0.50         457603.07
2016-10-12  2969.48  2979.04  2969.48  2979.04      0.19         447665.23
2016-10-13  2954.50  2954.50  2923.40  2923.40     -1.87         720287.00
2016-10-14  2937.36  2937.36  2910.02  2910.02     -0.46         498163.77
2016-10-17  2919.28  2919.28  2900.82  2900.82     -0.32         621362.01
2016-10-18  2922.67  2922.67  2901.12  2912.68      0.41         548288.70
2016-10-19  2919.90  2956.99  2919.90  2952.13      1.35         676115.64
2016-10-20  2963.88  2965.74  2959.68  2959.68      0.26         440663.31
2016-10-21  2975.40  2975.40  2965.20  2965.20      0.19         580519.75
2016-10-24  2991.65  3017.78  2991.65  3016.87      1.74         470453.44
2016-10-25  3042.78  3042.78  3018.19  3021.62      0.16         549692.97
2016-10-26  3016.35  3016.35  3004.60  3011.71     -0.33         503003.10
2016-10-27  3035.19  3038.10  3034.83  3038.10      0.88         699662.42
2016-10-28  3031.84  3076.10  3031.84  3076.10      1.25         532073.92
2016-10-31  3085.46  3085.46  3070.81  3070.81     -0.17         681466.77
2016-11-02  3026.11  3026.11  2987.83  2987.83     -2.70         928538.72
2016-11-03  2998.86  2998.86  2990.79  2990.79      0.10         656489.77
2016-11-04  2975.22  2980.33  2975.22  2975.30     -0.52         385598.43
2016-11-07  3005.59  3005.59  2981.35  2981.35      0.20         484758.97
2016-11-08  3013.01  3017.61  3008.44  3017.61      1.22         445944.20
2016-11-09  2988.07  3030.20  2988.07  3030.20      0.42         759370.28
2016-11-10  3084.03  3084.03  3040.50  3040.50      0.34        1199406.31
2016-11-14  3031.86  3031.86  2967.93  2967.93     -2.39         972806.47
2016-11-15  2989.57  2989.57  2964.69  2968.20      0.01         604846.49
            ...      ...      ...      ...       ...               ...
2019-05-31  3908.15  3969.56  3893.10  3969.56      0.80         816765.70
2019-06-03  3960.51  3984.63  3949.97  3966.72     -0.07         532820.53
2019-06-04  3965.50  3974.06  3946.34  3959.69     -0.18         675309.03
2019-06-05  3967.09  3970.77  3935.23  3941.11     -0.47         655383.13
2019-06-06  3943.94  4027.33  3941.65  4007.89      1.69         995862.14
2019-06-07  4011.61  4050.60  4011.61  4042.75      0.87         616987.47
2019-06-10  4062.75  4068.64  4029.45  4046.13      0.08         651731.30
2019-06-11  4049.73  4078.42  4039.98  4069.34      0.57        1015106.95
2019-06-12  4052.77  4062.90  4013.92  4046.65     -0.56         769784.26
2019-06-13  4040.89  4091.55  4040.53  4077.50      0.76         811131.81
2019-06-14  4075.39  4075.39  4049.28  4053.14     -0.60         620163.19
2019-06-17  4058.67  4062.29  4026.71  4037.13     -0.40         426200.13
2019-06-18  4036.36  4123.23  4030.44  4123.23      2.13         949164.98
2019-06-19  4124.82  4124.82  4108.94  4113.58     -0.23         593252.42
2019-06-21  4124.86  4155.76  4085.95  4093.37     -0.49        1697240.27
2019-06-24  4113.01  4136.59  4099.92  4133.72      0.99         521246.30
2019-06-25  4123.47  4128.56  4073.93  4084.48     -1.19         692376.39
2019-06-26  4095.28  4109.06  4081.32  4109.06      0.60         635235.61
2019-06-27  4119.07  4160.37  4119.07  4140.91      0.78         682904.34
2019-06-28  4141.09  4144.04  4125.12  4132.41     -0.21         592757.96
2019-07-01  4195.52  4195.52  4130.92  4136.08      0.09         527728.12
2019-07-02  4152.31  4156.24  4101.91  4156.24      0.49         719797.10
2019-07-03  4145.92  4170.18  4141.94  4164.17      0.19         670327.79
2019-07-04  4165.05  4184.44  4152.69  4183.57      0.47         490173.23
2019-07-05  4186.73  4186.73  4145.94  4157.86     -0.61         516459.10
2019-07-08  4140.77  4167.74  4131.49  4152.64     -0.13         598552.93
2019-07-09  4148.48  4148.48  4109.20  4125.50     -0.65         679278.48
2019-07-10  4124.36  4174.02  4113.97  4125.75      0.01         764583.50
2019-07-11  4146.63  4167.49  4121.76  4133.21      0.18         598836.12
2019-07-12  4144.03  4145.02  4129.71  4130.38     -0.07         535157.11

[691 rows x 6 columns]

https://www.quandl.com/data/WSE-Warsaw-Stock-Exchange-GPW?keyword=KGH