This function returns a vector of fields that you can retrieve from a given
API endpoint (i.e., the fields you can pass to the fields
argument in
search_pv
). You can limit these fields to only cover certain
entity group(s) as well (which is recommended, given the large number of
possible fields for each endpoint).
get_fields(endpoint, groups = NULL)
endpoint | The API endpoint whose field list you want to get. See
|
---|---|
groups | A character vector giving the group(s) whose fields you want
returned. A value of |
A character vector with field names.
# Get all assignee-level fields for the patents endpoint: fields <- get_fields(endpoint = "patents", groups = "assignees") #...Then pass to search_pv: search_pv( query = '{"_gte":{"patent_date":"2007-01-04"}}', fields = fields )#> $data #> #### A list with a single data frame (with list column(s) inside) on a patent level: #> #> List of 1 #> $ patents:'data.frame': 25 obs. of 1 variable: #> ..$ assignees:List of 25 #> #> $query_results #> #### Distinct entity counts across all downloadable pages of output: #> #> total_patent_count = 100,000# Get all patent and assignee-level fields for the patents endpoint: fields <- get_fields(endpoint = "patents", groups = c("assignees", "patents")) #...Then pass to search_pv: search_pv( query = '{"_gte":{"patent_date":"2007-01-04"}}', fields = fields )#> $data #> #### A list with a single data frame (with list column(s) inside) on a patent level: #> #> List of 1 #> $ patents:'data.frame': 25 obs. of 31 variables: #> ..$ patent_abstract : chr [1:25] "A protective glove ".. #> ..$ patent_average_processing_time : logi [1:25] NA ... #> ..$ patent_date : chr [1:25] "2007-01-09" ... #> ..$ patent_firstnamed_assignee_city : chr [1:25] "Neenah" ... #> ..$ patent_firstnamed_assignee_country : chr [1:25] "US" ... #> ..$ patent_firstnamed_assignee_id : chr [1:25] "60cf4c8ac1f34433762".. #> ..$ patent_firstnamed_assignee_latitude : chr [1:25] "44.1858" ... #> ..$ patent_firstnamed_assignee_location_id: chr [1:25] "44.1858193|-88.4626".. #> ..$ patent_firstnamed_assignee_longitude : chr [1:25] "-88.4626" ... #> ..$ patent_firstnamed_assignee_state : chr [1:25] "WI" ... #> ..$ patent_firstnamed_inventor_city : chr [1:25] "Neenah" ... #> ..$ patent_firstnamed_inventor_country : chr [1:25] "US" ... #> ..$ patent_firstnamed_inventor_id : chr [1:25] "6207099-7" ... #> ..$ patent_firstnamed_inventor_latitude : chr [1:25] "44.1858" ... #> ..$ patent_firstnamed_inventor_location_id: chr [1:25] "44.1858193|-88.4626".. #> ..$ patent_firstnamed_inventor_longitude : chr [1:25] "-88.4626" ... #> ..$ patent_firstnamed_inventor_state : chr [1:25] "WI" ... #> ..$ patent_id : chr [1:25] "7159246" ... #> ..$ patent_kind : chr [1:25] "B2" ... #> ..$ patent_number : chr [1:25] "7159246" ... #> ..$ patent_num_cited_by_us_patents : chr [1:25] "12" ... #> ..$ patent_num_claims : chr [1:25] "8" ... #> ..$ patent_num_combined_citations : chr [1:25] "10" ... #> ..$ patent_num_foreign_citations : chr [1:25] "0" ... #> ..$ patent_num_us_application_citations : chr [1:25] "0" ... #> ..$ patent_num_us_patent_citations : chr [1:25] "10" ... #> ..$ patent_processing_time : chr [1:25] "1119" ... #> ..$ patent_title : chr [1:25] "Glove with high tac".. #> ..$ patent_type : chr [1:25] "utility" ... #> ..$ patent_year : chr [1:25] "2007" ... #> ..$ assignees :List of 25 #> #> $query_results #> #### Distinct entity counts across all downloadable pages of output: #> #> total_patent_count = 100,000