Queries the DOI resolution proxy server REST API.

get_doi_handles(x, query = NULL, ...)

resolve_doi(x, ...)

is_doi_resolvable(x, ...)

is_doi_found(x, ...)

Arguments

x

A vector created by, or convertable to doi().

query

A named list of query parameters.

...

Arguments passed on to httr::GET

config

Additional configuration settings such as http authentication (authenticate()), additional headers (add_headers()), cookies (set_cookies()) etc. See config() for full details and list of helpers.

handle

The handle to use with this request. If not supplied, will be retrieved and reused from the handle_pool() based on the scheme, hostname and port of the url. By default httr requests to the same scheme/host/port combo. This substantially reduces connection time, and ensures that cookies are maintained over multiple requests to the same host. See handle_pool() for more details.

Functions

  • resolve_doi: Get the resolved URL for a DOI. Returns NA if there is no URL value (rare, but theoretically possible).

  • is_doi_resolvable: Tests whether there is a URL to resolve to. Simple wrapper around resolve_doi()

  • is_doi_found: Test whether DOI handle can be found on doi.org.

Warning

If you are using this in your own package, or create a lot of traffic, please set your own httr::user_agent().

Other APIs

This client only queries the doi.org API. The doi.org API only includes information on DOI resolution, not other metadata. For other APIs, see doi_ras()

Progress bar

Emits a progressr::progressor() progress bar. To enable in your session run:

progressr::handlers(global = TRUE)

See progressr documentation for details.

See also

Examples

# from https://www.doi.org/factsheets/DOIProxy.html
get_doi_handles(
  x = c("10.1000/1", "10.1038/nphys1170"),
  query = list(type = "URL")
)
#> [[1]]
#> [[1]]$responseCode
#> [1] 1
#> 
#> [[1]]$handle
#> [1] "10.1000/1"
#> 
#> [[1]]$values
#> [[1]]$values[[1]]
#> [[1]]$values[[1]]$index
#> [1] 1
#> 
#> [[1]]$values[[1]]$type
#> [1] "URL"
#> 
#> [[1]]$values[[1]]$data
#> [[1]]$values[[1]]$data$format
#> [1] "string"
#> 
#> [[1]]$values[[1]]$data$value
#> [1] "http://www.doi.org/index.html"
#> 
#> 
#> [[1]]$values[[1]]$ttl
#> [1] 86400
#> 
#> [[1]]$values[[1]]$timestamp
#> [1] "2014-09-26T14:40:46Z"
#> 
#> 
#> 
#> 
#> [[2]]
#> [[2]]$responseCode
#> [1] 1
#> 
#> [[2]]$handle
#> [1] "10.1038/nphys1170"
#> 
#> [[2]]$values
#> [[2]]$values[[1]]
#> [[2]]$values[[1]]$index
#> [1] 1
#> 
#> [[2]]$values[[1]]$type
#> [1] "URL"
#> 
#> [[2]]$values[[1]]$data
#> [[2]]$values[[1]]$data$format
#> [1] "string"
#> 
#> [[2]]$values[[1]]$data$value
#> [1] "http://www.nature.com/articles/nphys1170"
#> 
#> 
#> [[2]]$values[[1]]$ttl
#> [1] 86400
#> 
#> [[2]]$values[[1]]$timestamp
#> [1] "2017-12-29T06:49:37Z"
#> 
#> 
#> 
#> 
resolve_doi(c("10.1038/nphys1170", "10.1000/1"))
#> [1] "http://www.nature.com/articles/nphys1170"
#> [2] "http://www.doi.org/index.html"           
is_doi_resolvable(c("10.1000/1", "10.1000/2"))
#> [1] TRUE TRUE
is_doi_found(c("10.1000/I_DO_NOT_EXIST", "10.1000/1"))
#> [1] FALSE  TRUE