Queries the DOI resolution proxy server REST API.
Retries failed requests.
Caches results (when memoise::memoise()
is installed).
get_doi_handles(x, query = NULL, ...) resolve_doi(x, ...) is_doi_resolvable(x, ...) is_doi_found(x, ...)
x | A vector created by, or convertable to |
---|---|
query | A named list of query parameters. |
... | Arguments passed on to
|
get_doi_handles
: Query the handles endpoint.
For details, see the
DOI REST API documentation.
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.
If you are using this in your own package, or create a lot of traffic,
please set your own httr::user_agent()
.
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()
Emits a progressr::progressor()
progress bar.
To enable in your session run:
progressr::handlers(global = TRUE)
See progressr documentation for details.
Other doi:
doiEntry
,
doi_examples()
,
doi_ra
,
doi()
,
regex_doi()
,
view_doi_matches()
# 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