ny_search: Search

Description Usage Arguments Examples

View source: R/search.R

Description

Search for NYT articles by keywords, filters and facets.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
ny_search(
  q,
  since = NULL,
  until = NULL,
  pages = 1,
  sort = c("newest", "oldest", "relevance"),
  facets = FALSE,
  facet_fields = NULL,
  facet_filter = NULL,
  fl = NULL,
  fq = NULL
)

Arguments

q

Search query.

since, until

Begin and start Date objects.

pages

Number of pages of results to return. Set to infinite (Inf) to retrieve all pages (not recommended).

sort

Sort order newest, oldest, relevance.

facets

Whether to show facet counts, boolean.

facet_fields

The following values are allowed: day_of_week, document_type, ingredients, news_desk, pub_month, pub_year, section_name, source, subsection_name, type_of_material.

facet_filter

Have facet counts use filters, boolean.

fl

List of fields to return.

fq

Query filter.

Examples

1
2
3
4
5
## Not run: 
nytimes_key("xXXxxXxXxXXx")
trump <- ny_search("Trump", since = Sys.Date() - 3)

## End(Not run)

news-r/nytimes documentation built on Feb. 28, 2020, 4:49 a.m.