Data 20261201.1 · as of 2026-12-01 · API 1.29.0 · Free beta

Patent data for an R script

Use the rOpenSci patentsview package and point it at PatentRef. The development version on GitHub reads options(patentsview.base_url = "https://patentref.io") or the PATENTSVIEW_BASE_URL variable, so your search_pv() calls stay the same. Put a free PatentRef key in PATENTSVIEW_API_KEY.

How to set it up

  1. Get a free key at https://patentref.io/api/v1/meta/signup/.
  2. Install the development version of patentsview from GitHub. The base URL setting is not in the CRAN release yet.
  3. Set the key and the base URL, then call search_pv() as before.
# install.packages("pak")
pak::pak("ropensci/patentsview")

library(patentsview)
Sys.setenv(PATENTSVIEW_API_KEY = "YOUR_KEY")
options(patentsview.base_url = "https://patentref.io")

res <- search_pv(
  query = qry_funs$eq(patent_id = "10905426"),
  fields = c("patent_id", "patent_title", "patent_date")
)
res$data$patents

On the CRAN release, version 1.0.0, replace the package's URL function for the session instead:

library(patentsview)
Sys.setenv(PATENTSVIEW_API_KEY = "YOUR_KEY")
assignInNamespace("get_base", function(endpoint) sprintf("https://patentref.io/api/v1/%s/", endpoint), ns = "patentsview")

For PatentRef's own routes, such as the claim tree, use httr2 with the same key:

library(httr2)
tree <- request("https://patentref.io/api/v1/structure/claims/10034028/") |>
  req_headers("X-Api-Key" = "YOUR_KEY") |>
  req_perform() |>
  resp_body_json()

What you get

Good to know

FAQ

Is the base URL setting on CRAN?

Not yet. CRAN has version 1.0.0. Install the development version from GitHub, or use the assignInNamespace line with version 1.0.0.

Do I have to change my search_pv() queries?

No. PatentRef answers the same q, f, s and o grammar, so the same calls work.

Can I skip the package and use httr2?

Yes. Send GET requests to https://patentref.io/api/v1/ with your key in the X-Api-Key header.

More questions

PatentRef is an independent service and is not affiliated with the USPTO. Answers describe the text as the USPTO printed it; none is a legal conclusion.