diff --git a/tests/fixtures/news.yaml b/tests/fixtures/news.yaml index 6181501..f691ec5 100644 --- a/tests/fixtures/news.yaml +++ b/tests/fixtures/news.yaml @@ -9,7 +9,7 @@ interactions: Content-Type: [application/json] User-Agent: [tiingo-python-client 0.11.0] method: GET - uri: https://api.tiingo.com/tiingo/news?limit=1&offset=0&sortBy=publishedDate&tickers=aapl&tickers=googl&source=cnbc.com,altcointoday.com&tags=Technology&tags=Bitcoin&startDate=2016-01-01&endDate=2017-08-31 + uri: https://api.tiingo.com/tiingo/news?limit=1&offset=0&sortBy=publishedDate&tickers=aapl&tickers=googl&source=cnbc.com,altcointoday.com&tags=Technology&tags=Bitcoin&startDate=2016-01-01&endDate=2017-08-31&onlyWithTickers=False response: body: {string: '[{ "publishedDate": "2016-01-11T23:13:00Z", diff --git a/tiingo/api.py b/tiingo/api.py index 0cf9fbb..f02023a 100644 --- a/tiingo/api.py +++ b/tiingo/api.py @@ -278,6 +278,7 @@ class TiingoClient(RestClient): # tiingo/news def get_news(self, tickers=[], tags=[], sources=[], startDate=None, endDate=None, limit=100, offset=0, sortBy="publishedDate", + onlyWithTickers=False, fmt='json'): """Return list of news articles matching given search terms https://api.tiingo.com/docs/tiingo/news @@ -291,7 +292,8 @@ class TiingoClient(RestClient): startDate, endDate [date]: Boundaries of news search window limit (int): Max results returned. Default 100, max 1000 offset (int): Search results offset, used for paginating - sortBy (string): "publishedDate" OR (#TODO: UPDATE THIS) + sortBy (string): "publishedDate" OR "crawlDate", descending + onlyWithTickers (bool): If true, only links with tagged tickers will return. """ url = "tiingo/news" params = { @@ -302,7 +304,8 @@ class TiingoClient(RestClient): 'source': (",").join(sources), 'tags': tags, 'startDate': startDate, - 'endDate': endDate + 'endDate': endDate, + 'onlyWithTickers': onlyWithTickers } response = self._request('GET', url, params=params) data = response.json()