CORE API R client
Development version
devtools::install_github("ropenscilabs/cored")
library("cored")
Each function has a higher level interface that does HTTP request for data and parses
the JSON using jsonlite
. This is meant for those who want everything done for them,
but there's a time penalty for as the parsing adds extra time. If you just want raw JSON
unparsed text, you can use the low level interface.
The low level version of each function has _
at the end (e.g., core_search_
), while the
high level version doesn't have the _
(e.g., core_search
).
The high level version of each function uses the low level method, and the low level method does all the logic and HTTP requesting, whereas the high level simply parses the output.
core_search(query = 'ecology', limit = 12)
#> $status
#> [1] "OK"
#>
#> $totalHits
#> [1] 228626
#>
#> $data
#> type id
#> 1 journal issn:1005-264X
#> 2 journal issn:2287-8327
#> 3 journal issn:2193-3081
#> 4 journal issn:2351-9894
#> 5 article 15172123
#> 6 journal issn:1472-6785
#> 7 journal issn:1712-6568
#> 8 journal issn:2008-9287
#> 9 journal issn:2356-6647
#> 10 journal issn:1687-9708
#> 11 journal issn:1708-3087
#> 12 journal issn:2299-1042
core_search_(query = 'ecology', limit = 12)
#> [1] "{\"status\":\"OK\",\"totalHits\":228626,\"data\":[{\"type\":\"journal\",\"id\":\"issn:1005-264X\"},{\"type\":\"journal\",\"id\":\"issn:2287-8327\"},{\"type\":\"journal\",\"id\":\"issn:2193-3081\"},{\"type\":\"journal\",\"id\":\"issn:2351-9894\"},{\"type\":\"article\",\"id\":\"15172123\"},{\"type\":\"journal\",\"id\":\"issn:1472-6785\"},{\"type\":\"journal\",\"id\":\"issn:1712-6568\"},{\"type\":\"journal\",\"id\":\"issn:2008-9287\"},{\"type\":\"journal\",\"id\":\"issn:2356-6647\"},{\"type\":\"journal\",\"id\":\"issn:1687-9708\"},{\"type\":\"journal\",\"id\":\"issn:1708-3087\"},{\"type\":\"journal\",\"id\":\"issn:2299-1042\"}]}"
core_articles(id = 21132995)
#> $status
#> [1] "OK"
#>
#> $data
#> $data$id
#> [1] 21132995
#>
#> $data$authors
#> list()
#>
...
core_articles_history(id = '21132995')
#> $status
#> [1] "OK"
#>
#> $data
#> datetime
...
core_journals(id = '2167-8359')
#> $status
#> [1] "OK"
#>
#> $data
#> $data$title
#> [1] "PeerJ"
#>
#> $data$identifiers
#> [1] "oai:doaj.org/journal:576e4d34b8bf461bb586f1e90d80d7cc"
#> [2] "issn:2167-8359"
...
The _
for these methods means that you get a file path back to the PDF, while the
high level version without the _
parses the pdf to text for you.
core_articles_pdf_(11549557)
- Please report any issues or bugs.
- License: MIT
- Get citation information for
cored
in R doingcitation(package = 'cored')
- Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.