The examples are pretty clear.
https://github.com/pdevty/googlefinance-client-python
What is not clear? As far as I can see you want to get data for FB stock. To get help - show us what you have done so far - post your code in code tags, ask questions about problems you cannot resolve. In case you get error - post
the full traceback in error tags
I can use the following to get dataframe but it is daily data.
I am wondering if I can get dataframe of 5-minute data in the url but don't know how to make a function call like below. Thanks.
http://www.google.com/finance/getprices?...,o,h,l,c,v
import pandas as pd
import googlefinance.client as gf
param = {'q': 'FB','i': "86400",'x': "NASD",'P': "3M"}
df = pd.DataFrame(gf.get_price_data(param))
print(df)
param
is a
dict
that supply params to the function
get_price_data
.
'q'
is the stock symbol
'i'
is the interval in seconds. the example is
'86400'
(that is 24 hours * 60 minutes * 60 seconds). if you want 5 minutes interval it should be
'300'
(5 minutes * 60 seconds)
'x'
is the exchange whre it is traded (
'NASD'
for NSADAQ)
'p'
is the period - in your case
'3M'
. Note that it is lower-case 'p' in the example. In your code it is upper-case, which may or may not be a problem (depending on the package). To be on the safe side I would change it to
'p'
Also
df=pd.DataFrame(gf.get_price_data(param))
Could be just
df=gf.get_price_data(param)
get_price_data
will return DataFrame as per the example