New York Times

class orangecontrib.text.nyt.NYT(api_key)[source]

Class for fetching records from the NYT API.

__init__(api_key)[source]
Parameters

api_key (str) – NY Time API key.

api_key_valid()[source]

Checks whether api key given at initialization is valid.

search(query, date_from=None, date_to=None, max_docs=None, on_progress=None, should_break=None)[source]
Parameters
  • query (str) – Search query.

  • date_from (date) – Start date limit.

  • date_to (date) – End date limit.

  • max_docs (int) – Maximal number of documents returned.

  • on_progress (callback) – Called after every iteration of downloading.

  • should_break (callback) – Callback for breaking the computation before the end. If it evaluates to True, downloading is stopped and document downloaded till now are returned in a Corpus.

Returns

Search results.

Return type

Corpus