0

I am trying to fetch patent data with the "patentsview" package in R but I am always getting an error and I couldn't find the solution anywhere. Here's my code -

# Load library
library(patentsview)

# Write query
query <- with_qfuns(
  and(
    begins(cpc_subgroup_id = 'G06N'),
    gte(patent_year = 2020)
  )
)

# Create a list of fields
# get_fields(endpoint = "patents")

# Needed Fields
fields <- c(
  "patent_id",
  "patent_title",
  "patent_abstract",
  "patent_date"
)

# Send an HTTP request to the PatentsView API to get the data
pv_res <- search_pv(query = query, fields = fields, all_pages = TRUE)

The output is -

Error in xheader_er_or_status(resp) : Not Found (HTTP 404).

What am I doing wrong here? And what is the solution?

General Grievance
  • 4,555
  • 31
  • 31
  • 45
  • 1
    Maybe you're better off raising an issue with the developers of the package here: https://github.com/ropensci/patentsview – Wiktor Gustafsson Mar 27 '21 at 21:43
  • Thanks, @WiktorGustafsson. I'll do that. But do you have any idea about this error? – Noob Programmer Mar 27 '21 at 22:06
  • I suspect there is something wrong with the query since you're getting a 404 (indicating what you're trying to fetch from the server doesn't exist). But I can't really help you with fixing it since I'm not familiar with the package, sorry. – Wiktor Gustafsson Mar 27 '21 at 22:35
  • Hey @NoobProgrammer, I'm the developer of patentsview. Try downloading the development edition of the package. That should solve your issue. See here for how to do that: https://github.com/ropensci/patentsview – Chris Jul 25 '21 at 02:04

0 Answers0