Add example for pulling down historical stock prices for Google

This commit is contained in:
Cameron Yick
2017-12-24 13:28:12 -05:00
committed by Cameron Yick
parent d99d31acb9
commit eccd4a9bd4
2 changed files with 15 additions and 1 deletions

View File

@@ -71,9 +71,16 @@ Now you can use ``TiingoClient`` to make your API calls. (Other parameters are a
# Get Ticker # Get Ticker
ticker_metadata = client.get_ticker_metadata("GOOGL") ticker_metadata = client.get_ticker_metadata("GOOGL")
# Get latest prices, based on 3+ sources, as CSV or JSON, sampled weekly # Get latest prices, based on 3+ sources as JSON, sampled weekly
ticker_price = client.get_ticker_price("GOOGL", frequency="weekly") ticker_price = client.get_ticker_price("GOOGL", frequency="weekly")
# Get historical GOOGL prices from August 2017 as JSON, sampled daily
historical_prices = client.get_ticker_price("GOOGL",
fmt='json',
startDate='2017-08-01',
endDate='2017-08-31',
frequency='daily')
# Check what tickers are available, as well as metadata about each ticker # Check what tickers are available, as well as metadata about each ticker
# including supported currency, exchange, and available start/end dates. # including supported currency, exchange, and available start/end dates.
tickers = client.list_stock_tickers() tickers = client.list_stock_tickers()

View File

@@ -43,6 +43,13 @@ Now you can use ``TiingoClient`` to make your API calls. (Other parameters are a
# Get latest prices, based on 3+ sources, as CSV or JSON, sampled weekly # Get latest prices, based on 3+ sources, as CSV or JSON, sampled weekly
ticker_price = client.get_ticker_price("GOOGL", frequency="weekly") ticker_price = client.get_ticker_price("GOOGL", frequency="weekly")
# Get historical GOOGL prices from August 2017 as JSON, sampled daily
historical_prices = client.get_ticker_price("GOOGL",
fmt='json',
startDate='2017-08-01',
endDate='2017-08-31',
frequency='daily')
# Check what tickers are available, as well as metadata about each ticker # Check what tickers are available, as well as metadata about each ticker
# including supported currency, exchange, and available start/end dates. # including supported currency, exchange, and available start/end dates.
tickers = client.list_stock_tickers() tickers = client.list_stock_tickers()