CORE API R client
Get an API key at https://core.ac.uk/api-keys/register. You’ll need one, so do this now if you haven’t yet. Once you have the key, you can pass it into the key
parameter, or as a much better option store your key as an environment variable with the name CORE_KEY
or an R option as core_key
. See ?Startup
for how to work with env vars and R options
“Aggregating the world’s open access research papers”
CORE offers seamless access to millions of open access research papers, enrich the collected data for text-mining and provide unique services to the research community.
For more infos on CORE, see:
Development version
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] 1466685
#>
#> $data
#> type id
#> 1 journal issn:1005-264X
#> 2 journal issn:2287-8327
#> 3 journal issn:2193-3081
#> 4 journal issn:2351-9894
#> 5 journal issn:1472-6785
#> 6 journal issn:1712-6568
#> 7 journal issn:2008-9287
#> 8 journal issn:2356-6647
#> 9 journal issn:1687-9708
#> 10 journal issn:1708-3087
#> 11 journal issn:2299-1042
#> 12 journal issn:2162-1985
core_search_(query = 'ecology', limit = 12)
#> [1] "{\"status\":\"OK\",\"totalHits\":1466686,\"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\":\"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\"},{\"type\":\"journal\",\"id\":\"issn:2162-1985\"}]}"
query <- data.frame("all_of_the_words" = "data mining",
"without_the_words" = "social science",
"year_from" = "2013",
"year_to" = "2014")
core_advanced_search(query)
#> $status
#> [1] "OK"
#>
#> $totalHits
#> [1] 25406
#>
#> $data
#> type id
#> 1 article 22642150
#> 2 article 22620954
#> 3 article 22650635
#> 4 article 24006259
#> 5 article 23964816
#> 6 article 157985087
#> 7 article 44501305
#> 8 article 24074440
#> 9 article 22581369
#> 10 article 22654775
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
#> 1 2016-08-03 00:13:41
#> 2 2014-10-22 16:42:14
...
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.
rcoreoa
in R doing citation(package = 'rcoreoa')