From eccd4a9bd41ef4d6a735d50592b2ba43d86a2098 Mon Sep 17 00:00:00 2001 From: Cameron Yick Date: Sun, 24 Dec 2017 13:28:12 -0500 Subject: [PATCH] Add example for pulling down historical stock prices for Google --- README.rst | 9 ++++++++- docs/usage.rst | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 95c796d..4cd8a4b 100644 --- a/README.rst +++ b/README.rst @@ -71,9 +71,16 @@ Now you can use ``TiingoClient`` to make your API calls. (Other parameters are a # Get Ticker 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") + # 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 # including supported currency, exchange, and available start/end dates. tickers = client.list_stock_tickers() diff --git a/docs/usage.rst b/docs/usage.rst index 628ef60..60ef7e2 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -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 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 # including supported currency, exchange, and available start/end dates. tickers = client.list_stock_tickers()