Description Usage Arguments Details References Examples
View source: R/core_articles.R
Get articles
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | core_articles(
id,
metadata = TRUE,
fulltext = FALSE,
citations = FALSE,
similar = FALSE,
duplicate = FALSE,
urls = FALSE,
extractedUrls = FALSE,
faithfulMetadata = FALSE,
key = NULL,
method = "GET",
parse = TRUE,
...
)
core_articles_(
id,
metadata = TRUE,
fulltext = FALSE,
citations = FALSE,
similar = FALSE,
duplicate = FALSE,
urls = FALSE,
extractedUrls = FALSE,
faithfulMetadata = FALSE,
key = NULL,
method = "GET",
...
)
|
id |
(integer) CORE ID of the article that needs to be fetched. Required |
metadata |
Whether to retrieve the full article metadata or only the
ID. Default: |
fulltext |
Whether to retrieve full text of the article. Default:
|
citations |
Whether to retrieve citations found in the article.
Default: |
similar |
Whether to retrieve a list of similar articles.
Default: |
duplicate |
Whether to retrieve a list of CORE IDs of different
versions of the article. Default: |
urls |
Whether to retrieve a list of URLs from which the article can
be downloaded. This can include links to PDFs as well as HTML pages.
Default: |
extractedUrls |
Whether to retrieve a list of URLs which were extracted
from the article fulltext. Default: |
faithfulMetadata |
Whether to retrieve the raw XML metadata of the
article. Default: |
key |
A CORE API key. Get one at
https://core.ac.uk/api-keys/register. Once you have the key,
you can pass it into this parameter, or as a much better option,
store your key as an environment variable with the name
|
method |
(character) one of 'GET' (default) or 'POST' |
parse |
(logical) Whether to parse to list ( |
... |
Curl options passed to |
core_articles
does the HTTP request and parses, while
core_articles_
just does the HTTP request, gives back JSON as a
character string
These functions take one article ID at a time. Use lapply/loops/etc for many ids
https://core.ac.uk/docs/#!/articles/getArticleByCoreIdBatch https://core.ac.uk/docs/#!/articles/getArticleByCoreId
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
core_articles(id = 21132995)
core_articles(id = 21132995, fulltext = TRUE)
core_articles(id = 21132995, citations = TRUE)
# when passing >1 article ID
ids <- c(20955435, 21132995, 21813171, 22815670, 23828884,
23465055, 23831838, 23923390, 22559733)
## you can use method="GET" with lapply or similar
res <- lapply(ids, core_articles)
vapply(res, "[[", "", c("data", "datePublished"))
## or use method="POST" passing all at once
res <- core_articles(ids, method = "POST")
head(res$data)
res$data$authors
# just http request, get text back
core_articles_(id = '21132995')
## POST, can pass many at once
core_articles_(id = ids, method = "POST")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.