Submits a query to one of the PatentsView endpoints.

uspto_search_patentsview(query, fields = NULL, sort = NULL,
  outDir = tempdir(), include_related = FALSE, start = 1,
  limit = 10000, endpoint = "patent", post = TRUE, retry = 10,
  verbose = FALSE, legacy = TRUE, key = Sys.getenv("PATENTSVIEW_KEY"),
  cores = detectCores() - 1, overwrite = FALSE)

Arguments

query

A query string or list; for example list(patent_number = 7861317) or '{"_text_all": {"patent_abstract": ["photographic", "noodle"]}}'. See API Query Language.

fields

A vector of fields to return; defaults to all for the given endpoint. Set to NULL to use the API's default.

sort

A list or list of lists specifying how to sort results (e.g., list(patent_date = "asc")).

outDir

Directory in which to save results; defaults to a temporary directory.

include_related

Logical; if TRUE, includes subentities related to entities matching the search criteria.

start

Page to start collecting results on.

limit

Maximum number of results to return; sets page size, up to 10,000 per page (1,000 if legacy if FALSE).

endpoint

Name of the API endpoint to search in, as listed on PatentsView.

post

Logical; if FALSE, will make a GET rather than POST request.

retry

Maximum number of times to retry a request, in the event of a rate limit.

verbose

Logical; if FALSE, does not print status messages.

legacy

Logical; if FALSE, will use the beta API, which requires a key.

key

Beta API key (Request a key); defaults to the PATENTSVIEW_KEY environment variable.

cores

Number of CPU cores to use when retrieving multiple pages of results.

overwrite

Logical; if TRUE, overwrites an existing result.

Value

A data.frame of results, if any were found. This may contain list entries of data.frame with varying dimensions, depending on the endpoint and fields.

Examples

if (FALSE) {
# search for patents with a meteorology classification:
# https://www.uspto.gov/web/patents/classification/cpc/html/cpc-G01W.html
results <- uspto_search_patentsview(list(cpc_group_id = "G01W"))

# search by date and keyword:
results <- uspto_search_patentsview(list(
  "_and" = list(
    list(patent_date = "2002-01-08"),
    list("_text_any" = list(patent_abstract = "motorcycle"))
  )
))
}