Getting Started
Basic Usage
After initializing API, you can access various resources. Below is a simple example of retrieving stock prices.
More get data methods can be found in Stock.
Note: All data is returned in JSON format, which is automatically converted to a dict
.
Find Available Symbols
To find out what stock information is available, use get_available_list()
Apply the same approach to retrieve ETF
information.
Working with pandas
Data results can be easily integrated with pandas
and converted into a DataFrame
for further manipulation
from fmd import FmdApi
import pandas as pd
fa = FmdApi()
stock = fa.stock.get('2330')
price = stock.get_price()
df = pd.DataFrame(price)
df.head()
Since most data fields are of str
type, you may want to convert them to float
for analysis or visualization.