New York Times web APIs

The New York Times web site provides a rich set of APIs, as described here; For this assignment I have chosen Article Search API from New York Times web APIs; we will construct an interface in R to read in the JSON data, and transform it into an R DataFrame.


Article Search API

Overview: Use the Article Search API to look up articles by keyword. You can refine your search using filters and facets.

Example Call: https://api.nytimes.com/svc/search/v2/articlesearch.json?q=election&api-key=yourkey

Filtering Your Search: Use filters to narrow the scope of your search. You can specify the fields and the values that your query will be filtered on.


Reading JSON data

1. Read/Search for coronavirus+baseball in Source as The New York Times and news_desk as Sports:
## [1] 3
2. Read/Search for coronavirus+baseball in all Source and in all news_desk:
## [1] 10